Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1340912

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

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning
Date 2016-02-23 19:00 +0100
Message-ID <r5ppE-jj-5@gated-at.bofh.it> (permalink)
References <r5pfY-fN-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] drivers: staging: rts5208: sd.c: Fix Comparisons should place the constant on the right side of the test warning Tapan Prakash T <tapanprakasht@gmail.com> - 2016-02-23 18:50 +0100
  Re: [PATCH] drivers: staging: rts5208: sd.c: Fix Comparisons should  place the constant on the right side of the test warning Joe Perches <joe@perches.com> - 2016-02-23 19:00 +0100

csiph-web