Skip to contentSkip to conversation

sound: soc: codecs: wcd9335: fix "conversion to bool not needed here"

PATCH In review Hariprasad Kelam 2 participants 4 messages Jul 11, 2019 – Jul 13, 2019

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

PATCH 1/1 sound: soc: codecs: wcd9335: fix "conversion to bool not needed here"

Fix below issue reported by coccicheck sound/soc/codecs/wcd9335.c:3991:25-30: WARNING: conversion to bool not needed here

---
 sound/soc/codecs/wcd9335.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
sound/soc/codecs/wcd9335.c +1 -6
index 1bbbe42..85a8d10 100644
@@ -3988,12 +3988,7 @@ static irqreturn_t wcd9335_slimbus_irq(int irq, void *data)
 		regmap_read(wcd->if_regmap,
 				WCD9335_SLIM_PGD_PORT_INT_RX_SOURCE0 + j, &val);
 		if (val) {
-			if (!tx)
-				reg = WCD9335_SLIM_PGD_PORT_INT_EN0 +
-					(port_id / 8);
-			else
-				reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 +
-					(port_id / 8);
+			reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 + (port_id / 8);
 			regmap_read(
 				wcd->if_regmap, reg, &int_val);
 			/*
Signature · 1 line
2.7.4
#1 lore raw
Quoted 17 lines · Hariprasad Kelam

Fix below issue reported by coccicheck sound/soc/codecs/wcd9335.c:3991:25-30: WARNING: conversion to bool not needed here

---
 sound/soc/codecs/wcd9335.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
sound/soc/codecs/wcd9335.c +0 -0
index 1bbbe42..85a8d10 100644
@@ -3988,12 +3988,7 @@ static irqreturn_t wcd9335_slimbus_irq(int irq, void *data)
 		regmap_read(wcd->if_regmap,
 				WCD9335_SLIM_PGD_PORT_INT_RX_SOURCE0 + j, &val);
 		if (val) {

sound/soc/codecs/wcd9335.c static irqreturn_t wcd9335_slimbus_irq(int irq, void *data) · line 3994

Quoted 10 lines
sound/soc/codecs/wcd9335.c +1 -6
-			if (!tx)
-				reg = WCD9335_SLIM_PGD_PORT_INT_EN0 +
-					(port_id / 8);
-			else
-				reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 +
-					(port_id / 8);
+			reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 + (port_id / 8);
 			regmap_read(
 				wcd->if_regmap, reg, &int_val);
 			/*

This change makes no sense and doesn't match the commit message.

#2 lore raw
Quoted 34 lines · Joe Perches
Quoted 17 lines · Hariprasad Kelam

Fix below issue reported by coccicheck sound/soc/codecs/wcd9335.c:3991:25-30: WARNING: conversion to bool not needed here

---
 sound/soc/codecs/wcd9335.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
sound/soc/codecs/wcd9335.c +0 -0
index 1bbbe42..85a8d10 100644
@@ -3988,12 +3988,7 @@ static irqreturn_t wcd9335_slimbus_irq(int irq, void *data)
 		regmap_read(wcd->if_regmap,
 				WCD9335_SLIM_PGD_PORT_INT_RX_SOURCE0 + j, &val);
 		if (val) {

sound/soc/codecs/wcd9335.c static irqreturn_t wcd9335_slimbus_irq(int irq, void *data) · line 3994

Quoted 10 lines
sound/soc/codecs/wcd9335.c +1 -6
-			if (!tx)
-				reg = WCD9335_SLIM_PGD_PORT_INT_EN0 +
-					(port_id / 8);
-			else
-				reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 +
-					(port_id / 8);
+			reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 + (port_id / 8);
 			regmap_read(
 				wcd->if_regmap, reg, &int_val);
 			/*

This change makes no sense and doesn't match the commit message.

Please ignore this patch.
Both statments in if/else loop looked
similar to me but they are different.

#3 lore raw
In reply to Joe Perches
Quoted 33 lines · Joe Perches
Quoted 17 lines · Hariprasad Kelam

Fix below issue reported by coccicheck sound/soc/codecs/wcd9335.c:3991:25-30: WARNING: conversion to bool not needed here

---
 sound/soc/codecs/wcd9335.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
sound/soc/codecs/wcd9335.c +0 -0
index 1bbbe42..85a8d10 100644
@@ -3988,12 +3988,7 @@ static irqreturn_t wcd9335_slimbus_irq(int irq, void *data)
 		regmap_read(wcd->if_regmap,
 				WCD9335_SLIM_PGD_PORT_INT_RX_SOURCE0 + j, &val);
 		if (val) {

sound/soc/codecs/wcd9335.c static irqreturn_t wcd9335_slimbus_irq(int irq, void *data) · line 3994

Quoted 10 lines
sound/soc/codecs/wcd9335.c +1 -6
-			if (!tx)
-				reg = WCD9335_SLIM_PGD_PORT_INT_EN0 +
-					(port_id / 8);
-			else
-				reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 +
-					(port_id / 8);
+			reg = WCD9335_SLIM_PGD_PORT_INT_TX_EN0 + (port_id / 8);
 			regmap_read(
 				wcd->if_regmap, reg, &int_val);
 			/*

This change makes no sense and doesn't match the commit message.

Please ignore this patch. Both the statments in if/else look similar to me but they are not.