[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ys08/1BjtahTIIvJ@corigine.com>
Date: Tue, 12 Jul 2022 11:21:03 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Justin Stitt <justinstitt@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>, Fei Qin <fei.qin@...igine.com>,
Yu Xiao <yu.xiao@...igine.com>,
Yinjun Zhang <yinjun.zhang@...igine.com>,
Dirk van der Merwe <dirk.vandermerwe@...ronome.com>,
Leon Romanovsky <leon@...nel.org>, oss-drivers@...igine.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH] nfp: fix clang -Wformat warnings
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@...gle.com>
Thanks for improving the nfp driver.
Reviewed-by: Simon Horman <simon.horman@...igine.com>
Powered by blists - more mailing lists