2009-12-31 02:23:19

by Jeff Layton

[permalink] [raw]
Subject: [PATCH] sunrpc: fix build-time warning

Commit 486bad2e40e938cd68fd853b7a9fa3115a9d3a4a introduced this warning
at build time on some 32-bit architectures:

net/sunrpc/auth_gss/auth_gss.c: In function 'gss_pipe_downcall':
net/sunrpc/auth_gss/auth_gss.c:660: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t

...fix it by changing the length modifier in the printk.

Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
---
net/sunrpc/auth_gss/auth_gss.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 66cb89c..6de4f91 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -657,7 +657,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
break;
default:
printk(KERN_CRIT "%s: bad return from "
- "gss_fill_context: %ld\n", __func__, err);
+ "gss_fill_context: %Zd\n", __func__, err);
BUG();
}
goto err_release_msg;
--
1.6.5.2


2009-12-31 17:18:08

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] sunrpc: fix build-time warning

On Wed, 30 Dec 2009 21:23:15 -0500 Jeff Layton wrote:

> Commit 486bad2e40e938cd68fd853b7a9fa3115a9d3a4a introduced this warning
> at build time on some 32-bit architectures:
>
> net/sunrpc/auth_gss/auth_gss.c: In function 'gss_pipe_downcall':
> net/sunrpc/auth_gss/auth_gss.c:660: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t
>
> ...fix it by changing the length modifier in the printk.
>
> Reported-by: Stephen Rothwell <[email protected]>
> Signed-off-by: Jeff Layton <[email protected]>
> ---
> net/sunrpc/auth_gss/auth_gss.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index 66cb89c..6de4f91 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -657,7 +657,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
> break;
> default:
> printk(KERN_CRIT "%s: bad return from "
> - "gss_fill_context: %ld\n", __func__, err);
> + "gss_fill_context: %Zd\n", __func__, err);
> BUG();
> }
> goto err_release_msg;
> --

I have that almost-same patch in my (unposted) linux-next patch queue,
so basically, ack, except that we try to use 'z' instead of 'Z' nowadays.

My quick kernel source tree count is 173 %Z to 966 %z.
(Please don't anyone start a project of converting %Z to %z.)


---
~Randy

2010-01-01 01:56:13

by Jeff Layton

[permalink] [raw]
Subject: Re: [PATCH] sunrpc: fix build-time warning

On Thu, 31 Dec 2009 09:18:15 -0800
Randy Dunlap <[email protected]> wrote:

> On Wed, 30 Dec 2009 21:23:15 -0500 Jeff Layton wrote:
>
> > Commit 486bad2e40e938cd68fd853b7a9fa3115a9d3a4a introduced this warning
> > at build time on some 32-bit architectures:
> >
> > net/sunrpc/auth_gss/auth_gss.c: In function 'gss_pipe_downcall':
> > net/sunrpc/auth_gss/auth_gss.c:660: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t
> >
> > ...fix it by changing the length modifier in the printk.
> >
> > Reported-by: Stephen Rothwell <[email protected]>
> > Signed-off-by: Jeff Layton <[email protected]>
> > ---
> > net/sunrpc/auth_gss/auth_gss.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> > index 66cb89c..6de4f91 100644
> > --- a/net/sunrpc/auth_gss/auth_gss.c
> > +++ b/net/sunrpc/auth_gss/auth_gss.c
> > @@ -657,7 +657,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
> > break;
> > default:
> > printk(KERN_CRIT "%s: bad return from "
> > - "gss_fill_context: %ld\n", __func__, err);
> > + "gss_fill_context: %Zd\n", __func__, err);
> > BUG();
> > }
> > goto err_release_msg;
> > --
>
> I have that almost-same patch in my (unposted) linux-next patch queue,
> so basically, ack, except that we try to use 'z' instead of 'Z' nowadays.
>
> My quick kernel source tree count is 173 %Z to 966 %z.
> (Please don't anyone start a project of converting %Z to %z.)
>

If you have a patch queued up for this with the preferred qualifier,
then I'm fine with dropping this one.

Cheers,
--
Jeff Layton <[email protected]>

2010-01-02 02:25:47

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH v2] sunrpc: fix build-time warning

From: Randy Dunlap <[email protected]>

Fix auth_gss printk format warning:

net/sunrpc/auth_gss/auth_gss.c:660: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t'

Signed-off-by: Randy Dunlap <[email protected]>
---
net/sunrpc/auth_gss/auth_gss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20091229.orig/net/sunrpc/auth_gss/auth_gss.c
+++ linux-next-20091229/net/sunrpc/auth_gss/auth_gss.c
@@ -657,7 +657,7 @@ gss_pipe_downcall(struct file *filp, con
break;
default:
printk(KERN_CRIT "%s: bad return from "
- "gss_fill_context: %ld\n", __func__, err);
+ "gss_fill_context: %zd\n", __func__, err);
BUG();
}
goto err_release_msg;
---

2010-01-03 11:53:04

by Jeff Layton

[permalink] [raw]
Subject: Re: [PATCH v2] sunrpc: fix build-time warning

On Fri, 1 Jan 2010 18:25:14 -0800
Randy Dunlap <[email protected]> wrote:

> From: Randy Dunlap <[email protected]>
>
> Fix auth_gss printk format warning:
>
> net/sunrpc/auth_gss/auth_gss.c:660: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t'
>
> Signed-off-by: Randy Dunlap <[email protected]>

Acked-by: Jeff Layton <[email protected]>

> ---
> net/sunrpc/auth_gss/auth_gss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20091229.orig/net/sunrpc/auth_gss/auth_gss.c
> +++ linux-next-20091229/net/sunrpc/auth_gss/auth_gss.c
> @@ -657,7 +657,7 @@ gss_pipe_downcall(struct file *filp, con
> break;
> default:
> printk(KERN_CRIT "%s: bad return from "
> - "gss_fill_context: %ld\n", __func__, err);
> + "gss_fill_context: %zd\n", __func__, err);
> BUG();
> }
> goto err_release_msg;
> ---


--
Jeff Layton <[email protected]>

2010-01-06 23:10:37

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH v2] sunrpc: fix build-time warning

On Fri, 2010-01-01 at 18:25 -0800, Randy Dunlap wrote:
> From: Randy Dunlap <[email protected]>
>
> Fix auth_gss printk format warning:
>
> net/sunrpc/auth_gss/auth_gss.c:660: warning: format '%ld' expects type 'long int', but argument 3 has type 'ssize_t'
>
> Signed-off-by: Randy Dunlap <[email protected]>

Thanks Randy!

Sorry for the delay. This patch has been applied today, and should
therefore appear in the linux-next tree tomorrow...

Cheers
Trond

2010-01-06 23:51:39

by Stephen Rothwell

[permalink] [raw]
Subject: Re: [PATCH v2] sunrpc: fix build-time warning

Hi Trond,

On Wed, 06 Jan 2010 18:10:20 -0500 Trond Myklebust <[email protected]> wrote:
>
> Sorry for the delay. This patch has been applied today, and should
> therefore appear in the linux-next tree tomorrow...

Actually today - since I am following the normal Australian practice of
being slack and starting work late in January :-)

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (450.00 B)
(No filename) (198.00 B)
Download all attachments