All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: Change NULL comparison to Boolean Negation
@ 2019-03-04 17:43 Nishka Dasgupta
  2019-03-19  9:31 ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Nishka Dasgupta @ 2019-03-04 17:43 UTC (permalink / raw)
  To: elder, johan, gregkh, outreachy-kernel; +Cc: Nishka Dasgupta

Change NULL comparison to boolean negation. Issue found by Checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
---
 drivers/staging/greybus/bundle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
index e97b2b87ba47..376ca53f0d83 100644
--- a/drivers/staging/greybus/bundle.c
+++ b/drivers/staging/greybus/bundle.c
@@ -32,7 +32,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
 {
 	struct gb_bundle *bundle = to_gb_bundle(dev);
 
-	if (bundle->state == NULL)
+	if (!(bundle->state))
 		return sprintf(buf, "\n");
 
 	return sprintf(buf, "%s\n", bundle->state);
-- 
2.19.1



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

* Re: [PATCH] staging: greybus: Change NULL comparison to Boolean Negation
  2019-03-04 17:43 [PATCH] staging: greybus: Change NULL comparison to Boolean Negation Nishka Dasgupta
@ 2019-03-19  9:31 ` Johan Hovold
  2019-03-19 18:25   ` NIshka Dasgupta
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2019-03-19  9:31 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: elder, johan, gregkh, outreachy-kernel

On Mon, Mar 04, 2019 at 11:13:15PM +0530, Nishka Dasgupta wrote:
> Change NULL comparison to boolean negation. Issue found by Checkpatch.
> 
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> ---
>  drivers/staging/greybus/bundle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
> index e97b2b87ba47..376ca53f0d83 100644
> --- a/drivers/staging/greybus/bundle.c
> +++ b/drivers/staging/greybus/bundle.c
> @@ -32,7 +32,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
>  {
>  	struct gb_bundle *bundle = to_gb_bundle(dev);
>  
> -	if (bundle->state == NULL)
> +	if (!(bundle->state))

I noticed Greg already picked this one up, but there's no need for
parenthesis around bundle->state here (cf. state_store()).

>  		return sprintf(buf, "\n");
>  
>  	return sprintf(buf, "%s\n", bundle->state);

Johan


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

* Re: [PATCH] staging: greybus: Change NULL comparison to Boolean Negation
  2019-03-19  9:31 ` Johan Hovold
@ 2019-03-19 18:25   ` NIshka Dasgupta
  2019-03-19 19:51     ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: NIshka Dasgupta @ 2019-03-19 18:25 UTC (permalink / raw)
  To: Johan Hovold; +Cc: elder, gregkh, outreachy-kernel



On 19/03/19 3:01 PM, Johan Hovold wrote:
> On Mon, Mar 04, 2019 at 11:13:15PM +0530, Nishka Dasgupta wrote:
>> Change NULL comparison to boolean negation. Issue found by Checkpatch.
>>
>> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
>> ---
>>   drivers/staging/greybus/bundle.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
>> index e97b2b87ba47..376ca53f0d83 100644
>> --- a/drivers/staging/greybus/bundle.c
>> +++ b/drivers/staging/greybus/bundle.c
>> @@ -32,7 +32,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr,
>>   {
>>   	struct gb_bundle *bundle = to_gb_bundle(dev);
>>   
>> -	if (bundle->state == NULL)
>> +	if (!(bundle->state))
> 
> I noticed Greg already picked this one up, but there's no need for
> parenthesis around bundle->state here (cf. state_store()).
  Okay, I'll keep that in mind.
Thanking you,
Nishka
>>   		return sprintf(buf, "\n");
>>   
>>   	return sprintf(buf, "%s\n", bundle->state);
> 
> Johan
> 


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

* Re: [Outreachy kernel] Re: [PATCH] staging: greybus: Change NULL comparison to Boolean Negation
  2019-03-19 18:25   ` NIshka Dasgupta
@ 2019-03-19 19:51     ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2019-03-19 19:51 UTC (permalink / raw)
  To: NIshka Dasgupta; +Cc: Johan Hovold, elder, gregkh, outreachy-kernel



On Tue, 19 Mar 2019, 'NIshka Dasgupta' via outreachy-kernel wrote:

>
>
> On 19/03/19 3:01 PM, Johan Hovold wrote:
> > On Mon, Mar 04, 2019 at 11:13:15PM +0530, Nishka Dasgupta wrote:
> > > Change NULL comparison to boolean negation. Issue found by Checkpatch.
> > >
> > > Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> > > ---
> > >   drivers/staging/greybus/bundle.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/greybus/bundle.c
> > > b/drivers/staging/greybus/bundle.c
> > > index e97b2b87ba47..376ca53f0d83 100644
> > > --- a/drivers/staging/greybus/bundle.c
> > > +++ b/drivers/staging/greybus/bundle.c
> > > @@ -32,7 +32,7 @@ static ssize_t state_show(struct device *dev, struct
> > > device_attribute *attr,
> > >   {
> > >   	struct gb_bundle *bundle = to_gb_bundle(dev);
> > >   -	if (bundle->state == NULL)
> > > +	if (!(bundle->state))
> >
> > I noticed Greg already picked this one up, but there's no need for
> > parenthesis around bundle->state here (cf. state_store()).
>  Okay, I'll keep that in mind.

Since Greg picked it up, you can send another patch that fixes the issue.

julia

> Thanking you,
> Nishka
> > >   		return sprintf(buf, "\n");
> > >     	return sprintf(buf, "%s\n", bundle->state);
> >
> > Johan
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/3cecf381-0230-400c-d0c4-5aed1134e62d%40yahoo.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2019-03-19 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-04 17:43 [PATCH] staging: greybus: Change NULL comparison to Boolean Negation Nishka Dasgupta
2019-03-19  9:31 ` Johan Hovold
2019-03-19 18:25   ` NIshka Dasgupta
2019-03-19 19:51     ` [Outreachy kernel] " Julia Lawall

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.