FBSD: coalesce three assignments to the same variable
authorGarrett Wollman <wollman@csail.mit.edu>
Fri, 12 Aug 2011 04:39:54 +0000 (00:39 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 12 Aug 2011 19:36:28 +0000 (12:36 -0700)
Change-Id: Iadc9652c03a2d3453addab759c9f8f0048929e2b
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/FBSD/osi_misc.c

index 2ece43d..04fe165 100644 (file)
@@ -31,13 +31,11 @@ osi_lookupname(char *aname, enum uio_seg seg, int followlink,
     if (glocked)
        AFS_GUNLOCK();
 
-    flags = 0;
-    flags = LOCKLEAF;
+    flags = LOCKLEAF | MPSAFE; /* namei must take Giant if needed */
     if (followlink)
        flags |= FOLLOW;
     else
        flags |= NOFOLLOW;
-    flags |= MPSAFE; /* namei must take Giant if needed */
     NDINIT(&n, LOOKUP, flags, seg, aname, curthread);
     if ((error = namei(&n)) != 0) {
        if (glocked)