[PATCH 8/8] parse: simplify set_storage_class()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The second test is now made as the else part of the first test,
saving a 'return' that is otherwise not needed.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 parse.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/parse.c b/parse.c
index 92ca1b66e140..f3f33790eac0 100644
--- a/parse.c
+++ b/parse.c
@@ -1385,12 +1385,9 @@ static struct token *storage_specifier(struct token *next, struct symbol *sym, s
 	const char *storage = modifier_name(class);
 
 	/* __thread can be used alone, or with extern or static */
-	if (is_tls && (class & ~(MOD_STATIC|MOD_EXTERN))) {
+	if (is_tls && (class & ~(MOD_STATIC|MOD_EXTERN)))
 		sparse_error(next->pos, "__thread cannot be used with '%s'", storage);
-		return next;
-	}
-
-	if (!ctx->storage_class)
+	else if (!ctx->storage_class)
 		ctx->storage_class = class;
 	else if (ctx->storage_class == class)
 		sparse_error(next->pos, "duplicate %s", storage);
-- 
2.28.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux