staging: greybus: Change NULL comparison to Boolean Negation
PATCH 1/1 staging: greybus: Change NULL comparison to Boolean Negation
Change NULL comparison to boolean negation. Issue found by Checkpatch.
--- drivers/staging/greybus/bundle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/bundle.c +1 -1
@@ -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);
Signature · 1 line
2.19.1
Johan Hovold
maintainerQuoted 12 lines · Nishka Dasgupta
Change NULL comparison to boolean negation. Issue found by Checkpatch.
Signed-off-by Nishka Dasgupta <[email protected]>--- drivers/staging/greybus/bundle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/greybus/bundle.c +0
-0
drivers/staging/greybus/bundle.c static ssize_t state_show(struct device *dev, struct device_attribute *attr, · line 35
Quoted 5 lines
drivers/staging/greybus/bundle.c +1
-1@@ -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()).
drivers/staging/greybus/bundle.c static ssize_t state_show(struct device *dev, struct device_attribute *attr, · line 38
Quoted 3 lines
drivers/staging/greybus/bundle.c +0
-0return sprintf (buf,"\n" );return sprintf (buf,"%s\n" , bundle->state);
Johan
Quoted 16 lines · Johan Hovold
Quoted 15 lines · Nishka Dasgupta
Change NULL comparison to boolean negation. Issue found by Checkpatch.
Signed-off-by Nishka Dasgupta <[email protected]>--- drivers/staging/greybus/bundle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/greybus/bundle.c +0
-0@@ -32,7 +32,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr, {struct gb_bundle *bundle =to_gb_bundle (dev);
Quoted 5 lines
drivers/staging/greybus/bundle.c static ssize_t state_show(struct device *dev, struct device_attribute *attr, · line 35
Quoted 2 lines
drivers/staging/greybus/bundle.c +1
-1-if (bundle->state ==NULL ) +if (!(bundle->state))I noticed Greg already picked this one up, but there's no need for parenthesis around
bundle->statehere (cf.state_store()).
Okay, I'll keep that in mind.
Thanking you,
Nishka
Quoted 6 lines
drivers/staging/greybus/bundle.c static ssize_t state_show(struct device *dev, struct device_attribute *attr, · line 38
Quoted 3 lines
drivers/staging/greybus/bundle.c +0
-0return sprintf (buf,"\n" );return sprintf (buf,"%s\n" , bundle->state);Johan
Quoted 25 lines · NIshka Dasgupta' via outreachy-kernel
Quoted 8 lines · Johan Hovold
Quoted 7 lines · Nishka Dasgupta
Change NULL comparison to boolean negation. Issue found by Checkpatch.
Signed-off-by Nishka Dasgupta <[email protected]>--- drivers/staging/greybus/bundle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
drivers/staging/greybus/bundle.c static ssize_t state_show(struct device *dev, struct · line 36
Quoted 11 lines
drivers/staging/greybus/bundle.c +1
-0@@ -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->statehere (cf.state_store()).
Quoted 1 line
Okay, I'll keep that in mind.
Since Greg picked it up, you can send another patch that fixes the issue.
julia
Quoted 18 lines
Thanking you,
NishkaQuoted 5 lines
drivers/staging/greybus/bundle.c static ssize_t state_show(struct device *dev, struct device_attribute *attr, · line 38
Quoted 2 lines
drivers/staging/greybus/bundle.c +0
-0return 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 [email protected].
To post to this group, send email to [email protected]. 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.