diff mbox series

[v2] wifi: rt2x00: Remove useless else if

Message ID 20230106022731.111243-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Accepted
Commit ebe8dee7aea6be7a775de718ee8fa93f77e3e4af
Delegated to: Kalle Valo
Headers show
Series [v2] wifi: rt2x00: Remove useless else if | expand

Commit Message

Jiapeng Chong Jan. 6, 2023, 2:27 a.m. UTC
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).

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3631
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
Changes in v2:
  -Remove useful comment and modify commit message.

 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Stanislaw Gruszka Jan. 6, 2023, 10:18 a.m. UTC | #1
On Fri, Jan 06, 2023 at 10:27:31AM +0800, Jiapeng Chong wrote:
> 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).
> 
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3631
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Kalle Valo Jan. 16, 2023, 4:24 p.m. UTC | #2
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote:

> 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).
> 
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3631
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

Patch applied to wireless-next.git, thanks.

ebe8dee7aea6 wifi: rt2x00: Remove useless else if
diff mbox series

Patch

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 12b700c7b9c3..1226a883cd67 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -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;