>From 5e408d962dbbafc581d4442d2e920dc667c0d078 Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Mon, 17 Aug 2009 21:26:17 +0200 Subject: [PATCH 1/3] timecompare: use ARRAY_SIZE() macro --- kernel/time/timecompare.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/timecompare.c b/kernel/time/timecompare.c index 71e7f1a..fe24977 100644 --- a/kernel/time/timecompare.c +++ b/kernel/time/timecompare.c @@ -56,11 +56,11 @@ int timecompare_offset(struct timecompare *sync, int index; int num_samples = sync->num_samples; - if (num_samples > sizeof(buffer)/sizeof(buffer[0])) { + if (num_samples > ARRAY_SIZE(buffer)) { samples = kmalloc(sizeof(*samples) * num_samples, GFP_ATOMIC); if (!samples) { samples = buffer; - num_samples = sizeof(buffer)/sizeof(buffer[0]); + num_samples = ARRAY_SIZE(buffer); } } else { samples = buffer; -- 1.6.3.3