linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Sean Christopherson <seanjc@google.com>,
	Jarkko Sakkinen <jarkko@kernel.org>, Borislav Petkov <bp@suse.de>,
	x86@kernel.org
Subject: [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h
Date: Mon,  8 Feb 2021 17:23:05 -0800	[thread overview]
Message-ID: <20210209012305.31062-1-rdunlap@infradead.org> (raw)

Use %zu instead of %lu for size_t to prevent w printf()
format warnings in vdso2c.h

  HOSTCC  arch/x86/entry/vdso/vdso2c
In file included from ../arch/x86/entry/vdso/vdso2c.c:162:
../arch/x86/entry/vdso/vdso2c.h: In function 'extract64':
../arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
   38 |  fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
      |                                                  ~~^              ~~~
In file included from ../arch/x86/entry/vdso/vdso2c.c:166:
../arch/x86/entry/vdso/vdso2c.h: In function 'extract32':
../arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
   38 |  fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
      |                                                  ~~^              ~~~

Fixes: 8382c668ce4f ("x86/vdso: Add support for exception fixup in vDSO functions")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: x86@kernel.org
---
 arch/x86/entry/vdso/vdso2c.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-511-rc7.orig/arch/x86/entry/vdso/vdso2c.h
+++ lnx-511-rc7/arch/x86/entry/vdso/vdso2c.h
@@ -35,7 +35,7 @@ static void BITSFUNC(extract)(const unsi
 	if (offset + len > data_len)
 		fail("section to extract overruns input data");
 
-	fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
+	fprintf(outfile, "static const unsigned char %s[%zu] = {", name, len);
 	BITSFUNC(copy)(outfile, data + offset, len);
 	fprintf(outfile, "\n};\n\n");
 }

             reply	other threads:[~2021-02-09  1:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09  1:23 Randy Dunlap [this message]
2021-02-12 10:56 ` [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h Jarkko Sakkinen
2021-02-12 21:20   ` Randy Dunlap

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=20210209012305.31062-1-rdunlap@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=bp@suse.de \
    --cc=jarkko@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=x86@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 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).