linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pstore/blk: Use "%lu" to format unsigned long
@ 2021-06-29 10:37 Geert Uytterhoeven
  2021-06-29 21:12 ` Kees Cook
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-06-29 10:37 UTC (permalink / raw)
  To: Kees Cook, Anton Vorontsov, Colin Cross, Tony Luck
  Cc: linux-kernel, Geert Uytterhoeven

On 32-bit:

    fs/pstore/blk.c: In function ‘__best_effort_init’:
    include/linux/kern_levels.h:5:18: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
	5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
	  |                  ^~~~~~
    include/linux/kern_levels.h:14:19: note: in expansion of macro ‘KERN_SOH’
       14 | #define KERN_INFO KERN_SOH "6" /* informational */
	  |                   ^~~~~~~~
    include/linux/printk.h:373:9: note: in expansion of macro ‘KERN_INFO’
      373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
	  |         ^~~~~~~~~
    fs/pstore/blk.c:314:3: note: in expansion of macro ‘pr_info’
      314 |   pr_info("attached %s (%zu) (no dedicated panic_write!)\n",
	  |   ^~~~~~~

Fixes: 7bb9557b48fcabaa ("pstore/blk: Use the normal block device I/O path")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 fs/pstore/blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c
index 04ce58c939a0ba15..6093088de49fd161 100644
--- a/fs/pstore/blk.c
+++ b/fs/pstore/blk.c
@@ -311,7 +311,7 @@ static int __init __best_effort_init(void)
 	if (ret)
 		kfree(best_effort_dev);
 	else
-		pr_info("attached %s (%zu) (no dedicated panic_write!)\n",
+		pr_info("attached %s (%lu) (no dedicated panic_write!)\n",
 			blkdev, best_effort_dev->zone.total_size);
 
 	return ret;
-- 
2.25.1


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

* Re: [PATCH] pstore/blk: Use "%lu" to format unsigned long
  2021-06-29 10:37 [PATCH] pstore/blk: Use "%lu" to format unsigned long Geert Uytterhoeven
@ 2021-06-29 21:12 ` Kees Cook
  2021-11-15  7:58   ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2021-06-29 21:12 UTC (permalink / raw)
  To: Tony Luck, Anton Vorontsov, Colin Cross, Geert Uytterhoeven
  Cc: Kees Cook, linux-kernel

On Tue, 29 Jun 2021 12:37:00 +0200, Geert Uytterhoeven wrote:
> On 32-bit:
> 
>     fs/pstore/blk.c: In function ‘__best_effort_init’:
>     include/linux/kern_levels.h:5:18: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
> 	5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
> 	  |                  ^~~~~~
>     include/linux/kern_levels.h:14:19: note: in expansion of macro ‘KERN_SOH’
>        14 | #define KERN_INFO KERN_SOH "6" /* informational */
> 	  |                   ^~~~~~~~
>     include/linux/printk.h:373:9: note: in expansion of macro ‘KERN_INFO’
>       373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> 	  |         ^~~~~~~~~
>     fs/pstore/blk.c:314:3: note: in expansion of macro ‘pr_info’
>       314 |   pr_info("attached %s (%zu) (no dedicated panic_write!)\n",
> 	  |   ^~~~~~~

Applied to for-next/pstore, thanks!

[1/1] pstore/blk: Use "%lu" to format unsigned long
      https://git.kernel.org/kees/c/c5d4fb2539ca

-- 
Kees Cook


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

* Re: [PATCH] pstore/blk: Use "%lu" to format unsigned long
  2021-06-29 21:12 ` Kees Cook
@ 2021-11-15  7:58   ` Geert Uytterhoeven
  2021-11-16  0:49     ` Kees Cook
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-11-15  7:58 UTC (permalink / raw)
  To: Kees Cook
  Cc: Tony Luck, Anton Vorontsov, Colin Cross, Linux Kernel Mailing List

Hi Kees,

On Tue, Jun 29, 2021 at 11:12 PM Kees Cook <keescook@chromium.org> wrote:
> On Tue, 29 Jun 2021 12:37:00 +0200, Geert Uytterhoeven wrote:
> > On 32-bit:
> >
> >     fs/pstore/blk.c: In function ‘__best_effort_init’:
> >     include/linux/kern_levels.h:5:18: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
> >       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
> >         |                  ^~~~~~
> >     include/linux/kern_levels.h:14:19: note: in expansion of macro ‘KERN_SOH’
> >        14 | #define KERN_INFO KERN_SOH "6" /* informational */
> >         |                   ^~~~~~~~
> >     include/linux/printk.h:373:9: note: in expansion of macro ‘KERN_INFO’
> >       373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> >         |         ^~~~~~~~~
> >     fs/pstore/blk.c:314:3: note: in expansion of macro ‘pr_info’
> >       314 |   pr_info("attached %s (%zu) (no dedicated panic_write!)\n",
> >         |   ^~~~~~~
>
> Applied to for-next/pstore, thanks!

Thanks!

> [1/1] pstore/blk: Use "%lu" to format unsigned long
>       https://git.kernel.org/kees/c/c5d4fb2539ca

Looks like this still hasn't made upstream, although it has been in
linux-next since the end of June?  The issue is still present (and
now an error with -Werror), but hidden due to commit d07f3b081ee63226
("mark pstore-blk as broken").

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] pstore/blk: Use "%lu" to format unsigned long
  2021-11-15  7:58   ` Geert Uytterhoeven
@ 2021-11-16  0:49     ` Kees Cook
  0 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2021-11-16  0:49 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Tony Luck, Anton Vorontsov, Colin Cross, Linux Kernel Mailing List

On Mon, Nov 15, 2021 at 08:58:51AM +0100, Geert Uytterhoeven wrote:
> Hi Kees,
> 
> On Tue, Jun 29, 2021 at 11:12 PM Kees Cook <keescook@chromium.org> wrote:
> > On Tue, 29 Jun 2021 12:37:00 +0200, Geert Uytterhoeven wrote:
> > > On 32-bit:
> > >
> > >     fs/pstore/blk.c: In function ‘__best_effort_init’:
> > >     include/linux/kern_levels.h:5:18: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
> > >       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
> > >         |                  ^~~~~~
> > >     include/linux/kern_levels.h:14:19: note: in expansion of macro ‘KERN_SOH’
> > >        14 | #define KERN_INFO KERN_SOH "6" /* informational */
> > >         |                   ^~~~~~~~
> > >     include/linux/printk.h:373:9: note: in expansion of macro ‘KERN_INFO’
> > >       373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> > >         |         ^~~~~~~~~
> > >     fs/pstore/blk.c:314:3: note: in expansion of macro ‘pr_info’
> > >       314 |   pr_info("attached %s (%zu) (no dedicated panic_write!)\n",
> > >         |   ^~~~~~~
> >
> > Applied to for-next/pstore, thanks!
> 
> Thanks!
> 
> > [1/1] pstore/blk: Use "%lu" to format unsigned long
> >       https://git.kernel.org/kees/c/c5d4fb2539ca
> 
> Looks like this still hasn't made upstream, although it has been in
> linux-next since the end of June?  The issue is still present (and
> now an error with -Werror), but hidden due to commit d07f3b081ee63226
> ("mark pstore-blk as broken").

Argh, I didn't notice that d07f3b081ee63226 actually landed upstream. It
was not supposed to land since pstore-blk got fixed before the merge
window. Bleh. I will try to get this all sorted out.

-Kees

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

-- 
Kees Cook

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

* Re: [PATCH] pstore/blk: Use "%lu" to format unsigned long
  2021-11-18 18:26 Kees Cook
@ 2021-11-19  6:09 ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-11-19  6:09 UTC (permalink / raw)
  To: Kees Cook
  Cc: Jens Axboe, Geert Uytterhoeven, stable, Christoph Hellwig,
	Anton Vorontsov, Colin Cross, Tony Luck, linux-kernel,
	linux-hardening

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* [PATCH] pstore/blk: Use "%lu" to format unsigned long
@ 2021-11-18 18:26 Kees Cook
  2021-11-19  6:09 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2021-11-18 18:26 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Kees Cook, Geert Uytterhoeven, stable, Christoph Hellwig,
	Anton Vorontsov, Colin Cross, Tony Luck, linux-kernel,
	linux-hardening

From: Geert Uytterhoeven <geert@linux-m68k.org>

On 32-bit:

    fs/pstore/blk.c: In function ‘__best_effort_init’:
    include/linux/kern_levels.h:5:18: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
	5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
	  |                  ^~~~~~
    include/linux/kern_levels.h:14:19: note: in expansion of macro ‘KERN_SOH’
       14 | #define KERN_INFO KERN_SOH "6" /* informational */
	  |                   ^~~~~~~~
    include/linux/printk.h:373:9: note: in expansion of macro ‘KERN_INFO’
      373 |  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
	  |         ^~~~~~~~~
    fs/pstore/blk.c:314:3: note: in expansion of macro ‘pr_info’
      314 |   pr_info("attached %s (%zu) (no dedicated panic_write!)\n",
	  |   ^~~~~~~

Cc: stable@vger.kernel.org
Fixes: 7bb9557b48fcabaa ("pstore/blk: Use the normal block device I/O path")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210629103700.1935012-1-geert@linux-m68k.org
---
 fs/pstore/blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c
index 5d1fbaffd66a..4ae0cfcd15f2 100644
--- a/fs/pstore/blk.c
+++ b/fs/pstore/blk.c
@@ -309,7 +309,7 @@ static int __init __best_effort_init(void)
 	if (ret)
 		kfree(best_effort_dev);
 	else
-		pr_info("attached %s (%zu) (no dedicated panic_write!)\n",
+		pr_info("attached %s (%lu) (no dedicated panic_write!)\n",
 			blkdev, best_effort_dev->zone.total_size);
 
 	return ret;
-- 
2.30.2


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

end of thread, other threads:[~2021-11-19  6:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29 10:37 [PATCH] pstore/blk: Use "%lu" to format unsigned long Geert Uytterhoeven
2021-06-29 21:12 ` Kees Cook
2021-11-15  7:58   ` Geert Uytterhoeven
2021-11-16  0:49     ` Kees Cook
2021-11-18 18:26 Kees Cook
2021-11-19  6:09 ` Christoph Hellwig

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).