2009-01-29 17:35:01

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH -next/mmotm/resend] kmemtrace: fix printk formats

From: Randy Dunlap <[email protected]>

Fix kmemtrace printk warnings:

kernel/trace/kmemtrace.c:142: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
kernel/trace/kmemtrace.c:147: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'

Signed-off-by: Randy Dunlap <[email protected]>
cc: Eduard - Gabriel Munteanu <[email protected]>
---
kernel/trace/kmemtrace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20090123.orig/kernel/trace/kmemtrace.c
+++ linux-next-20090123/kernel/trace/kmemtrace.c
@@ -139,12 +139,12 @@ kmemtrace_print_alloc_compress(struct tr
return TRACE_TYPE_PARTIAL_LINE;

/* Requested */
- ret = trace_seq_printf(s, "%4ld ", entry->bytes_req);
+ ret = trace_seq_printf(s, "%4zd ", entry->bytes_req);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;

/* Allocated */
- ret = trace_seq_printf(s, "%4ld ", entry->bytes_alloc);
+ ret = trace_seq_printf(s, "%4zd ", entry->bytes_alloc);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;


2009-01-29 18:52:12

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH -next/mmotm/resend] kmemtrace: fix printk formats


* Randy Dunlap <[email protected]> wrote:

> From: Randy Dunlap <[email protected]>
>
> Fix kmemtrace printk warnings:
>
> kernel/trace/kmemtrace.c:142: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
> kernel/trace/kmemtrace.c:147: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
>
> Signed-off-by: Randy Dunlap <[email protected]>
> cc: Eduard - Gabriel Munteanu <[email protected]>
> ---
> kernel/trace/kmemtrace.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

it's in tip/tracing already, i applied it 6 days ago.

Ingo

2009-01-29 21:35:48

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH -next/mmotm/resend] kmemtrace: fix printk formats

On Thu, 29 Jan 2009, Randy Dunlap wrote:
> From: Randy Dunlap <[email protected]>
>
> Fix kmemtrace printk warnings:
>
> kernel/trace/kmemtrace.c:142: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
> kernel/trace/kmemtrace.c:147: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
>
> Signed-off-by: Randy Dunlap <[email protected]>
> cc: Eduard - Gabriel Munteanu <[email protected]>
> ---
> kernel/trace/kmemtrace.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- linux-next-20090123.orig/kernel/trace/kmemtrace.c
> +++ linux-next-20090123/kernel/trace/kmemtrace.c
> @@ -139,12 +139,12 @@ kmemtrace_print_alloc_compress(struct tr
> return TRACE_TYPE_PARTIAL_LINE;
>
> /* Requested */
> - ret = trace_seq_printf(s, "%4ld ", entry->bytes_req);
> + ret = trace_seq_printf(s, "%4zd ", entry->bytes_req);
> if (!ret)
> return TRACE_TYPE_PARTIAL_LINE;
>
> /* Allocated */
> - ret = trace_seq_printf(s, "%4ld ", entry->bytes_alloc);
> + ret = trace_seq_printf(s, "%4zd ", entry->bytes_alloc);
> if (!ret)
> return TRACE_TYPE_PARTIAL_LINE;

%4zu?

size_t is unsigned, ssize_t is signed.

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

2009-01-29 21:50:59

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH -next/mmotm/resend] kmemtrace: fix printk formats

Geert Uytterhoeven wrote:
>
> %4zu?

Ugh, yes. Thanks.
Here's the updated patch.

--
From: Randy Dunlap <[email protected]>

Fix kmemtrace printk warnings:

kernel/trace/kmemtrace.c:142: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
kernel/trace/kmemtrace.c:147: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'

Signed-off-by: Randy Dunlap <[email protected]>
cc: Eduard - Gabriel Munteanu <[email protected]>
---
kernel/trace/kmemtrace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20090123.orig/kernel/trace/kmemtrace.c
+++ linux-next-20090123/kernel/trace/kmemtrace.c
@@ -139,12 +139,12 @@ kmemtrace_print_alloc_compress(struct tr
return TRACE_TYPE_PARTIAL_LINE;

/* Requested */
- ret = trace_seq_printf(s, "%4ld ", entry->bytes_req);
+ ret = trace_seq_printf(s, "%4zu ", entry->bytes_req);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;

/* Allocated */
- ret = trace_seq_printf(s, "%4ld ", entry->bytes_alloc);
+ ret = trace_seq_printf(s, "%4zu ", entry->bytes_alloc);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;

Subject: Re: [PATCH -next/mmotm/resend] kmemtrace: fix printk formats

On Thu, Jan 29, 2009 at 01:49:45PM -0800, Randy Dunlap wrote:
> Geert Uytterhoeven wrote:
> >
> > %4zu?
>
> Ugh, yes. Thanks.
> Here's the updated patch.
>
> --
> From: Randy Dunlap <[email protected]>
>
> Fix kmemtrace printk warnings:
>
> kernel/trace/kmemtrace.c:142: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
> kernel/trace/kmemtrace.c:147: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
>
> Signed-off-by: Randy Dunlap <[email protected]>
> cc: Eduard - Gabriel Munteanu <[email protected]>
> ---
> kernel/trace/kmemtrace.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- linux-next-20090123.orig/kernel/trace/kmemtrace.c
> +++ linux-next-20090123/kernel/trace/kmemtrace.c
> @@ -139,12 +139,12 @@ kmemtrace_print_alloc_compress(struct tr
> return TRACE_TYPE_PARTIAL_LINE;
>
> /* Requested */
> - ret = trace_seq_printf(s, "%4ld ", entry->bytes_req);
> + ret = trace_seq_printf(s, "%4zu ", entry->bytes_req);
> if (!ret)
> return TRACE_TYPE_PARTIAL_LINE;
>
> /* Allocated */
> - ret = trace_seq_printf(s, "%4ld ", entry->bytes_alloc);
> + ret = trace_seq_printf(s, "%4zu ", entry->bytes_alloc);
> if (!ret)
> return TRACE_TYPE_PARTIAL_LINE;
>

I didn't notice this either, thanks.

Acked-by: Eduard - Gabriel Munteanu <[email protected]>


Eduard

2009-01-30 15:13:37

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH -next/mmotm/resend] kmemtrace: fix printk formats


* Eduard - Gabriel Munteanu <[email protected]> wrote:

> On Thu, Jan 29, 2009 at 01:49:45PM -0800, Randy Dunlap wrote:
> > Geert Uytterhoeven wrote:
> > >
> > > %4zu?
> >
> > Ugh, yes. Thanks.
> > Here's the updated patch.
> >
> > --
> > From: Randy Dunlap <[email protected]>
> >
> > Fix kmemtrace printk warnings:
> >
> > kernel/trace/kmemtrace.c:142: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
> > kernel/trace/kmemtrace.c:147: warning: format '%4ld' expects type 'long int', but argument 3 has type 'size_t'
> >
> > Signed-off-by: Randy Dunlap <[email protected]>
> > cc: Eduard - Gabriel Munteanu <[email protected]>
> > ---
> > kernel/trace/kmemtrace.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > --- linux-next-20090123.orig/kernel/trace/kmemtrace.c
> > +++ linux-next-20090123/kernel/trace/kmemtrace.c
> > @@ -139,12 +139,12 @@ kmemtrace_print_alloc_compress(struct tr
> > return TRACE_TYPE_PARTIAL_LINE;
> >
> > /* Requested */
> > - ret = trace_seq_printf(s, "%4ld ", entry->bytes_req);
> > + ret = trace_seq_printf(s, "%4zu ", entry->bytes_req);
> > if (!ret)
> > return TRACE_TYPE_PARTIAL_LINE;
> >
> > /* Allocated */
> > - ret = trace_seq_printf(s, "%4ld ", entry->bytes_alloc);
> > + ret = trace_seq_printf(s, "%4zu ", entry->bytes_alloc);
> > if (!ret)
> > return TRACE_TYPE_PARTIAL_LINE;
> >
>
> I didn't notice this either, thanks.
>
> Acked-by: Eduard - Gabriel Munteanu <[email protected]>

Applied to tip/tracing/kmemtrace, thanks!

Ingo