From: Bert Kenward <bkenward@solarflare.com>
To: Arnd Bergmann <arnd@arndb.de>,
Solarflare linux maintainers <linux-net-drivers@solarflare.com>,
Edward Cree <ecree@solarflare.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Martin Habets <mhabets@solarflare.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: sfc: avoid -Wtype-limits warning
Date: Thu, 16 Jun 2016 11:31:52 +0100 [thread overview]
Message-ID: <3f85b364-6913-1ed5-0bc0-19aa2edc59f6@solarflare.com> (raw)
In-Reply-To: <20160615203122.3574513-1-arnd@arndb.de>
On 15/06/16 21:31, Arnd Bergmann wrote:
> When building with -Wextra, we get a harmless warning from the
> EFX_EXTRACT_OWORD32 macro:
>
> ethernet/sfc/farch.c: In function 'efx_farch_test_registers':
> ethernet/sfc/farch.c:119:30: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
> ethernet/sfc/farch.c:124:144: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
> ethernet/sfc/farch.c:124:392: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
> ethernet/sfc/farch.c:124:731: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
>
> The macro and the caller are both correct, but we can avoid the
> warning by changing the index variable to a signed type.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Bert Kenward <bkenward@solarflare.com>
> ---
> drivers/net/ethernet/sfc/farch.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/sfc/farch.c b/drivers/net/ethernet/sfc/farch.c
> index 133e9e35be9e..4c83739d158f 100644
> --- a/drivers/net/ethernet/sfc/farch.c
> +++ b/drivers/net/ethernet/sfc/farch.c
> @@ -104,7 +104,8 @@ int efx_farch_test_registers(struct efx_nic *efx,
> const struct efx_farch_register_test *regs,
> size_t n_regs)
> {
> - unsigned address = 0, i, j;
> + unsigned address = 0;
> + int i, j;
> efx_oword_t mask, imask, original, reg, buf;
>
> for (i = 0; i < n_regs; ++i) {
>
next prev parent reply other threads:[~2016-06-16 10:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 20:31 Arnd Bergmann
2016-06-16 10:31 ` Bert Kenward [this message]
2016-06-16 21:24 ` David Miller
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=3f85b364-6913-1ed5-0bc0-19aa2edc59f6@solarflare.com \
--to=bkenward@solarflare.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@solarflare.com \
--cc=mhabets@solarflare.com \
--cc=netdev@vger.kernel.org \
/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 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®