summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2016-02-26 15:34:34 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-11 22:09:09 -0800
commiteff8bf82432b6a3cd367e765a1806ebe3d1556e8 (patch)
treed404e18a1151fcb1b6c89e5988180e7526dc660a /drivers/staging/rts5208
parent51a4731133410a63bcc833068dba4a0e2ec1fcea (diff)
downloadblackbird-obmc-linux-eff8bf82432b6a3cd367e765a1806ebe3d1556e8.tar.gz
blackbird-obmc-linux-eff8bf82432b6a3cd367e765a1806ebe3d1556e8.zip
Staging: rts5208: Use min instead of ternary operator
This patch replaces ternary operator with macro min as it shorter and thus increases code readability. Macro min returns the minimum of the two compared values. Made a semantic patch for changes: @@ type T; T x; T y; @@ ( - x < y ? x : y + min(x,y) | - x > y ? x : y + max(x,y) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208')
-rw-r--r--drivers/staging/rts5208/sd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index 244d589db359..1612610c1f56 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -303,7 +303,7 @@ static int sd_read_data(struct rtsx_chip *chip,
if (cmd_len) {
dev_dbg(rtsx_dev(chip), "SD/MMC CMD %d\n", cmd[0] - 0x40);
- for (i = 0; i < (cmd_len < 6 ? cmd_len : 6); i++)
+ for (i = 0; i < (min(cmd_len, 6)); i++)
rtsx_add_cmd(chip, WRITE_REG_CMD, REG_SD_CMD0 + i,
0xFF, cmd[i]);
}
@@ -383,7 +383,7 @@ static int sd_write_data(struct rtsx_chip *chip, u8 trans_mode,
if (cmd_len) {
dev_dbg(rtsx_dev(chip), "SD/MMC CMD %d\n", cmd[0] - 0x40);
- for (i = 0; i < (cmd_len < 6 ? cmd_len : 6); i++) {
+ for (i = 0; i < (min(cmd_len, 6)); i++) {
rtsx_add_cmd(chip, WRITE_REG_CMD,
REG_SD_CMD0 + i, 0xFF, cmd[i]);
}
OpenPOWER on IntegriCloud