All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h
@ 2021-02-09  1:23 Randy Dunlap
  2021-02-12 10:56 ` Jarkko Sakkinen
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2021-02-09  1:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Sean Christopherson, Jarkko Sakkinen, Borislav Petkov, x86

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");
 }

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

* Re: [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h
  2021-02-09  1:23 [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h Randy Dunlap
@ 2021-02-12 10:56 ` Jarkko Sakkinen
  2021-02-12 21:20   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Jarkko Sakkinen @ 2021-02-12 10:56 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, Sean Christopherson, Borislav Petkov, x86

On Mon, Feb 08, 2021 at 05:23:05PM -0800, Randy Dunlap wrote:
> 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

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.

Reviewed-by: Jarkko Sakkinen <jarkko@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");
>  }
> 

/Jarkko

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

* Re: [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h
  2021-02-12 10:56 ` Jarkko Sakkinen
@ 2021-02-12 21:20   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2021-02-12 21:20 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: linux-kernel, Sean Christopherson, Borislav Petkov, x86

On 2/12/21 2:56 AM, Jarkko Sakkinen wrote:
> On Mon, Feb 08, 2021 at 05:23:05PM -0800, Randy Dunlap wrote:
>> 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
> 
> 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.


> Anyway, thank you.
> 
> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

Thanks. Added at the end of the list. :)


>> ---
>>  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");
>>  }
>>
> 
> /Jarkko
> 


-- 
~Randy


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

end of thread, other threads:[~2021-02-12 21:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  1:23 [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h Randy Dunlap
2021-02-12 10:56 ` Jarkko Sakkinen
2021-02-12 21:20   ` Randy Dunlap

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.