]> code.ossystems Code Review - bsp/u-boot.git/commitdiff
mtd: cfi_flash: fix clang warning
authorJeroen Hofstee <jeroen@myspectrum.nl>
Tue, 17 Jun 2014 20:47:31 +0000 (22:47 +0200)
committerOtavio Salvador <otavio@ossystems.com.br>
Sun, 10 Aug 2014 23:49:03 +0000 (20:49 -0300)
clang warns this check is silly; it is since s is
a local variable.

u-boot/drivers/mtd/cfi_flash.c:2363:13: warning: comparison of
  array 's' not equal to a null pointer is always true
  else if ((s != NULL) && (strcmp(s, "yes") == 0)) {

cc: Stefan Roese <sr@denx.de>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
drivers/mtd/cfi_flash.c

index a389cd101c2f55e62ca8ab90efaf395234d98713..c4b5bc1de553d2101fc5aca3f0a3a5d1f616c509 100644 (file)
@@ -2360,7 +2360,7 @@ unsigned long flash_init (void)
 #endif /* CONFIG_SYS_FLASH_QUIET_TEST */
                }
 #ifdef CONFIG_SYS_FLASH_PROTECTION
-               else if ((s != NULL) && (strcmp(s, "yes") == 0)) {
+               else if (strcmp(s, "yes") == 0) {
                        /*
                         * Only the U-Boot image and it's environment
                         * is protected, all other sectors are