* [PATCH] nvmem: core: remove unneeded NULL check
@ 2017-06-30 7:59 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-06-30 7:59 UTC (permalink / raw)
To: Srinivas Kandagatla; +Cc: linux-kernel, kernel-janitors
"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>
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 4c49285168fb..f76916b936e1 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;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-30 7:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30 7:59 [PATCH] nvmem: core: remove unneeded NULL check Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox