Skip to contentSkip to conversation

pstore/blk: Use "%lu" to format unsigned long

PATCH Applied Geert Uytterhoeven 2 participants 4 messages Jun 29, 2021 – Nov 16, 2021 Pstore filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pstore/blk: Use "%lu" to format unsigned long

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")
---
 fs/pstore/blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/pstore/blk.c +1 -1
index 04ce58c939a0ba15..6093088de49fd161 100644
@@ -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;
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 15 lines · 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",
| ^~~~~~~

Applied to for-next/pstore, thanks!

[1/1] pstore/blk: Use "%lu" to format unsigned long

      https://git.kernel.org/kees/c/c5d4fb2539ca
Signature · 1 line
Kees Cook
#2 lore raw

Hi Kees,

Quoted 17 lines · Kees Cook
Quoted 15 lines · 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",
| ^~~~~~~

Quoted 1 line

Applied to for-next/pstore, thanks!

Thanks!

Quoted 2 lines

[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 -- [email protected]

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

#3 lore raw
Quoted 24 lines · Geert Uytterhoeven

Hi Kees,

Quoted 17 lines · Kees Cook
Quoted 15 lines · 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",
| ^~~~~~~

Quoted 1 line

Applied to for-next/pstore, thanks!

Thanks!

Quoted 7 lines
Quoted 2 lines

[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

Quoted 11 lines

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

Signature · 1 line
Kees Cook