From 84a71537333e05b920a5679b4b18d61fc925fefa Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 17 Nov 2014 17:19:39 +0900 Subject: [PATCH] dm: core: remove meaningless if conditional If the variable "ret" is equal to "-ENOENT", it is trapped at [1] and never reaches [2]. At [3], the condition "ret != -ENOENT" is always true. if (ret == -ENOENT) { <------------------ [1] continue; } else if (ret == -ENODEV) { dm_dbg("Device '%s' has no compatible string\n", name); break; } else if (ret) { <------------------ [2] dm_warn("Device tree error at offset %d\n", offset); if (!result || ret != -ENOENT) <------------------ [3] result = ret; break; } Signed-off-by: Masahiro Yamada Acked-by: Simon Glass --- drivers/core/lists.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 7a1d6604d4..3a1823db02 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -164,8 +164,7 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset, break; } else if (ret) { dm_warn("Device tree error at offset %d\n", offset); - if (!result || ret != -ENOENT) - result = ret; + result = ret; break; } -- 2.39.5