[PATCH 21/32] nvmem: core: drop always true condition

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Sep 5 02:55:46 PDT 2022


The iterator in a list_for_each_entry's body can never be NULL, so drop
the needless NULL check.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/nvmem/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index c344738abd51..c89ad08f81d8 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -136,7 +136,7 @@ static struct nvmem_cell *nvmem_find_cell(const char *cell_id)
 	struct nvmem_cell *p;
 
 	list_for_each_entry(p, &nvmem_cells, node)
-		if (p && !strcmp(p->name, cell_id))
+		if (!strcmp(p->name, cell_id))
 			return p;
 
 	return NULL;
-- 
2.30.2




More information about the barebox mailing list