mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning
@ 2016-02-23 17:44 Tapan Prakash T
  2016-02-23 17:55 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Tapan Prakash T @ 2016-02-23 17:44 UTC (permalink / raw)
  To: gregkh, lambert.quentin, joe; +Cc: linux-kernel, Tapan Prakash T

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

Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com>
---
 drivers/staging/rts5208/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index 244d589..6ae7b54 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -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");
-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning
  2016-02-23 17:44 [PATCH] drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning Tapan Prakash T
@ 2016-02-23 17:55 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2016-02-23 17:55 UTC (permalink / raw)
  To: Tapan Prakash T, gregkh, lambert.quentin; +Cc: linux-kernel

On Tue, 2016-02-23 at 23:14 +0530, Tapan Prakash T wrote:
> Fixed checkpatch.pl warning 'Comparisons should place the constant on
> the right side of the test'
[]
> diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
[]
> @@ -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");

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)) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-23 17:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23 17:44 [PATCH] drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning Tapan Prakash T
2016-02-23 17:55 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®