aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs2acl.c
diff options
context:
space:
mode:
authorBenoit Taine <benoit.taine@lip6.fr>2014-05-22 10:32:30 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-05-22 15:52:23 -0400
commitd40aa3372f90d478b6166df0321349b5aeb0aea8 (patch)
tree850ddb4df00cc40eb34f0b2ff2dbfe77d62f774e /fs/nfsd/nfs2acl.c
parentf35ea0d4b66b789e0edcea634238e9aa31924516 (diff)
nfsd: Remove assignments inside conditions
Assignments should not happen inside an if conditional, but in the line before. This issue was reported by checkpatch. The semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // <smpl> @@ identifier i1; expression e1; statement S; @@ -if(!(i1 = e1)) S +i1 = e1; +if(!i1) +S // </smpl> It has been tested by compilation. Signed-off-by: Benoit Taine <benoit.taine@lip6.fr> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs2acl.c')
-rw-r--r--fs/nfsd/nfs2acl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
index 11c1fba29312..12b023a7ab7d 100644
--- a/fs/nfsd/nfs2acl.c
+++ b/fs/nfsd/nfs2acl.c
@@ -182,7 +182,8 @@ static __be32 nfsacld_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessarg
182static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p, 182static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p,
183 struct nfsd3_getaclargs *argp) 183 struct nfsd3_getaclargs *argp)
184{ 184{
185 if (!(p = nfs2svc_decode_fh(p, &argp->fh))) 185 p = nfs2svc_decode_fh(p, &argp->fh);
186 if (!p)
186 return 0; 187 return 0;
187 argp->mask = ntohl(*p); p++; 188 argp->mask = ntohl(*p); p++;
188 189
@@ -197,7 +198,8 @@ static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
197 unsigned int base; 198 unsigned int base;
198 int n; 199 int n;
199 200
200 if (!(p = nfs2svc_decode_fh(p, &argp->fh))) 201 p = nfs2svc_decode_fh(p, &argp->fh);
202 if (!p)
201 return 0; 203 return 0;
202 argp->mask = ntohl(*p++); 204 argp->mask = ntohl(*p++);
203 if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT) || 205 if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT) ||
@@ -218,7 +220,8 @@ static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p,
218static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p, 220static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p,
219 struct nfsd_fhandle *argp) 221 struct nfsd_fhandle *argp)
220{ 222{
221 if (!(p = nfs2svc_decode_fh(p, &argp->fh))) 223 p = nfs2svc_decode_fh(p, &argp->fh);
224 if (!p)
222 return 0; 225 return 0;
223 return xdr_argsize_check(rqstp, p); 226 return xdr_argsize_check(rqstp, p);
224} 227}
@@ -226,7 +229,8 @@ static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p,
226static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p, 229static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p,
227 struct nfsd3_accessargs *argp) 230 struct nfsd3_accessargs *argp)
228{ 231{
229 if (!(p = nfs2svc_decode_fh(p, &argp->fh))) 232 p = nfs2svc_decode_fh(p, &argp->fh);
233 if (!p)
230 return 0; 234 return 0;
231 argp->access = ntohl(*p++); 235 argp->access = ntohl(*p++);
232 236