]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rt2x00: remove redundant check if u8 array element is less than zero
authorColin Ian King <colin.i.king@gmail.com>
Wed, 20 Sep 2023 12:12:40 +0000 (13:12 +0100)
committerKalle Valo <kvalo@kernel.org>
Thu, 28 Sep 2023 16:24:30 +0000 (19:24 +0300)
The check on vga_gain[ch_idx] being less than zero is always false since
vga_gain is a u8 array. Clean up the code by removing the check and the
following assignment. Cleans up clang scan build warning:

drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9704:26: warning:
result of comparison of unsigned expression < 0 is always
false [-Wtautological-unsigned-zero-compare]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230920121240.120455-1-colin.i.king@gmail.com
drivers/net/wireless/ralink/rt2x00/rt2800lib.c

index e65cc00fa17c9d7744ac702d1aa796ca818bccd7..fe11fa4917ac72e04f4cdaef855d0c5c9582dbed 100644 (file)
@@ -9700,9 +9700,6 @@ static void rt2800_loft_iq_calibration(struct rt2x00_dev *rt2x00dev)
 
                                rt2x00_dbg(rt2x00dev, "Used VGA %d %x\n", vga_gain[ch_idx],
                                           rfvga_gain_table[vga_gain[ch_idx]]);
-
-                               if (vga_gain[ch_idx] < 0)
-                                       vga_gain[ch_idx] = 0;
                        }
 
                        rfvalue = rfvga_gain_table[vga_gain[ch_idx]];