* [PATCH] staging: greybus: remove unnecessary parentheses
@ 2025-01-09 0:36 Will Walsh
2025-01-09 2:56 ` Alex Elder
0 siblings, 1 reply; 5+ messages in thread
From: Will Walsh @ 2025-01-09 0:36 UTC (permalink / raw)
To: Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, greybus-dev, linux-staging, linux-kernel,
outreachy
Cc: Will Walsh
Unnecessary parentheses in boolean comparisons make it harder to read.
Removed the extra parentheses on line 305 for code readability.
Signed-off-by: Will Walsh <iron.will.walsh@gmail.com>
---
drivers/staging/greybus/audio_codec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index 2f05e761fb9a..dfb5322964de 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -305,7 +305,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
dev_dbg(module->dev, "%s:Module update %s sequence\n", w->name,
enable ? "Enable" : "Disable");
- if ((w->id != snd_soc_dapm_aif_in) && (w->id != snd_soc_dapm_aif_out)) {
+ if (w->id != snd_soc_dapm_aif_in && w->id != snd_soc_dapm_aif_out) {
dev_dbg(codec->dev, "No action required for %s\n", w->name);
return 0;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: remove unnecessary parentheses
2025-01-09 0:36 [PATCH] staging: greybus: remove unnecessary parentheses Will Walsh
@ 2025-01-09 2:56 ` Alex Elder
2025-01-09 7:45 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Alex Elder @ 2025-01-09 2:56 UTC (permalink / raw)
To: Will Walsh, Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, greybus-dev, linux-staging, linux-kernel,
outreachy
On 1/8/25 6:36 PM, Will Walsh wrote:
> Unnecessary parentheses in boolean comparisons make it harder to read.
>
> Removed the extra parentheses on line 305 for code readability.
>
> Signed-off-by: Will Walsh <iron.will.walsh@gmail.com>
I'm not sure this makes a big difference in readability but I
personally avoid extra parentheses unless adding them makes a
compiler warning go away.
Reviewed-by: Alex Elder <elder@kernel.org>
> ---
> drivers/staging/greybus/audio_codec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index 2f05e761fb9a..dfb5322964de 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -305,7 +305,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
> dev_dbg(module->dev, "%s:Module update %s sequence\n", w->name,
> enable ? "Enable" : "Disable");
>
> - if ((w->id != snd_soc_dapm_aif_in) && (w->id != snd_soc_dapm_aif_out)) {
> + if (w->id != snd_soc_dapm_aif_in && w->id != snd_soc_dapm_aif_out) {
> dev_dbg(codec->dev, "No action required for %s\n", w->name);
> return 0;
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: remove unnecessary parentheses
2025-01-09 2:56 ` Alex Elder
@ 2025-01-09 7:45 ` Dan Carpenter
2025-01-09 7:50 ` Greg Kroah-Hartman
2025-01-09 14:54 ` Alex Elder
0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2025-01-09 7:45 UTC (permalink / raw)
To: Alex Elder
Cc: Will Walsh, Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, greybus-dev, linux-staging, linux-kernel,
outreachy
On Wed, Jan 08, 2025 at 08:56:50PM -0600, Alex Elder wrote:
> On 1/8/25 6:36 PM, Will Walsh wrote:
> > Unnecessary parentheses in boolean comparisons make it harder to read.
> >
> > Removed the extra parentheses on line 305 for code readability.
> >
> > Signed-off-by: Will Walsh <iron.will.walsh@gmail.com>
>
> I'm not sure this makes a big difference in readability but I
> personally avoid extra parentheses unless adding them makes a
> compiler warning go away.
It's not a compiler warning, it checkpatch.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: remove unnecessary parentheses
2025-01-09 7:45 ` Dan Carpenter
@ 2025-01-09 7:50 ` Greg Kroah-Hartman
2025-01-09 14:54 ` Alex Elder
1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2025-01-09 7:50 UTC (permalink / raw)
To: Dan Carpenter
Cc: Alex Elder, Will Walsh, Vaibhav Agarwal, Mark Greer, Johan Hovold,
Alex Elder, greybus-dev, linux-staging, linux-kernel, outreachy
On Thu, Jan 09, 2025 at 10:45:50AM +0300, Dan Carpenter wrote:
> On Wed, Jan 08, 2025 at 08:56:50PM -0600, Alex Elder wrote:
> > On 1/8/25 6:36 PM, Will Walsh wrote:
> > > Unnecessary parentheses in boolean comparisons make it harder to read.
> > >
> > > Removed the extra parentheses on line 305 for code readability.
> > >
> > > Signed-off-by: Will Walsh <iron.will.walsh@gmail.com>
> >
> > I'm not sure this makes a big difference in readability but I
> > personally avoid extra parentheses unless adding them makes a
> > compiler warning go away.
>
> It's not a compiler warning, it checkpatch.
And it is a checkpatch warning that I HATE and keep rejecting, here's
where I did so yesterday:
https://lore.kernel.org/r/2025010738-gong-rewind-2583@gregkh
Will, sorry, but I don't want to take this.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: greybus: remove unnecessary parentheses
2025-01-09 7:45 ` Dan Carpenter
2025-01-09 7:50 ` Greg Kroah-Hartman
@ 2025-01-09 14:54 ` Alex Elder
1 sibling, 0 replies; 5+ messages in thread
From: Alex Elder @ 2025-01-09 14:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Will Walsh, Vaibhav Agarwal, Mark Greer, Johan Hovold, Alex Elder,
Greg Kroah-Hartman, greybus-dev, linux-staging, linux-kernel,
outreachy
On 1/9/25 1:45 AM, Dan Carpenter wrote:
> On Wed, Jan 08, 2025 at 08:56:50PM -0600, Alex Elder wrote:
>> On 1/8/25 6:36 PM, Will Walsh wrote:
>>> Unnecessary parentheses in boolean comparisons make it harder to read.
>>>
>>> Removed the extra parentheses on line 305 for code readability.
>>>
>>> Signed-off-by: Will Walsh <iron.will.walsh@gmail.com>
>>
>> I'm not sure this makes a big difference in readability but I
>> personally avoid extra parentheses unless adding them makes a
>> compiler warning go away.
>
> It's not a compiler warning, it checkpatch.
I meant compiler "-Wparentheses" warnings, like "suggest
parentheses around ‘+’ inside ‘<<’".
But anyway, I have no problem with this being rejected,
it doesn't really add value, and to some, it subtracts.
-Alex
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-01-09 14:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 0:36 [PATCH] staging: greybus: remove unnecessary parentheses Will Walsh
2025-01-09 2:56 ` Alex Elder
2025-01-09 7:45 ` Dan Carpenter
2025-01-09 7:50 ` Greg Kroah-Hartman
2025-01-09 14:54 ` Alex Elder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox