Commit b9a49237 authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

NFSD: Correct type annotations in user xattr XDR functions

Squelch some sparse warnings:

/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4692:24: warning: incorrect type in return expression (different base types)
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4692:24:    expected int
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4692:24:    got restricted __be32 [usertype]
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4702:32: warning: incorrect type in return expression (different base types)
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4702:32:    expected int
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4702:32:    got restricted __be32 [usertype]
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4739:13: warning: incorrect type in assignment (different base types)
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4739:13:    expected restricted __be32 [usertype] err
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4739:13:    got int
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4891:15: warning: incorrect type in assignment (different base types)
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4891:15:    expected unsigned int [assigned] [usertype] count
/home/cel/src/linux/linux/fs/nfsd/nfs4xdr.c:4891:15:    got restricted __be32 [usertype]
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 8237284a
...@@ -4657,7 +4657,7 @@ nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr, void *p) ...@@ -4657,7 +4657,7 @@ nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr, void *p)
/* /*
* Encode kmalloc-ed buffer in to XDR stream. * Encode kmalloc-ed buffer in to XDR stream.
*/ */
static int static __be32
nfsd4_vbuf_to_stream(struct xdr_stream *xdr, char *buf, u32 buflen) nfsd4_vbuf_to_stream(struct xdr_stream *xdr, char *buf, u32 buflen)
{ {
u32 cplen; u32 cplen;
...@@ -4773,7 +4773,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -4773,7 +4773,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
u32 xdrlen, offset; u32 xdrlen, offset;
u64 cookie; u64 cookie;
char *sp; char *sp;
__be32 status; __be32 status, tmp;
__be32 *p; __be32 *p;
u32 nuser; u32 nuser;
...@@ -4866,8 +4866,8 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -4866,8 +4866,8 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
cookie = offset + count; cookie = offset + count;
write_bytes_to_xdr_buf(xdr->buf, cookie_offset, &cookie, 8); write_bytes_to_xdr_buf(xdr->buf, cookie_offset, &cookie, 8);
count = htonl(count); tmp = cpu_to_be32(count);
write_bytes_to_xdr_buf(xdr->buf, count_offset, &count, 4); write_bytes_to_xdr_buf(xdr->buf, count_offset, &tmp, 4);
out: out:
if (listxattrs->lsxa_len) if (listxattrs->lsxa_len)
kvfree(listxattrs->lsxa_buf); kvfree(listxattrs->lsxa_buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment