2012-04-19 23:14:30

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH -next] nfsd: fix nfs4recover.f printk format warning

From: Randy Dunlap <[email protected]>

Fix printk format warnings -- both items are size_t,
so use %zu to print them.

fs/nfsd/nfs4recover.c:580:3: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'size_t'
fs/nfsd/nfs4recover.c:580:3: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int'

Signed-off-by: Randy Dunlap <[email protected]>
Cc: "J. Bruce Fields" <[email protected]>
Cc: [email protected]
---
fs/nfsd/nfs4recover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20120419.orig/fs/nfsd/nfs4recover.c
+++ linux-next-20120419/fs/nfsd/nfs4recover.c
@@ -577,7 +577,7 @@ cld_pipe_downcall(struct file *filp, con
struct cld_net *cn = nn->cld_net;

if (mlen != sizeof(*cmsg)) {
- dprintk("%s: got %lu bytes, expected %lu\n", __func__, mlen,
+ dprintk("%s: got %zu bytes, expected %zu\n", __func__, mlen,
sizeof(*cmsg));
return -EINVAL;
}


2012-04-30 19:25:10

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH resend] nfsd: fix nfs4recover.c printk format warning

From: Randy Dunlap <[email protected]>

Fix printk format warnings -- both items are size_t,
so use %zu to print them.

fs/nfsd/nfs4recover.c:580:3: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'size_t'
fs/nfsd/nfs4recover.c:580:3: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int'

Signed-off-by: Randy Dunlap <[email protected]>
Cc: "J. Bruce Fields" <[email protected]>
Cc: [email protected]
---
fs/nfsd/nfs4recover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

This patch was originally sent on Apr.19/2012 for linux-next.
It is still needed in linux-next and in mainline.


--- linux-next-20120419.orig/fs/nfsd/nfs4recover.c
+++ linux-next-20120419/fs/nfsd/nfs4recover.c
@@ -577,7 +577,7 @@ cld_pipe_downcall(struct file *filp, con
struct cld_net *cn = nn->cld_net;

if (mlen != sizeof(*cmsg)) {
- dprintk("%s: got %lu bytes, expected %lu\n", __func__, mlen,
+ dprintk("%s: got %zu bytes, expected %zu\n", __func__, mlen,
sizeof(*cmsg));
return -EINVAL;
}

2012-04-30 21:41:42

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH resend] nfsd: fix nfs4recover.c printk format warning

On Mon, Apr 30, 2012 at 12:25:31PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <[email protected]>
>
> Fix printk format warnings -- both items are size_t,
> so use %zu to print them.
>
> fs/nfsd/nfs4recover.c:580:3: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'size_t'
> fs/nfsd/nfs4recover.c:580:3: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int'
>
> Signed-off-by: Randy Dunlap <[email protected]>
> Cc: "J. Bruce Fields" <[email protected]>
> Cc: [email protected]

Looks like Linus just took this. (Thanks!)

--b.

> ---
> fs/nfsd/nfs4recover.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> This patch was originally sent on Apr.19/2012 for linux-next.
> It is still needed in linux-next and in mainline.
>
>
> --- linux-next-20120419.orig/fs/nfsd/nfs4recover.c
> +++ linux-next-20120419/fs/nfsd/nfs4recover.c
> @@ -577,7 +577,7 @@ cld_pipe_downcall(struct file *filp, con
> struct cld_net *cn = nn->cld_net;
>
> if (mlen != sizeof(*cmsg)) {
> - dprintk("%s: got %lu bytes, expected %lu\n", __func__, mlen,
> + dprintk("%s: got %zu bytes, expected %zu\n", __func__, mlen,
> sizeof(*cmsg));
> return -EINVAL;
> }