[lxc-devel] [lxc/master] seccomp.c: Use return instead of attribution and return

marcosps on Github lxc-bot at linuxcontainers.org
Sat Jan 27 13:16:05 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 366 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180127/cc3c3922/attachment.bin>
-------------- next part --------------
From 29cb26174d3183d47252f2a4d65e07f3d21a3d9e Mon Sep 17 00:00:00 2001
From: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date: Sat, 27 Jan 2018 11:13:20 -0200
Subject: [PATCH] seccomp.c: Use return instead of attribution and return

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
---
 src/lxc/seccomp.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c
index a4b088ed8..310a742fc 100644
--- a/src/lxc/seccomp.c
+++ b/src/lxc/seccomp.c
@@ -144,26 +144,22 @@ struct seccomp_v2_rule {
 
 static enum scmp_compare parse_v2_rule_op(char *s)
 {
-	enum scmp_compare ret;
-
 	if (strcmp(s, "SCMP_CMP_NE") == 0 || strcmp(s, "!=") == 0)
-		ret = SCMP_CMP_NE;
+		return SCMP_CMP_NE;
 	else if (strcmp(s, "SCMP_CMP_LT") == 0 || strcmp(s, "<") == 0)
-		ret = SCMP_CMP_LT;
+		return SCMP_CMP_LT;
 	else if (strcmp(s, "SCMP_CMP_LE") == 0 || strcmp(s, "<=") == 0)
-		ret = SCMP_CMP_LE;
+		return SCMP_CMP_LE;
 	else if (strcmp(s, "SCMP_CMP_EQ") == 0 || strcmp(s, "==") == 0)
-		ret = SCMP_CMP_EQ;
+		return SCMP_CMP_EQ;
 	else if (strcmp(s, "SCMP_CMP_GE") == 0 || strcmp(s, ">=") == 0)
-		ret = SCMP_CMP_GE;
+		return SCMP_CMP_GE;
 	else if (strcmp(s, "SCMP_CMP_GT") == 0 || strcmp(s, ">") == 0)
-		ret = SCMP_CMP_GT;
+		return SCMP_CMP_GT;
 	else if (strcmp(s, "SCMP_CMP_MASKED_EQ") == 0 || strcmp(s, "&=") == 0)
-		ret = SCMP_CMP_MASKED_EQ;
-	else
-		ret = _SCMP_CMP_MAX;
+		return SCMP_CMP_MASKED_EQ;
 
-	return ret;
+	return _SCMP_CMP_MAX;
 }
 
 /* This function is used to parse the args string into the structure.


More information about the lxc-devel mailing list