[PATCH 1/1] perf: Use ARRAY_SIZE macro in trace-event-parse.c.

From: Thiago Farina
Date: Sun Apr 03 2011 - 19:01:30 EST


Signed-off-by: Thiago Farina <tfransosi@xxxxxxxxx>
---
tools/perf/util/trace-event-parse.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 0a7ed5b..7c24247 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -2195,7 +2195,7 @@ static const struct flag flags[] = {

unsigned long long eval_flag(const char *flag)
{
- int i;
+ unsigned int i;

/*
* Some flags in the format files do not get converted.
@@ -2205,7 +2205,7 @@ unsigned long long eval_flag(const char *flag)
if (isdigit(flag[0]))
return strtoull(flag, NULL, 0);

- for (i = 0; i < (int)(sizeof(flags)/sizeof(flags[0])); i++)
+ for (i = 0; i < ARRAY_SIZE(flags); i++)
if (strcmp(flags[i].name, flag) == 0)
return flags[i].value;

--
1.7.3.2.343.g7d43d

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/