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


Groups > linux.kernel > #1328311 > unrolled thread

[PATCH] staging: rtl8712: Fix Comparison with constant warning.

Started byPinkesh Badjatiya <pinkeshbadjatiya@gmail.com>
First post2016-02-06 15:50 +0100
Last post2016-02-08 05:00 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: rtl8712: Fix Comparison with constant warning. Pinkesh Badjatiya <pinkeshbadjatiya@gmail.com> - 2016-02-06 15:50 +0100
    Re: [PATCH] staging: rtl8712: Fix Comparison with constant warning. Larry Finger <Larry.Finger@lwfinger.net> - 2016-02-06 16:00 +0100
      Re: [PATCH] staging: rtl8712: Fix Comparison with constant warning. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-08 04:50 +0100
    Re: [PATCH] staging: rtl8712: Fix Comparison with constant warning. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-08 05:00 +0100

#1328311 — [PATCH] staging: rtl8712: Fix Comparison with constant warning.

FromPinkesh Badjatiya <pinkeshbadjatiya@gmail.com>
Date2016-02-06 15:50 +0100
Subject[PATCH] staging: rtl8712: Fix Comparison with constant warning.
Message-ID<qZcls-bk-3@gated-at.bofh.it>
Fix Comparisons with constant on the left side of the test.
Checkpatch.pl warning.
--
WARNING: Comparisons should place the constant on the right side of the
test
296: FILE: ./rtl8712_cmd.c:296:
	while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) &&

Signed-off-by: Pinkesh Badjatiya <pinkeshbadjatiya@gmail.com>
---
 drivers/staging/rtl8712/rtl8712_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
index 9b91609..ce3f7da 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -293,7 +293,7 @@ u8 r8712_fw_cmd(struct _adapter *pAdapter, u32 cmd)
 
 	r8712_write32(pAdapter, IOCMD_CTRL_REG, cmd);
 	msleep(100);
-	while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) &&
+	while ((r8712_read32(pAdapter, IOCMD_CTRL_REG) != 0) &&
 	       (pollingcnts > 0)) {
 		pollingcnts--;
 		msleep(20);
-- 
1.9.1

[toc] | [next] | [standalone]


#1328317

FromLarry Finger <Larry.Finger@lwfinger.net>
Date2016-02-06 16:00 +0100
Message-ID<qZcv8-eX-11@gated-at.bofh.it>
In reply to#1328311
On 02/06/2016 08:41 AM, Pinkesh Badjatiya wrote:
> Fix Comparisons with constant on the left side of the test.
> Checkpatch.pl warning.
> --
> WARNING: Comparisons should place the constant on the right side of the
> test
> 296: FILE: ./rtl8712_cmd.c:296:
> 	while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) &&
>
> Signed-off-by: Pinkesh Badjatiya <pinkeshbadjatiya@gmail.com>
> ---
>   drivers/staging/rtl8712/rtl8712_cmd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

This is another case where the writers of checkpatch are forcing their ideas of 
style on the whole world. The problem is that if I reject your patch, it will be 
submitted by someone else. Thus, reluctantly

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>


>
> diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
> index 9b91609..ce3f7da 100644
> --- a/drivers/staging/rtl8712/rtl8712_cmd.c
> +++ b/drivers/staging/rtl8712/rtl8712_cmd.c
> @@ -293,7 +293,7 @@ u8 r8712_fw_cmd(struct _adapter *pAdapter, u32 cmd)
>
>   	r8712_write32(pAdapter, IOCMD_CTRL_REG, cmd);
>   	msleep(100);
> -	while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) &&
> +	while ((r8712_read32(pAdapter, IOCMD_CTRL_REG) != 0) &&
>   	       (pollingcnts > 0)) {
>   		pollingcnts--;
>   		msleep(20);
>

[toc] | [prev] | [next] | [standalone]


#1328738

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-02-08 04:50 +0100
Message-ID<qZKZQ-7N0-1@gated-at.bofh.it>
In reply to#1328317
On Sat, Feb 06, 2016 at 08:53:57AM -0600, Larry Finger wrote:
> On 02/06/2016 08:41 AM, Pinkesh Badjatiya wrote:
> >Fix Comparisons with constant on the left side of the test.
> >Checkpatch.pl warning.
> >--
> >WARNING: Comparisons should place the constant on the right side of the
> >test
> >296: FILE: ./rtl8712_cmd.c:296:
> >	while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) &&
> >
> >Signed-off-by: Pinkesh Badjatiya <pinkeshbadjatiya@gmail.com>
> >---
> >  drivers/staging/rtl8712/rtl8712_cmd.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> This is another case where the writers of checkpatch are forcing their ideas
> of style on the whole world. The problem is that if I reject your patch, it
> will be submitted by someone else. Thus, reluctantly
> 
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Well, the general kernel coding style is to put constants on the right
hand of the expression, so it is good to have it this way...

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1328744

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-02-08 05:00 +0100
Message-ID<qZL9v-7QE-7@gated-at.bofh.it>
In reply to#1328311
On Sat, Feb 06, 2016 at 08:11:11PM +0530, Pinkesh Badjatiya wrote:
> Fix Comparisons with constant on the left side of the test.
> Checkpatch.pl warning.
> --
> WARNING: Comparisons should place the constant on the right side of the
> test
> 296: FILE: ./rtl8712_cmd.c:296:
> 	while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) &&
> 
> Signed-off-by: Pinkesh Badjatiya <pinkeshbadjatiya@gmail.com>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>  drivers/staging/rtl8712/rtl8712_cmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Someone else sent this before you did, sorry :(

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web