Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
fd086113 d026d70a

+1 -1
+1 -1
drivers/nvmem/core.c
··· 290 290 mutex_lock(&nvmem_cells_mutex); 291 291 292 292 list_for_each_entry(p, &nvmem_cells, node) 293 - if (p && !strcmp(p->name, cell_id)) { 293 + if (!strcmp(p->name, cell_id)) { 294 294 mutex_unlock(&nvmem_cells_mutex); 295 295 return p; 296 296 }