nvmem: core: remove unneeded NULL check
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 26 Jul 2017 09:34:47 +0000 (11:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 15:33:23 +0000 (17:33 +0200)
"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>
drivers/nvmem/core.c

index 72a60dc8a429c378c331d4fbb8799a702dd45663..de54c7f5048af4005dbfc51c04579813e9635455 100644 (file)
@@ -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;
                }