Skip to contentSkip to conversation

drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning

PATCH In review Tapan Prakash T 2 participants 2 messages Feb 23, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning

Fixed checkpatch.pl warning 'Comparisons should place the constant on the right side of the test'

---
 drivers/staging/rts5208/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/sd.c +1 -1
index 244d589..6ae7b54 100644
@@ -1438,7 +1438,7 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)
 
 #ifdef SUPPORT_SD_LOCK
 	if ((sd_card->sd_lock_status & SD_SDR_RST)
-			&& (DDR50_SUPPORT == func_to_switch)
+			&& (func_to_switch == DDR50_SUPPORT)
 			&& (sd_card->func_group1_mask & SDR50_SUPPORT_MASK)) {
 		func_to_switch = SDR50_SUPPORT;
 		dev_dbg(rtsx_dev(chip), "Using SDR50 instead of DDR50 for SD Lock\n");
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Tapan Prakash T

Fixed checkpatch.pl warning 'Comparisons should place the constant on the right side of the test'

[]

drivers/staging/rts5208/sd.c

Quoted 1 line
drivers/staging/rts5208/sd.c +0 -0

[]

Quoted 9 lines
drivers/staging/rts5208/sd.c +0 -0
@@ -1438,7 +1438,7 @@ static int sd_switch_function(struct rtsx_chip *chip, u8 bus_width)


 #ifdef SUPPORT_SD_LOCK
  if ((sd_card->sd_lock_status & SD_SDR_RST)

drivers/staging/rts5208/sd.c +1 -1
-			&& (DDR50_SUPPORT == func_to_switch)
+			&& (func_to_switch == DDR50_SUPPORT)

  && (sd_card->func_group1_mask & SDR50_SUPPORT_MASK)) { func_to_switch = SDR50_SUPPORT;
  dev_dbg(rtsx_dev(chip), "Using SDR50 instead of DDR50 for SD Lock\n");

It would also be more common to write this with the logical tests at the end of line like:

  if ((sd_card->sd_lock_status & SD_SDR_RST) &&

	    (func_to_switch == DDR50_SUPPORT) &&
	    (sd_card->func_group1_mask & SDR50_SUPPORT_MASK)) {