netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Fix warning due to format mismatch for field width argument to fprintf()
@ 2021-05-17  6:58 Heiko Thiery
  0 siblings, 0 replies; only message in thread
From: Heiko Thiery @ 2021-05-17  6:58 UTC (permalink / raw)
  To: netdev
  Cc: Ben Hutchings, Vasundhara Volam, Andy Gospodarek, Edwin Peer,
	Heiko Thiery

bnxt.c:66:54: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
   66 |   fprintf(stdout, "Length is too short, expected 0x%lx\n",
      |                                                    ~~^
      |                                                      |
      |                                                      long unsigned int
      |                                                    %x

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
v2:
  - use '%zx' since the value is converted to size_t (thanks to Ben)

 bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bnxt.c b/bnxt.c
index b46db72..2b0ac76 100644
--- a/bnxt.c
+++ b/bnxt.c
@@ -63,7 +63,7 @@ int bnxt_dump_regs(struct ethtool_drvinfo *info __maybe_unused, struct ethtool_r
 		return 0;
 
 	if (regs->len < (BNXT_PXP_REG_LEN + BNXT_PCIE_STATS_LEN)) {
-		fprintf(stdout, "Length is too short, expected 0x%lx\n",
+		fprintf(stdout, "Length is too short, expected 0x%zx\n",
 			BNXT_PXP_REG_LEN + BNXT_PCIE_STATS_LEN);
 		return -1;
 	}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-17  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-17  6:58 [PATCH v2] Fix warning due to format mismatch for field width argument to fprintf() Heiko Thiery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).