Staging:greybus Fix comparison to NULL
PATCH 1/1 Staging:greybus Fix comparison to NULL
This patch replaces comparison of var to NULL with !var
--- drivers/staging/greybus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/core.c +1 -1
@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,static const struct greybus_bundle_id *greybus_match_id (struct gb_bundle *bundle,const struct greybus_bundle_id *id) { -if (id ==NULL ) +if (!id)return NULL ; for (; id->vendor || id->product || id->class || id->driver_info;
--
1.9.1
Quoted 12 lines · Janani Sankara Babu
This patch replaces comparison of var to NULL with !var
Signed-off-by Janani Sankara Babu <[email protected]>--- drivers/staging/greybus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/greybus/core.c +0
-0
drivers/staging/greybus/core.c static bool greybus_match_one_id(struct gb_bundle *bundle, · line 51
Quoted 5 lines
drivers/staging/greybus/core.c +1
-1@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,static const struct greybus_bundle_id *greybus_match_id (struct gb_bundle *bundle,const struct greybus_bundle_id *id) { -if (id ==NULL ) +if (!id)
It is pretty much personal preference and there is no good reason to accept this patch really.
Signature · 1 line
viresh
Johan Hovold
maintainerQuoted 8 lines · Viresh Kumar
Quoted 7 lines · Janani Sankara Babu
This patch replaces comparison of var to NULL with !var
Signed-off-by Janani Sankara Babu <[email protected]>--- drivers/staging/greybus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
drivers/staging/greybus/core.c static bool greybus_match_one_id(struct gb_bundle *bundle, · line 51
Quoted 10 lines
drivers/staging/greybus/core.c +1
-1@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,static const struct greybus_bundle_id *greybus_match_id (struct gb_bundle *bundle,const struct greybus_bundle_id *id) { -if (id ==NULL ) +if (!id)It is pretty much personal preference and there is no good reason to accept this patch really.
I agree with you, Viresh, but greybus is still living in staging which makes checkpatch enable the --strict option, thereby forcing its authors preferences onto the rest of us.
I also do understand Greg's point that while --strict is enabled, rejecting such patches will probably cause some new submitters to do work for nothing, which is not good.
On the other hand, I at least think we should enforce having a patch description that clearly indicates that this is just something to make checkpatch happy (reserving the term "fix" for proper fixes, at least if not used in conjunction with "checkpatch warning").
So Janani, would you mind resubmitting this patch with a slightly modified commit message, such as:
staging: greybus: clean up NULL comparisons
Replace comparison of var to NULL with !var in order to address a checkpatch (strict) warning.
You could also change the sole remaining comparison to NULL in bundle.c in the same patch.
Thanks,
Johan
Quoted 8 lines · Viresh Kumar
Quoted 7 lines · Janani Sankara Babu
This patch replaces comparison of var to NULL with !var
Signed-off-by Janani Sankara Babu <[email protected]>--- drivers/staging/greybus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
drivers/staging/greybus/core.c static bool greybus_match_one_id(struct gb_bundle *bundle, · line 51
Quoted 10 lines
drivers/staging/greybus/core.c +1
-1@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,static const struct greybus_bundle_id *greybus_match_id (struct gb_bundle *bundle,const struct greybus_bundle_id *id) { -if (id ==NULL ) +if (!id)It is pretty much personal preference and there is no good reason to accept this patch really.
Checkpatch complains, so it's Official Kernel Style now.
The != NULL comparison is a double negative which makes it not less annoying than official kernel style.
regards,
dan carpenter
Quoted 5 lines · Dan Carpenter
Quoted 4 lines · Viresh Kumar
Quoted 3 lines · Janani Sankara Babu
This patch replaces comparison of var to NULL with !var
Signed-off-by Janani Sankara Babu <[email protected]>
Wow, such deep discussion for such a trivial patch!
I say we take it, mostly because I personally prefer being permissive if there's nothing technically wrong with a patch, but also because I'm swayed by the other comments.
That being said, I agree with Johan--the patch would be improved with a little better comment about what motivated the submission. So I'll wait for v2.
-Alex
Quoted 31 lines
Quoted 4 lines
Quoted 4 lines
--- drivers/staging/greybus/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 13 lines
drivers/staging/greybus/core.c static bool greybus_match_one_id(struct gb_bundle *bundle, · line 51
Quoted 10 lines
drivers/staging/greybus/core.c +1
-1@@ -48,7 +48,7 @@ static bool greybus_match_one_id(struct gb_bundle *bundle,static const struct greybus_bundle_id *greybus_match_id (struct gb_bundle *bundle,const struct greybus_bundle_id *id) { -if (id ==NULL ) +if (!id)It is pretty much personal preference and there is no good reason to accept this patch really.
Checkpatch complains, so it's Official Kernel Style now.
The != NULL comparison is a double negative which makes it not less annoying than official kernel style.
regards,
dan carpenter_______________________________________________
greybus-dev mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/greybus-dev