Skip to contentSkip to conversation

staging: greybus: audio_codec.c: Remove unnecessary parentheses in if statement

PATCH In review Eitan Collett 2 participants 2 messages Feb 2 – Feb 4

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: audio_codec.c: Remove unnecessary parentheses in if statement

Adhere to Linux kernel coding style.

Reported by checkpatch:

CHECK: Unnecessary parentheses around 'w->id != snd_soc_dapm_aif_in'
CHECK: Unnecessary parentheses around 'w->id != snd_soc_dapm_aif_out'

---
 drivers/staging/greybus/audio_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_codec.c +1 -1
index 444c53b4e08d..44aee8268d14 100644
@@ -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.52.0
#1 lore raw
Quoted 17 lines · Eitan Collett

Adhere to Linux kernel coding style.

Reported by checkpatch:

CHECK: Unnecessary parentheses around 'w->id != snd_soc_dapm_aif_in'
CHECK: Unnecessary parentheses around 'w->id != snd_soc_dapm_aif_out'

---
 drivers/staging/greybus/audio_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_codec.c +0 -0
index 444c53b4e08d..44aee8268d14 100644

drivers/staging/greybus/audio_codec.c int gbaudio_module_update(struct gbaudio_codec_info *codec, · line 308

Quoted 5 lines
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) {

I hate this checkpatch "warning" sorry. Now you need to go and try to remember if && is higher priority than !=, right?

Please just leave this as-is.

thanks,

greg k-h