* [PATCH] staging: rtl8712: Fix Comparison with constant warning.
@ 2016-02-06 14:41 Pinkesh Badjatiya
2016-02-06 14:53 ` Larry Finger
2016-02-08 3:53 ` Greg Kroah-Hartman
0 siblings, 2 replies; 4+ messages in thread
From: Pinkesh Badjatiya @ 2016-02-06 14:41 UTC (permalink / raw)
To: Larry Finger, Florian Schilhabel, Greg Kroah-Hartman,
Luis de Bethencourt, Aya Mahfouz, Shivani Bhardwaj,
Pinkesh Badjatiya, Punit Vara
Cc: devel, linux-kernel
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8712: Fix Comparison with constant warning.
2016-02-06 14:41 [PATCH] staging: rtl8712: Fix Comparison with constant warning Pinkesh Badjatiya
@ 2016-02-06 14:53 ` Larry Finger
2016-02-08 3:47 ` Greg Kroah-Hartman
2016-02-08 3:53 ` Greg Kroah-Hartman
1 sibling, 1 reply; 4+ messages in thread
From: Larry Finger @ 2016-02-06 14:53 UTC (permalink / raw)
To: Pinkesh Badjatiya, Greg Kroah-Hartman, Luis de Bethencourt,
Aya Mahfouz, Shivani Bhardwaj, Punit Vara
Cc: devel, linux-kernel
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);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8712: Fix Comparison with constant warning.
2016-02-06 14:53 ` Larry Finger
@ 2016-02-08 3:47 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2016-02-08 3:47 UTC (permalink / raw)
To: Larry Finger
Cc: Pinkesh Badjatiya, Luis de Bethencourt, Aya Mahfouz,
Shivani Bhardwaj, Punit Vara, devel, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8712: Fix Comparison with constant warning.
2016-02-06 14:41 [PATCH] staging: rtl8712: Fix Comparison with constant warning Pinkesh Badjatiya
2016-02-06 14:53 ` Larry Finger
@ 2016-02-08 3:53 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2016-02-08 3:53 UTC (permalink / raw)
To: Pinkesh Badjatiya
Cc: Larry Finger, Florian Schilhabel, Luis de Bethencourt,
Aya Mahfouz, Shivani Bhardwaj, Punit Vara, devel, linux-kernel
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 :(
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-08 3:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-06 14:41 [PATCH] staging: rtl8712: Fix Comparison with constant warning Pinkesh Badjatiya
2016-02-06 14:53 ` Larry Finger
2016-02-08 3:47 ` Greg Kroah-Hartman
2016-02-08 3:53 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.