Re: Re: [PATCH] usb: chipidea: use better pattern with WARN_ON()

2016-12-07 Thread Greg KH
On Wed, Dec 07, 2016 at 03:00:29PM +, Atul Raj wrote: > On 7 Dec 2016 18:56, "Greg KH" wrote: > > > > On Wed, Dec 07, 2016 at 05:46:09PM +0530, Atul Raj wrote: > > > Instead of using: > > > if (cond) { > > >WARN_ON(1); > > >do_stuff(); > > > } > > > > > > Use a better pattern

RE: Re: [PATCH] usb: chipidea: use better pattern with WARN_ON()

2016-12-07 Thread Atul Raj
On 7 Dec 2016 18:56, "Greg KH" wrote: > > On Wed, Dec 07, 2016 at 05:46:09PM +0530, Atul Raj wrote: > > Instead of using: > > if (cond) { > >WARN_ON(1); > >do_stuff(); > > } > > > > Use a better pattern with WARN_ON() placed in if condition: > > > > if (WARN_ON(cond)) > >do

Re: [PATCH] usb: chipidea: use better pattern with WARN_ON()

2016-12-07 Thread Greg KH
On Wed, Dec 07, 2016 at 05:46:09PM +0530, Atul Raj wrote: > Instead of using: > if (cond) { >WARN_ON(1); >do_stuff(); > } > > Use a better pattern with WARN_ON() placed in if condition: > > if (WARN_ON(cond)) >do_stuff(); Why? What does this help with? And why are you sending patch

Re: RE: [PATCH] usb: chipidea: use better pattern with WARN_ON()

2016-12-04 Thread Peter Chen
On Fri, Dec 02, 2016 at 09:06:19AM +, Atul Raj wrote: > On 2 Dec 2016 2:18 p.m., "Atul Raj" wrote: > > > > > > > > >Instead of using: > > >if (cond) { > > > WARN_ON(1); > > > do_stuff(); > > >} > > > > > >Use a better pattern with WARN_ON() placed in if condition: > > > > > >

RE: RE: [PATCH] usb: chipidea: use better pattern with WARN_ON()

2016-12-02 Thread Atul Raj
On 2 Dec 2016 2:18 p.m., "Atul Raj" wrote: > > > > >Instead of using: > >if (cond) { > > WARN_ON(1); > > do_stuff(); > >} > > > >Use a better pattern with WARN_ON() placed in if condition: > > > >if (WARN_ON(cond)) > > do_stuff(); > > > >Signed-off-by: Atul Raj > >--- > >

RE: RE: [PATCH] usb: chipidea: use better pattern with WARN_ON()

2016-12-02 Thread Atul Raj
On 2 Dec 2016 2:17 p.m., "Atul Raj" wrote: > > > > > >Instead of using: > >if (cond) { > > WARN_ON(1); > > do_stuff(); > >} > > > >Use a better pattern with WARN_ON() placed in if condition: > > > >if (WARN_ON(cond)) > > do_stuff(); > > > >Signed-off-by: Atul Raj > >--- > >