]> git.sur5r.net Git - u-boot/commitdiff
dm: core: remove meaningless if conditional
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Mon, 17 Nov 2014 08:19:39 +0000 (17:19 +0900)
committerSimon Glass <sjg@chromium.org>
Sat, 22 Nov 2014 09:16:48 +0000 (10:16 +0100)
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 <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/core/lists.c

index 7a1d6604d42faa36c5a8f1eebe3eedb53870ccd8..3a1823db0205498fb8a42c4ffa75bc77d1c02770 100644 (file)
@@ -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;
                }