All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Colin King (gmail)" <colin.i.king@gmail.com>
To: "Tomislav Požega" <pozega.tomislav@gmail.com>
Cc: Stanislaw Gruszka <stf_xl@wp.pl>,
	Helmut Schaa <helmut.schaa@googlemail.com>,
	Kalle Valo <kvalo@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: re: wifi: rt2x00: add TX LOFT calibration for MT7620
Date: Thu, 20 Oct 2022 14:45:22 +0100	[thread overview]
Message-ID: <01410678-ab7d-1733-8d5a-e06d1a4b6c9e@gmail.com> (raw)

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

             reply	other threads:[~2022-10-20 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 13:45 Colin King (gmail) [this message]
2022-10-20 15:15 ` wifi: rt2x00: add TX LOFT calibration for MT7620 Stanislaw Gruszka
2022-10-20 15:16   ` Colin King (gmail)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01410678-ab7d-1733-8d5a-e06d1a4b6c9e@gmail.com \
    --to=colin.i.king@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=helmut.schaa@googlemail.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pozega.tomislav@gmail.com \
    --cc=stf_xl@wp.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.