summaryrefslogtreecommitdiffstats
path: root/drivers/nvmem/core.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-07-26 11:34:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-28 17:33:23 +0200
commitfd08611317a3397d8dd54c68e98afc8396fa11f7 (patch)
treecdb621c8cd46fcac06a8e951ad9eb9653950e1f2 /drivers/nvmem/core.c
parentnvmem: core: Add nvmem_cell_read_u32 (diff)
downloadlinux-fd08611317a3397d8dd54c68e98afc8396fa11f7.tar.xz
linux-fd08611317a3397d8dd54c68e98afc8396fa11f7.zip
nvmem: core: remove unneeded NULL check
"p" is the list iterator so it can't be NULL. Static checkers complain about this unnecessary check because we dereference the list iterator to get the next item in the list so we'd be in trouble if it really was NULL. I have removed the check. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem/core.c')
-rw-r--r--drivers/nvmem/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 72a60dc8a429..de54c7f5048a 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -290,7 +290,7 @@ static struct nvmem_cell *nvmem_find_cell(const char *cell_id)
mutex_lock(&nvmem_cells_mutex);
list_for_each_entry(p, &nvmem_cells, node)
- if (p && !strcmp(p->name, cell_id)) {
+ if (!strcmp(p->name, cell_id)) {
mutex_unlock(&nvmem_cells_mutex);
return p;
}