netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: wifi: rt2x00: add TX LOFT calibration for MT7620
@ 2022-10-20 13:45 Colin King (gmail)
  2022-10-20 15:15 ` Stanislaw Gruszka
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King (gmail) @ 2022-10-20 13:45 UTC (permalink / raw)
  To: Tomislav Požega
  Cc: Stanislaw Gruszka, Helmut Schaa, Kalle Valo, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

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 <pozega.tomislav@gmail.com>
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: wifi: rt2x00: add TX LOFT calibration for MT7620
  2022-10-20 13:45 wifi: rt2x00: add TX LOFT calibration for MT7620 Colin King (gmail)
@ 2022-10-20 15:15 ` Stanislaw Gruszka
  2022-10-20 15:16   ` Colin King (gmail)
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislaw Gruszka @ 2022-10-20 15:15 UTC (permalink / raw)
  To: Colin King (gmail)
  Cc: Tomislav Požega, Helmut Schaa, Kalle Valo, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Thu, Oct 20, 2022 at 02:45:22PM +0100, Colin King (gmail) wrote:
> 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 <pozega.tomislav@gmail.com>
> 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;

This was very currently addressed:
https://lore.kernel.org/linux-wireless/20221019155541.3410813-1-Jason@zx2c4.com/

Regards
Stanislaw

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: wifi: rt2x00: add TX LOFT calibration for MT7620
  2022-10-20 15:15 ` Stanislaw Gruszka
@ 2022-10-20 15:16   ` Colin King (gmail)
  0 siblings, 0 replies; 3+ messages in thread
From: Colin King (gmail) @ 2022-10-20 15:16 UTC (permalink / raw)
  To: Stanislaw Gruszka
  Cc: Tomislav Požega, Helmut Schaa, Kalle Valo, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On 20/10/2022 16:15, Stanislaw Gruszka wrote:
> On Thu, Oct 20, 2022 at 02:45:22PM +0100, Colin King (gmail) wrote:
>> 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 <pozega.tomislav@gmail.com>
>> 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;
> 
> This was very currently addressed:
> https://lore.kernel.org/linux-wireless/20221019155541.3410813-1-Jason@zx2c4.com/

Awesome. Thanks!

Colin
> 
> Regards
> Stanislaw


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-20 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20 13:45 wifi: rt2x00: add TX LOFT calibration for MT7620 Colin King (gmail)
2022-10-20 15:15 ` Stanislaw Gruszka
2022-10-20 15:16   ` Colin King (gmail)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).