public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vdso: Use proper modifier for len's printf in extract
@ 2021-03-03  6:43 Jiri Slaby
  2021-03-03 15:28 ` Jarkko Sakkinen
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jiri Slaby @ 2021-03-03  6:43 UTC (permalink / raw)
  To: bp
  Cc: linux-kernel, Jiri Slaby, Andy Lutomirski, Sean Christopherson,
	Jarkko Sakkinen, Borislav Petkov, Jethro Beekman, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86

Commit 8382c668ce4f ("x86/vdso: Add support for exception fixup in vDSO
functions") added a printf of len which is size_t. Compilers now
complain on 32b:
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'}

So use proper modifier (%zu) for size_t.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Fixes: 8382c668ce4f ("x86/vdso: Add support for exception fixup in vDSO functions")
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Jethro Beekman <jethro@fortanix.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
---
 arch/x86/entry/vdso/vdso2c.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h
index 1c7cfac7e64a..5264daa8859f 100644
--- a/arch/x86/entry/vdso/vdso2c.h
+++ b/arch/x86/entry/vdso/vdso2c.h
@@ -35,7 +35,7 @@ static void BITSFUNC(extract)(const unsigned char *data, size_t data_len,
 	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");
 }
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-06 10:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-03  6:43 [PATCH] x86/vdso: Use proper modifier for len's printf in extract Jiri Slaby
2021-03-03 15:28 ` Jarkko Sakkinen
2021-03-03 18:36 ` Borislav Petkov
2021-03-04  5:18   ` Jiri Slaby
2021-03-04 10:48     ` Borislav Petkov
2021-03-04 10:55       ` Jiri Slaby
2021-03-04 11:04         ` Borislav Petkov
2021-03-04 10:54 ` [tip: x86/vdso] x86/vdso: Use proper modifier for len's format specifier in extract() tip-bot2 for Jiri Slaby
2021-03-06 10:38 ` tip-bot2 for Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox