From: Jeff Layton Date: Wed, 7 Nov 2012 15:19:15 +0000 (-0500) Subject: setcifsacl: clean up get_numfaces X-Git-Url: http://git.samba.org/?p=jlayton%2Fcifs-utils.git;a=commitdiff_plain;h=30fabc23eb74ec9de69fb0f0331815970aa9bf12 setcifsacl: clean up get_numfaces pntsd is never NULL here, and get rid of extra "else" that adds some unneeded indentation. Signed-off-by: Jeff Layton --- diff --git a/setcifsacl.c b/setcifsacl.c index e97a35f..380adac 100644 --- a/setcifsacl.c +++ b/setcifsacl.c @@ -329,19 +329,16 @@ get_numfaces(struct cifs_ntsd *pntsd, ssize_t acl_len, struct cifs_ctrl_acl *ldaclptr; char *end_of_acl = ((char *)pntsd) + acl_len; - if (pntsd == NULL) - return 0; - dacloffset = le32toh(pntsd->dacloffset); if (!dacloffset) return 0; - else { - ldaclptr = (struct cifs_ctrl_acl *)((char *)pntsd + dacloffset); - /* validate that we do not go past end of acl */ - if (end_of_acl >= (char *)ldaclptr + le16toh(ldaclptr->size)) { - numfaces = le32toh(ldaclptr->num_aces); - *daclptr = ldaclptr; - } + + ldaclptr = (struct cifs_ctrl_acl *)((char *)pntsd + dacloffset); + + /* validate that we do not go past end of acl */ + if (end_of_acl >= (char *)ldaclptr + le16toh(ldaclptr->size)) { + numfaces = le32toh(ldaclptr->num_aces); + *daclptr = ldaclptr; } return numfaces;