From: J. Bruce Fields Date: Wed, 16 Jan 2013 22:33:28 +0000 (-0500) Subject: nfsd4: encode_rdattr_error cleanup X-Git-Tag: firefly_0821_release~176^2~4520^2~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=87915c6472acbc5d7c809f3c9753808797da51a8;p=firefly-linux-kernel-4.4.55.git nfsd4: encode_rdattr_error cleanup There's a simpler way to write this. Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 3bffba63e6a0..67b44963e8ad 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2620,17 +2620,14 @@ out_put: static __be32 * nfsd4_encode_rdattr_error(__be32 *p, int buflen, __be32 nfserr) { - __be32 *attrlenp; - if (buflen < 6) return NULL; *p++ = htonl(2); *p++ = htonl(FATTR4_WORD0_RDATTR_ERROR); /* bmval0 */ *p++ = htonl(0); /* bmval1 */ - attrlenp = p++; + *p++ = htonl(4); /* attribute length */ *p++ = nfserr; /* no htonl */ - *attrlenp = htonl((char *)p - (char *)attrlenp - 4); return p; }