Skip to contentSkip to conversation

Fix wrong array size expression

PATCH In review Mauro Dreissig 2 participants 2 messages Aug 1, 2012 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix wrong array size expression

---
 expression.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
expression.c +1 -1
index 0ae3a60..9f45c79 100644
@@ -655,7 +655,7 @@ static struct token *unary_expression(struct token *token, struct expression **t
 				{ &__sizeof_ptr___ident, EXPR_PTRSIZEOF },
 			};
 			int i;
-			for (i = 0; i < 3; i++) {
+			for (i = 0; i < ARRAY_SIZE(type_information); i++) {
 				if (ident == type_information[i].id)
 					return type_info_expression(token, tree, type_information[i].type);
 			}
Signature · 1 line
1.7.11.2
maintainer
#1 lore raw

Thanks for the good catch. That is simple and obvious correct.

Will apply.

Chris

Quoted 25 lines · Mauro Dreissig
---
 expression.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
expression.c +1 -2
index 0ae3a60..9f45c79 100644
@@ -655,7 +655,7 @@ static struct token *unary_expression(struct token *token, struct expression **t
                                { &__sizeof_ptr___ident, EXPR_PTRSIZEOF },
                        };
                        int i;
-                       for (i = 0; i < 3; i++) {
+                       for (i = 0; i < ARRAY_SIZE(type_information); i++) {
                                if (ident == type_information[i].id)
                                        return type_info_expression(token, tree, type_information[i].type);
                        }
--

1.7.11.2

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