* [PATCH] Fix wrong array size expression
@ 2012-08-01 16:07 Mauro Dreissig
2012-08-01 16:35 ` Christopher Li
0 siblings, 1 reply; 2+ messages in thread
From: Mauro Dreissig @ 2012-08-01 16:07 UTC (permalink / raw)
To: linux-sparse
Signed-off-by: Mauro Dreissig <mukadr@gmail.com>
---
expression.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/expression.c b/expression.c
index 0ae3a60..9f45c79 100644
--- a/expression.c
+++ b/expression.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix wrong array size expression
2012-08-01 16:07 [PATCH] Fix wrong array size expression Mauro Dreissig
@ 2012-08-01 16:35 ` Christopher Li
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Li @ 2012-08-01 16:35 UTC (permalink / raw)
To: Mauro Dreissig; +Cc: linux-sparse
Thanks for the good catch. That is simple and obvious correct.
Will apply.
Chris
On Wed, Aug 1, 2012 at 9:07 AM, Mauro Dreissig <mukadr@gmail.com> wrote:
> Signed-off-by: Mauro Dreissig <mukadr@gmail.com>
> ---
> expression.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/expression.c b/expression.c
> index 0ae3a60..9f45c79 100644
> --- a/expression.c
> +++ b/expression.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-01 16:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-01 16:07 [PATCH] Fix wrong array size expression Mauro Dreissig
2012-08-01 16:35 ` Christopher Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).