linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bsr: do not use assignment in if condition
@ 2019-05-15 13:15 parna.naveenkumar
  2019-05-15 13:32 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: parna.naveenkumar @ 2019-05-15 13:15 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel, Naveen Kumar Parna

From: Naveen Kumar Parna <parna.naveenkumar@gmail.com>

checkpatch.pl does not like assignment in if condition

Signed-off-by: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
---
 drivers/char/bsr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index a6cef548e01e..2b00748b83d2 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -322,7 +322,8 @@ static int __init bsr_init(void)
 		goto out_err_2;
 	}
 
-	if ((ret = bsr_create_devs(np)) < 0) {
+	ret = bsr_create_devs(np);
+	if (ret  < 0) {
 		np = NULL;
 		goto out_err_3;
 	}
-- 
2.17.1


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

* Re: [PATCH] bsr: do not use assignment in if condition
  2019-05-15 13:15 [PATCH] bsr: do not use assignment in if condition parna.naveenkumar
@ 2019-05-15 13:32 ` Greg KH
       [not found]   ` <CAKXhv7csf3Qys4KsN+OJuPwb4daakC3U93boUwxd3t-9D9uNQw@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2019-05-15 13:32 UTC (permalink / raw)
  To: parna.naveenkumar; +Cc: arnd, linux-kernel

On Wed, May 15, 2019 at 06:45:24PM +0530, parna.naveenkumar@gmail.com wrote:
> From: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
> 
> checkpatch.pl does not like assignment in if condition
> 
> Signed-off-by: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
> ---
>  drivers/char/bsr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
> index a6cef548e01e..2b00748b83d2 100644
> --- a/drivers/char/bsr.c
> +++ b/drivers/char/bsr.c
> @@ -322,7 +322,8 @@ static int __init bsr_init(void)
>  		goto out_err_2;
>  	}
>  
> -	if ((ret = bsr_create_devs(np)) < 0) {
> +	ret = bsr_create_devs(np);
> +	if (ret  < 0) {

Checkpatch also probably does not like that if statement :(


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

* Re: [PATCH] bsr: do not use assignment in if condition
       [not found]   ` <CAKXhv7csf3Qys4KsN+OJuPwb4daakC3U93boUwxd3t-9D9uNQw@mail.gmail.com>
@ 2019-05-15 14:15     ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2019-05-15 14:15 UTC (permalink / raw)
  To: Naveen Kumar Parna; +Cc: arnd, linux-kernel

On Wed, May 15, 2019 at 07:16:37PM +0530, Naveen Kumar Parna wrote:
> On Wed, 15 May 2019 at 19:02, Greg KH <gregkh@linuxfoundation.org> wrote:
> 
> > On Wed, May 15, 2019 at 06:45:24PM +0530, parna.naveenkumar@gmail.com
> > wrote:
> > > From: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
> > >
> > > checkpatch.pl does not like assignment in if condition
> > >
> > > Signed-off-by: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
> > > ---
> > >  drivers/char/bsr.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
> > > index a6cef548e01e..2b00748b83d2 100644
> > > --- a/drivers/char/bsr.c
> > > +++ b/drivers/char/bsr.c
> > > @@ -322,7 +322,8 @@ static int __init bsr_init(void)
> > >               goto out_err_2;
> > >       }
> > >
> > > -     if ((ret = bsr_create_devs(np)) < 0) {
> > > +     ret = bsr_create_devs(np);
> > > +     if (ret  < 0) {
> >
> > Checkpatch also probably does not like that if statement :(
> >
> I ran checkpatch script and it did not show any warning or error.
> 
> $ ./scripts/checkpatch.pl
> 0001-bsr-do-not-use-assignment-in-if-condition.patch
> total: 0 errors, 0 warnings, 9 lines checked
> 0001-bsr-do-not-use-assignment-in-if-condition.patch has no obvious style
> problems and is ready for submission.

Ok, then checkpatch missed it, but your eyes should have caught it.

When you are doing code style fixes outside of the drivers/staging/
area, you need to be very careful to be sure to get it right, as many
maintainers do not like the churn.

Please fix this up and resend.

thanks,

greg k-h

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

end of thread, other threads:[~2019-05-15 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 13:15 [PATCH] bsr: do not use assignment in if condition parna.naveenkumar
2019-05-15 13:32 ` Greg KH
     [not found]   ` <CAKXhv7csf3Qys4KsN+OJuPwb4daakC3U93boUwxd3t-9D9uNQw@mail.gmail.com>
2019-05-15 14:15     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).