* [PATCH][next] wifi: rt2x00: remove redundant check if u8 array element is less than zero
@ 2023-09-20 12:12 Colin Ian King
2023-09-28 16:24 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2023-09-20 12:12 UTC (permalink / raw)
To: Stanislaw Gruszka, Helmut Schaa, Kalle Valo, linux-wireless
Cc: kernel-janitors, linux-kernel
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>
---
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index e65cc00fa17c..fe11fa4917ac 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -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]];
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][next] wifi: rt2x00: remove redundant check if u8 array element is less than zero
2023-09-20 12:12 [PATCH][next] wifi: rt2x00: remove redundant check if u8 array element is less than zero Colin Ian King
@ 2023-09-28 16:24 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2023-09-28 16:24 UTC (permalink / raw)
To: Colin Ian King
Cc: Stanislaw Gruszka, Helmut Schaa, linux-wireless, kernel-janitors,
linux-kernel
Colin Ian King <colin.i.king@gmail.com> wrote:
> 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>
Patch applied to wireless-next.git, thanks.
b2172a9330b5 wifi: rt2x00: remove redundant check if u8 array element is less than zero
--
https://patchwork.kernel.org/project/linux-wireless/patch/20230920121240.120455-1-colin.i.king@gmail.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-28 16:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-20 12:12 [PATCH][next] wifi: rt2x00: remove redundant check if u8 array element is less than zero Colin Ian King
2023-09-28 16:24 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®