From fe971071a89c5c5184fc9f3482c7a8e997cf0520 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 9 Jan 2006 20:54:02 -0800 Subject: [PATCH] drivers/char: Use ARRAY_SIZE macro Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of ARRAY_SIZE. Signed-off-by: Tobias Klauser Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/hvsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/char/hvsi.c') diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index a22aa940e01..a9522189fc9 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c @@ -197,7 +197,7 @@ static inline void print_state(struct hvsi_struct *hp) }; const char *name = state_names[hp->state]; - if (hp->state > (sizeof(state_names)/sizeof(char*))) + if (hp->state > ARRAY_SIZE(state_names)) name = "UNKNOWN"; pr_debug("hvsi%i: state = %s\n", hp->index, name); -- cgit v1.2.3