Skip to contentSkip to conversation

cifs: fix debug format string in cifs_debug_data_proc_show

PATCH Applied Arnd Bergmann 3 participants 3 messages Jan 19, 2023 – Jan 20, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: fix debug format string in cifs_debug_data_proc_show

From: Arnd Bergmann <[email protected]>

Printing a size_t as %lu causes a warning on some architectures:

fs/cifs/cifs_debug.c: In function 'cifs_debug_data_proc_show':
fs/cifs/cifs_debug.c:478:75: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
478 | seq_printf(m, "\t\tWeight (cur,total): (%lu,%lu)"

Use the correct %zu format string instead.

Fixes 962a0fd04791 ("cifs: distribute channels across interfaces based on speed")
---
 fs/cifs/cifs_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifs_debug.c +1 -1
index f5f07019fc7e..2e644d926e62 100644
@@ -475,7 +475,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 				cifs_dump_iface(m, iface);
 
 				iface_weight = iface->speed / iface_min_speed;
-				seq_printf(m, "\t\tWeight (cur,total): (%lu,%lu)"
+				seq_printf(m, "\t\tWeight (cur,total): (%zu,%zu)"
 					   "\n\t\tAllocated channels: %u\n",
 					   iface->weight_fulfilled,
 					   iface_weight,
Signature · 1 line
2.39.0
#1 lore raw
Quoted 31 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Printing a size_t as %lu causes a warning on some architectures:

fs/cifs/cifs_debug.c: In function 'cifs_debug_data_proc_show':
fs/cifs/cifs_debug.c:478:75: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
478 | seq_printf(m, "\t\tWeight (cur,total): (%lu,%lu)"

Use the correct %zu format string instead.

Fixes 962a0fd04791 ("cifs: distribute channels across interfaces based on speed")
---
 fs/cifs/cifs_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifs_debug.c +1 -2
index f5f07019fc7e..2e644d926e62 100644
@@ -475,7 +475,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
                                cifs_dump_iface(m, iface);
 
                                iface_weight = iface->speed / iface_min_speed;
-                               seq_printf(m, "\t\tWeight (cur,total): (%lu,%lu)"
+                               seq_printf(m, "\t\tWeight (cur,total): (%zu,%zu)"
                                           "\n\t\tAllocated channels: %u\n",
                                           iface->weight_fulfilled,
                                           iface_weight,
--
Quoted 2 lines

2.39.0

Hi Arnd,

Thanks for pointing this out.

Signature · 2 lines
Regards,
Shyam
Applied
#2 lore raw

merged into cifs-2.6.git for-next

Quoted 44 lines · Shyam Prasad N via samba-technical
Quoted 31 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Printing a size_t as %lu causes a warning on some architectures:

fs/cifs/cifs_debug.c: In function 'cifs_debug_data_proc_show':
fs/cifs/cifs_debug.c:478:75: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
478 | seq_printf(m, "\t\tWeight (cur,total): (%lu,%lu)"

Use the correct %zu format string instead.

Fixes 962a0fd04791 ("cifs: distribute channels across interfaces based on speed")
---
 fs/cifs/cifs_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifs_debug.c +1 -2
index f5f07019fc7e..2e644d926e62 100644
@@ -475,7 +475,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
                                cifs_dump_iface(m, iface);
 
                                iface_weight = iface->speed / iface_min_speed;
-                               seq_printf(m, "\t\tWeight (cur,total): (%lu,%lu)"
+                               seq_printf(m, "\t\tWeight (cur,total): (%zu,%zu)"
                                           "\n\t\tAllocated channels: %u\n",
                                           iface->weight_fulfilled,
                                           iface_weight,
--
Quoted 2 lines

2.39.0

Hi Arnd,

Thanks for pointing this out.

--
Regards,
Shyam

Signature · 3 lines
Thanks,

Steve