Skip to content

Commit

Permalink
nvmem: core: remove unneeded NULL check
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and gregkh committed Aug 28, 2017
1 parent d026d70 commit fd08611
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvmem/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fd08611

Please sign in to comment.