All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Thiery <heiko.thiery@gmail.com>
To: netdev@vger.kernel.org
Cc: Ben Hutchings <bhutchings@solarflare.com>,
	Heiko Thiery <heiko.thiery@gmail.com>
Subject: [PATCH] Fix warning due to format mismatch for field width argument to fprintf()
Date: Sat, 15 May 2021 08:49:08 +0200	[thread overview]
Message-ID: <20210515064907.28235-1-heiko.thiery@gmail.com> (raw)

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>
---
 bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bnxt.c b/bnxt.c
index b46db72..0c62d1e 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%x\n",
 			BNXT_PXP_REG_LEN + BNXT_PCIE_STATS_LEN);
 		return -1;
 	}
-- 
2.20.1


             reply	other threads:[~2021-05-15  6:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-15  6:49 Heiko Thiery [this message]
2021-05-15  7:59 ` [PATCH] Fix warning due to format mismatch for field width argument to fprintf() Heiko Thiery
2021-05-16 18:11   ` Heiko Thiery
2021-05-16 20:40     ` Ben Hutchings

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=20210515064907.28235-1-heiko.thiery@gmail.com \
    --to=heiko.thiery@gmail.com \
    --cc=bhutchings@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.