diff options
author | Tobias Nießen <tobias.niessen@stud.uni-hannover.de> | 2019-06-26 16:28:56 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-01 09:05:21 +0200 |
commit | 34a49d9edf3af971867e3876de7dc9935d467f67 (patch) | |
tree | 54b2064cb0680a88580455a1b827fe422834338d /drivers | |
parent | 7ff9f78ea683229264d813949ae21b24234267c6 (diff) | |
download | linux-34a49d9edf3af971867e3876de7dc9935d467f67.tar.bz2 |
staging: rts5208: Rewrite redundant if statement to improve code style
This commit uses the fact that
if (a) {
if (b) {
...
}
}
can instead be written as
if (a && b) {
...
}
without any change in behavior, allowing to decrease the indentation
of the contained code block and thus reducing the average line length.
Signed-off-by: Tobias Nießen <tobias.niessen@stud.uni-hannover.de>
Signed-off-by: Sabrina Gaube <sabrina-gaube@web.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rts5208/sd.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c index b3f829ed1019..a06045344301 100644 --- a/drivers/staging/rts5208/sd.c +++ b/drivers/staging/rts5208/sd.c @@ -4507,20 +4507,19 @@ int sd_execute_write_data(struct scsi_cmnd *srb, struct rtsx_chip *chip) sd_lock_state, sd_card->sd_lock_status); if (sd_lock_state ^ (sd_card->sd_lock_status & SD_LOCKED)) { sd_card->sd_lock_notify = 1; - if (sd_lock_state) { - if (sd_card->sd_lock_status & SD_LOCK_1BIT_MODE) { - sd_card->sd_lock_status |= ( - SD_UNLOCK_POW_ON | SD_SDR_RST); - if (CHK_SD(sd_card)) { - retval = reset_sd(chip); - if (retval != STATUS_SUCCESS) { - sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST); - goto sd_execute_write_cmd_failed; - } + if (sd_lock_state && + (sd_card->sd_lock_status & SD_LOCK_1BIT_MODE)) { + sd_card->sd_lock_status |= ( + SD_UNLOCK_POW_ON | SD_SDR_RST); + if (CHK_SD(sd_card)) { + retval = reset_sd(chip); + if (retval != STATUS_SUCCESS) { + sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST); + goto sd_execute_write_cmd_failed; } - - sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST); } + + sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST); } } } |