Skip to contentSkip to conversation

wifi: rt2x00: Remove useless else if

PATCH In review Jiapeng Chong 3 participants 3 messages Jan 6, 2023 – Jan 16, 2023

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

PATCH v2 1/1 wifi: rt2x00: Remove useless else if

The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it.

./drivers/net/wireless/ralink/rt2x00/rt2800lib.c:8927:9-11: WARNING:
possible condition with no effect (if == else).

---
Changes in v2:
-Remove useful comment and modify commit message.

 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/ralink/rt2x00/rt2800lib.c +0 -2
index 12b700c7b9c3..1226a883cd67 100644
@@ -8924,8 +8924,6 @@ static void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev)
 
 				if (i < 2 && (bbptemp & 0x800000))
 					result = (bbptemp & 0xffffff) - 0x1000000;
-				else if (i == 4)
-					result = bbptemp;
 				else
 					result = bbptemp;
 
Signature · 1 line
2.20.1.7.g153144c
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Jiapeng Chong

The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it.

./drivers/net/wireless/ralink/rt2x00/rt2800lib.c:8927:9-11: WARNING:
possible condition with no effect (if == else).

#2 lore raw
In reply to Jiapeng Chong
Quoted 10 lines · Jiapeng Chong

The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it.

./drivers/net/wireless/ralink/rt2x00/rt2800lib.c:8927:9-11: WARNING:
possible condition with no effect (if == else).

Patch applied to wireless-next.git, thanks.

ebe8dee7aea6 wifi: rt2x00: Remove useless else if

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches