Skip to contentSkip to conversation

getcifsacl: remove some dead code

PATCH In review Jeff Layton 2 participants 2 messages Oct 9, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getcifsacl: remove some dead code

Coverity says:

Error: DEADCODE (CWE-561): [#def5]
cifs-utils-6.2/getcifsacl.c:101: assignment: Assigning: "mflags" = "false". cifs-utils-6.2/getcifsacl.c:109: const: At condition "mflags", the value of "mflags" must be equal to 0. cifs-utils-6.2/getcifsacl.c:109: dead_error_condition: The condition "mflags" cannot be true. cifs-utils-6.2/getcifsacl.c:110: dead_error_line: Execution cannot reach this statement "printf("|");".

---
 getcifsacl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
getcifsacl.c +1 -4
index b8998ef..8a7f8ba 100644
@@ -106,10 +106,7 @@ print_ace_flags(uint8_t flags, int raw)
 	}
 
 	if (flags & OBJECT_INHERIT_FLAG) {
-		if (mflags)
-			printf("|");
-		else
-			mflags = true;
+		mflags = true;
 		printf("OI");
 	}
 	if (flags & CONTAINER_INHERIT_FLAG) {
Signature · 1 line
1.8.3.1

A message that is not in the archive (sent off-list or not yet received): 1381324473-32474-1-git-send-email-jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org

#2 lore raw

That looks correct.

Quoted 36 lines · Jeff Layton

Coverity says:

Error: DEADCODE (CWE-561): [#def5]
cifs-utils-6.2/getcifsacl.c:101: assignment: Assigning: "mflags" = "false". cifs-utils-6.2/getcifsacl.c:109: const: At condition "mflags", the value of "mflags" must be equal to 0. cifs-utils-6.2/getcifsacl.c:109: dead_error_condition: The condition "mflags" cannot be true. cifs-utils-6.2/getcifsacl.c:110: dead_error_line: Execution cannot reach this statement "printf("|");".

---
 getcifsacl.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
getcifsacl.c +1 -5
index b8998ef..8a7f8ba 100644
@@ -106,10 +106,7 @@ print_ace_flags(uint8_t flags, int raw)
        }
 
        if (flags & OBJECT_INHERIT_FLAG) {
-               if (mflags)
-                       printf("|");
-               else
-                       mflags = true;
+               mflags = true;
                printf("OI");
        }
        if (flags & CONTAINER_INHERIT_FLAG) {
--

1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html