staging: greybus: remove unnecessary parentheses
Subsystems (3)
PATCH 1/1 staging: greybus: remove unnecessary parentheses
Unnecessary parentheses in boolean comparisons make it harder to read.
Removed the extra parentheses on line 305 for code readability.
--- drivers/staging/greybus/audio_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_codec.c +1 -1
@@ -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 ; }
Signature · 1 line
2.45.2
Quoted 5 lines · 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 <[email protected]>
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.
Quoted 17 lines
--- drivers/staging/greybus/audio_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/greybus/audio_codec.c +1
-1@@ -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 ; }
Quoted 10 lines · Alex Elder
Quoted 5 lines · 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 <[email protected]>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
Greg Kroah-Hartman
maintainerQuoted 6 lines · Dan Carpenter
Quoted 5 lines · Alex Elder
Quoted 4 lines · Will Walsh
Unnecessary parentheses in boolean comparisons make it harder to read.
Removed the extra parentheses on line 305 for code readability.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Will Walsh <[email protected]>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
Quoted 6 lines · Dan Carpenter
Quoted 5 lines · Alex Elder
Quoted 4 lines · Will Walsh
Unnecessary parentheses in boolean comparisons make it harder to read.
Removed the extra parentheses on line 305 for code readability.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Will Walsh <[email protected]>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
Quoted 4 lines
regards,
dan carpenter