aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/netronome/nfp/nfp_main.c
diff options
context:
space:
mode:
authorJustin Stitt <justinstitt@google.com>2022-07-11 17:01:52 -0700
committerJakub Kicinski <kuba@kernel.org>2022-07-12 17:38:44 -0700
commitef2a95db89003e8304e429dc48556fecb8c7140b (patch)
tree070bd760cc60cbb7f2bdea6274c87406c8e469bd /drivers/net/ethernet/netronome/nfp/nfp_main.c
parentMerge branch 'dt-bindings-net-convert-sff-sfp-to-dtschema' (diff)
downloadwireguard-linux-ef2a95db89003e8304e429dc48556fecb8c7140b.tar.xz
wireguard-linux-ef2a95db89003e8304e429dc48556fecb8c7140b.zip
nfp: fix clang -Wformat warnings
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> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20220712000152.2292031-1-justinstitt@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_main.c')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c
index 36b173039024..873429f7a6da 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c
@@ -392,7 +392,7 @@ nfp_net_fw_find(struct pci_dev *pdev, struct nfp_pf *pf)
/* First try to find a firmware image specific for this device */
interface = nfp_cpp_interface(pf->cpp);
nfp_cpp_serial(pf->cpp, &serial);
- sprintf(fw_name, "netronome/serial-%pMF-%02hhx-%02hhx.nffw",
+ sprintf(fw_name, "netronome/serial-%pMF-%02x-%02x.nffw",
serial, interface >> 8, interface & 0xff);
fw = nfp_net_fw_request(pdev, pf, fw_name);
if (fw)