From: Simon Horman <simon.horman@corigine.com>
To: Justin Stitt <justinstitt@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Tom Rix <trix@redhat.com>, Fei Qin <fei.qin@corigine.com>,
Yu Xiao <yu.xiao@corigine.com>,
Yinjun Zhang <yinjun.zhang@corigine.com>,
Dirk van der Merwe <dirk.vandermerwe@netronome.com>,
Leon Romanovsky <leon@kernel.org>,
oss-drivers@corigine.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] nfp: fix clang -Wformat warnings
Date: Tue, 12 Jul 2022 11:21:03 +0200 [thread overview]
Message-ID: <Ys08/1BjtahTIIvJ@corigine.com> (raw)
In-Reply-To: <20220712000152.2292031-1-justinstitt@google.com>
On Mon, Jul 11, 2022 at 05:01:52PM -0700, Justin Stitt wrote:
> When building with Clang we encounter these warnings:
> | drivers/net/ethernet/netronome/nfp/nfp_app.c:233:99: error: format
> | specifies type 'unsigned char' but the argument has underlying type
> | 'unsigned int' [-Werror,-Wformat] nfp_err(pf->cpp, "unknown FW app ID
> | 0x%02hhx, driver too old or support for FW not built in\n", id);
> -
> | drivers/net/ethernet/netronome/nfp/nfp_main.c:396:11: error: format
> | specifies type 'unsigned char' but the argument has type 'int'
> | [-Werror,-Wformat] serial, interface >> 8, interface & 0xff);
>
> Correct format specifier for `id` is `%x` since the default type for the
> `nfp_app_id` enum is `unsigned int`. The second warning is also solved
> by using the `%x` format specifier as the expressions involving
> `interface` are implicity promoted to integers (%x is used to maintain
> hexadecimal representation).
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/378
> Signed-off-by: Justin Stitt <justinstitt@google.com>
Thanks for improving the nfp driver.
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2022-07-12 9:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 0:01 [PATCH] nfp: fix clang -Wformat warnings Justin Stitt
2022-07-12 9:21 ` Simon Horman [this message]
2022-07-13 0:50 ` patchwork-bot+netdevbpf
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=Ys08/1BjtahTIIvJ@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=dirk.vandermerwe@netronome.com \
--cc=edumazet@google.com \
--cc=fei.qin@corigine.com \
--cc=justinstitt@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=trix@redhat.com \
--cc=yinjun.zhang@corigine.com \
--cc=yu.xiao@corigine.com \
/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