[PATCH 1/1] lib/test-kstrtox.c: use ARRAY_SIZE instead of sizeof/sizeof[0]

From: Fabian Frederick
Date: Tue Jun 03 2014 - 16:10:13 EST


Use kernel.h definition.

Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
lib/test-kstrtox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test-kstrtox.c b/lib/test-kstrtox.c
index bea3f3f..4137bca 100644
--- a/lib/test-kstrtox.c
+++ b/lib/test-kstrtox.c
@@ -3,7 +3,7 @@
#include <linux/module.h>

#define for_each_test(i, test) \
- for (i = 0; i < sizeof(test) / sizeof(test[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(test); i++)

struct test_fail {
const char *str;
--
1.8.4.5

--
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/