staging: rts5208: remove redundant sd30_mode checks
authorColin Ian King <colin.king@canonical.com>
Fri, 30 Aug 2019 08:10:47 +0000 (09:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Sep 2019 07:36:07 +0000 (09:36 +0200)
There are two hunks of code that check if sd30_mode is true however
an earlier check in an outer code block on sd30_mode being false means
that sd30_mode can never be true at these points so these checks are
redundant.  Remove the dead code.

Addresses-Coverity: ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190830081047.13630-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/sd.c

index a060453..25c3149 100644 (file)
@@ -2573,17 +2573,13 @@ SD_UNLOCK_ENTRY:
                        retval = sd_sdr_tuning(chip);
 
                if (retval != STATUS_SUCCESS) {
-                       if (sd20_mode) {
+                       retval = sd_init_power(chip);
+                       if (retval != STATUS_SUCCESS)
                                goto status_fail;
-                       } else {
-                               retval = sd_init_power(chip);
-                               if (retval != STATUS_SUCCESS)
-                                       goto status_fail;
 
-                               try_sdio = false;
-                               sd20_mode = true;
-                               goto switch_fail;
-                       }
+                       try_sdio = false;
+                       sd20_mode = true;
+                       goto switch_fail;
                }
 
                sd_send_cmd_get_rsp(chip, SEND_STATUS, sd_card->sd_addr,
@@ -2598,17 +2594,13 @@ SD_UNLOCK_ENTRY:
                if (read_lba0) {
                        retval = sd_read_lba0(chip);
                        if (retval != STATUS_SUCCESS) {
-                               if (sd20_mode) {
+                               retval = sd_init_power(chip);
+                               if (retval != STATUS_SUCCESS)
                                        goto status_fail;
-                               } else {
-                                       retval = sd_init_power(chip);
-                                       if (retval != STATUS_SUCCESS)
-                                               goto status_fail;
 
-                                       try_sdio = false;
-                                       sd20_mode = true;
-                                       goto switch_fail;
-                               }
+                               try_sdio = false;
+                               sd20_mode = true;
+                               goto switch_fail;
                        }
                }
        }