From: Masahiro Yamada Date: Mon, 17 Nov 2014 08:19:39 +0000 (+0900) Subject: dm: core: remove meaningless if conditional X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=84a71537333e05b920a5679b4b18d61fc925fefa;p=u-boot.git 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 --- 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; }