diff mbox series

NFSD: Correct type annotations in user xattr helpers

Message ID 159857138796.5733.7512487939045729999.stgit@klimt.1015granger.net
State New
Headers show
Series NFSD: Correct type annotations in user xattr helpers | expand

Commit Message

Chuck Lever Aug. 27, 2020, 11:37 p.m. UTC
Squelch some sparse warnings:

/home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13: warning: incorrect type in assignment (different base types)
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13:    expected int err
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13:    got restricted __be32
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24: warning: incorrect type in return expression (different base types)
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24:    expected restricted __be32
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24:    got int err
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13: warning: incorrect type in assignment (different base types)
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13:    expected int err
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13:    got restricted __be32
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24: warning: incorrect type in return expression (different base types)
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24:    expected restricted __be32
/home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24:    got int err

Fixes: 32119446bb65 ("nfsd: define xattr functions to call into their vfs counterparts")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/vfs.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

I plan to send this with the next -rc pull request.

Comments

Frank van der Linden Aug. 27, 2020, 11:42 p.m. UTC | #1
On Thu, Aug 27, 2020 at 07:37:01PM -0400, Chuck Lever wrote:
> 
> 
> Squelch some sparse warnings:
> 
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13: warning: incorrect type in assignment (different base types)
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13:    expected int err
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2264:13:    got restricted __be32
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24: warning: incorrect type in return expression (different base types)
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24:    expected restricted __be32
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2266:24:    got int err
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13: warning: incorrect type in assignment (different base types)
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13:    expected int err
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2288:13:    got restricted __be32
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24: warning: incorrect type in return expression (different base types)
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24:    expected restricted __be32
> /home/cel/src/linux/linux/fs/nfsd/vfs.c:2290:24:    got int err
> 
> Fixes: 32119446bb65 ("nfsd: define xattr functions to call into their vfs counterparts")
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---

Thanks.. sorry about that, one of those "I could have sworn I took care of
those" cases.

- Frank
diff mbox series

Patch

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 7d2933b85b65..0e1e1bba24c9 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -2259,7 +2259,8 @@  nfsd_listxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char **bufp,
 __be32
 nfsd_removexattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name)
 {
-	int err, ret;
+	__be32 err;
+	int ret;
 
 	err = fh_verify(rqstp, fhp, 0, NFSD_MAY_WRITE);
 	if (err)
@@ -2283,7 +2284,8 @@  __be32
 nfsd_setxattr(struct svc_rqst *rqstp, struct svc_fh *fhp, char *name,
 	      void *buf, u32 len, u32 flags)
 {
-	int err, ret;
+	__be32 err;
+	int ret;
 
 	err = fh_verify(rqstp, fhp, 0, NFSD_MAY_WRITE);
 	if (err)