[PATCH 1/3] rcutorture: Use ARRAY_SIZE macro when appropriate

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Ahmed S. Darwish <darwish.07@...>, <linux-kernel@...>
Date: Wednesday, February 7, 2007 - 2:54 pm

Replace open-coded array size calculation with standard ARRAY_SIZE macro.

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: Josh Triplett <josh@kernel.org>
---
 kernel/rcutorture.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 482b11f..97c2277 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -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);
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/3] rcutorture: Use ARRAY_SIZE macro when appropriate, Josh Triplett, (Wed Feb 7, 2:54 pm)