x86: vdso: fix printf() format warnings in vdso2c.h
Subsystems (3)
PATCH 1/1 x86: vdso: fix printf() format warnings in vdso2c.h
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);
| ~~^ ~~~
--- arch/x86/entry/vdso/vdso2c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/vdso/vdso2c.h +1 -1
@@ -35,7 +35,7 @@ static void BITSFUNC(extract)(const unsiif (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" ); }
Quoted 15 lines · Randy Dunlap
Use %zu instead of %lu for
size_tto prevent wprintf()format warnings invdso2c.hHOSTCC
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);
| ~~^ ~~~
Quoted 6 lines
Fixes 8382c668ce4f ("x86/vdso: Add support for exception fixup in vDSO functions")Signed-off-by Randy Dunlap <[email protected]>Cc Sean Christopherson <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Borislav Petkov <[email protected]>
Just a *question*: should SOB be the last? Seeing this 2nd time today, and just not used to it. That's why asking.
Anyway, thank you.
Quoted 8 lines
--- arch/x86/entry/vdso/vdso2c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/vdso/vdso2c.h static void BITSFUNC(extract)(const unsi · line 41
Quoted 8 lines
arch/x86/entry/vdso/vdso2c.h +1
-1@@ -35,7 +35,7 @@ static void BITSFUNC(extract)(const unsiif (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" ); }
/Jarkko
Quoted 23 lines · Jarkko Sakkinen
Quoted 15 lines · Randy Dunlap
Use %zu instead of %lu for
size_tto prevent wprintf()format warnings invdso2c.hHOSTCC
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);
| ~~^ ~~~Quoted 6 lines
Fixes 8382c668ce4f ("x86/vdso: Add support for exception fixup in vDSO functions")Signed-off-by Randy Dunlap <[email protected]>Cc Sean Christopherson <[email protected]>Cc Jarkko Sakkinen <[email protected]>Cc Borislav Petkov <[email protected]>
Quoted 2 lines
Just a *question*: should SOB be the last? Seeing this 2nd time today, and just not used to it. That's why asking.
I'll have to let someone else answer that. AFAICT, it's not documented.
I have read (in email) that when adding Acked-by, Tested-by, Reviewed-by, etc., that those should be added at the end of the list in chronological order, but that doesn't tell us where to put the Cc: list.
Quoted 3 lines
Anyway, thank you.
Reviewed-by Jarkko Sakkinen <[email protected]>
Thanks. Added at the end of the list. :)
Quoted 19 lines
Quoted 8 lines
--- arch/x86/entry/vdso/vdso2c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/entry/vdso/vdso2c.h static void BITSFUNC(extract)(const unsi · line 41
Quoted 8 lines
arch/x86/entry/vdso/vdso2c.h +1
-1@@ -35,7 +35,7 @@ static void BITSFUNC(extract)(const unsiif (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" ); }/Jarkko
Signature · 1 line
~Randy