Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rts5208: remove redundant sd30_mode checks

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>

authored by

Colin Ian King and committed by
Greg Kroah-Hartman
2e63a4a4 be22bc7c

+10 -18
+10 -18
drivers/staging/rts5208/sd.c
··· 2573 2573 retval = sd_sdr_tuning(chip); 2574 2574 2575 2575 if (retval != STATUS_SUCCESS) { 2576 - if (sd20_mode) { 2576 + retval = sd_init_power(chip); 2577 + if (retval != STATUS_SUCCESS) 2577 2578 goto status_fail; 2578 - } else { 2579 - retval = sd_init_power(chip); 2580 - if (retval != STATUS_SUCCESS) 2581 - goto status_fail; 2582 2579 2583 - try_sdio = false; 2584 - sd20_mode = true; 2585 - goto switch_fail; 2586 - } 2580 + try_sdio = false; 2581 + sd20_mode = true; 2582 + goto switch_fail; 2587 2583 } 2588 2584 2589 2585 sd_send_cmd_get_rsp(chip, SEND_STATUS, sd_card->sd_addr, ··· 2594 2598 if (read_lba0) { 2595 2599 retval = sd_read_lba0(chip); 2596 2600 if (retval != STATUS_SUCCESS) { 2597 - if (sd20_mode) { 2601 + retval = sd_init_power(chip); 2602 + if (retval != STATUS_SUCCESS) 2598 2603 goto status_fail; 2599 - } else { 2600 - retval = sd_init_power(chip); 2601 - if (retval != STATUS_SUCCESS) 2602 - goto status_fail; 2603 2604 2604 - try_sdio = false; 2605 - sd20_mode = true; 2606 - goto switch_fail; 2607 - } 2605 + try_sdio = false; 2606 + sd20_mode = true; 2607 + goto switch_fail; 2608 2608 } 2609 2609 } 2610 2610 }