linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cifs: fix debug format string in cifs_debug_data_proc_show
@ 2023-01-19 11:18 Arnd Bergmann
  2023-01-19 13:46 ` Shyam Prasad N
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2023-01-19 11:18 UTC (permalink / raw)
  To: Steve French, Shyam Prasad N
  Cc: Arnd Bergmann, Paulo Alcantara, Ronnie Sahlberg, Tom Talpey,
	Enzo Matsumiya, linux-cifs, samba-technical, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/cifs/cifs_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index f5f07019fc7e..2e644d926e62 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -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,
-- 
2.39.0


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

* Re: [PATCH] cifs: fix debug format string in cifs_debug_data_proc_show
  2023-01-19 11:18 [PATCH] cifs: fix debug format string in cifs_debug_data_proc_show Arnd Bergmann
@ 2023-01-19 13:46 ` Shyam Prasad N
  2023-01-20 19:17   ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Shyam Prasad N @ 2023-01-19 13:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Steve French, Shyam Prasad N, Arnd Bergmann, Paulo Alcantara,
	Ronnie Sahlberg, Tom Talpey, Enzo Matsumiya, linux-cifs,
	samba-technical, linux-kernel

On Thu, Jan 19, 2023 at 4:55 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  fs/cifs/cifs_debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> index f5f07019fc7e..2e644d926e62 100644
> --- a/fs/cifs/cifs_debug.c
> +++ b/fs/cifs/cifs_debug.c
> @@ -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,
> --
> 2.39.0
>

Hi Arnd,

Thanks for pointing this out.

-- 
Regards,
Shyam

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

* Re: [PATCH] cifs: fix debug format string in cifs_debug_data_proc_show
  2023-01-19 13:46 ` Shyam Prasad N
@ 2023-01-20 19:17   ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2023-01-20 19:17 UTC (permalink / raw)
  To: Shyam Prasad N
  Cc: Arnd Bergmann, Tom Talpey, Shyam Prasad N, Arnd Bergmann,
	linux-cifs, Enzo Matsumiya, Paulo Alcantara, samba-technical,
	linux-kernel, Ronnie Sahlberg, Steve French

merged into cifs-2.6.git for-next

On Thu, Jan 19, 2023 at 7:48 AM Shyam Prasad N via samba-technical
<samba-technical@lists.samba.org> wrote:
>
> On Thu, Jan 19, 2023 at 4:55 PM Arnd Bergmann <arnd@kernel.org> wrote:
> >
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > 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")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  fs/cifs/cifs_debug.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> > index f5f07019fc7e..2e644d926e62 100644
> > --- a/fs/cifs/cifs_debug.c
> > +++ b/fs/cifs/cifs_debug.c
> > @@ -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,
> > --
> > 2.39.0
> >
>
> Hi Arnd,
>
> Thanks for pointing this out.
>
> --
> Regards,
> Shyam
>


-- 
Thanks,

Steve

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

end of thread, other threads:[~2023-01-20 19:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 11:18 [PATCH] cifs: fix debug format string in cifs_debug_data_proc_show Arnd Bergmann
2023-01-19 13:46 ` Shyam Prasad N
2023-01-20 19:17   ` Steve French

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