rcutorture: Use ARRAY_SIZE macro when appropriate
authorAhmed S. Darwish <darwish.07@gmail.com>
Tue, 8 May 2007 07:33:14 +0000 (00:33 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:17 +0000 (11:15 -0700)
Use ARRAY_SIZE macro already defined in kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/rcutorture.c

index 75ca2a740471ba44115f3c1dbcb87f850696dff4..7d20d764b8475399cf0e86328699b46636d66e9a 100644 (file)
@@ -899,7 +899,7 @@ rcu_torture_init(void)
        /* Set up the freelist. */
 
        INIT_LIST_HEAD(&rcu_torture_freelist);
-       for (i = 0; i < sizeof(rcu_tortures) / sizeof(rcu_tortures[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++) {
                rcu_tortures[i].rtort_mbtest = 0;
                list_add_tail(&rcu_tortures[i].rtort_free,
                              &rcu_torture_freelist);