wifi: rt2x00: add TX LOFT calibration for MT7620
Subsystems (2)
Hi,
I noticed a signed / unsigned comparison warning when building linux-next with clang. I believe it was introduced in the following commit:
commit dab902fe1d29dc0fa1dccc8d13dc89ffbf633881
Author: Tomislav Požega <[email protected]> Date: Sat Sep 17 21:28:43 2022 +0100
wifi: rt2x00: add TX LOFT calibration for MT7620
The warning is as follows:
drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9472:15: warning: result of comparison of constant -7 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr;
~~~~ ^ ~~~~~
drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9476:15: warning: result of comparison of constant -31 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]
perr = (perr < -0x1f) ? -0x1f : (perr > 0x1d) ? 0x1d : perr;
~~~~ ^ ~~~~~The variables gerr and perr are declared as a char, which in this case seems to be defaulting to signed on the clang build for x86-64 and hence this warning. I suspect making it signed char will do the trick, but I wanted to flag this up in-case there were some other issues with making them signed.
Colin
Quoted 10 lines · Colin King (gmail)
I noticed a signed / unsigned comparison warning when building linux-next with clang. I believe it was introduced in the following commit:
commit
dab902fe1d29dc0fa1dccc8d13dc89ffbf633881Author: Tomislav Požega <[email protected]> Date: Sat Sep 17 21:28:43 2022 +0100wifi: rt2x00: add TX LOFT calibration for MT7620
Quoted 6 lines
The warning is as follows:
drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9472:15: warning: result of comparison of constant -7 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr;
This was very currently addressed:
https://lore.kernel.org/linux-wireless/[email protected]/
Regards
Stanislaw
Quoted 13 lines · Stanislaw Gruszka
Quoted 12 lines · Colin King (gmail)
I noticed a signed / unsigned comparison warning when building linux-next with clang. I believe it was introduced in the following commit:
commit
dab902fe1d29dc0fa1dccc8d13dc89ffbf633881Author: Tomislav Požega <[email protected]> Date: Sat Sep 17 21:28:43 2022 +0100wifi: rt2x00: add TX LOFT calibration for MT7620
The warning is as follows:
Quoted 7 lines
Quoted 4 lines
drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9472:15: warning: result of comparison of constant -7 with expression of type 'char' is always false [-Wtautological-constant-out-of-range-compare]gerr = (gerr < -0x07) ? -0x07 : (gerr > 0x05) ? 0x05 : gerr;This was very currently addressed:
https://lore.kernel.org/linux-wireless/[email protected]/
Awesome. Thanks!
Colin
Quoted 3 lines
Regards
Stanislaw