diff options
author | Nikitas Angelinas <nikitasangelinas@googlemail.com> | 2010-10-21 00:57:31 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-10-21 17:30:06 +0200 |
commit | 2bf1c05e3c406925e498d06da66b4828f0209ea6 (patch) | |
tree | 4125c428e84e66c825020f7b41671de6b6af5574 /kernel/time | |
parent | timer: Initialize the field slack of timer_list (diff) | |
download | linux-2bf1c05e3c406925e498d06da66b4828f0209ea6.tar.xz linux-2bf1c05e3c406925e498d06da66b4828f0209ea6.zip |
time: Use ARRAY_SIZE macro in timecompare.c
Replace sizeof(buffer)/sizeof(buffer[0]) with ARRAY_SIZE(buffer) in
kernel/time/timecompare.c
Signed-off-by: Nikitas Angelinas <nikitasangelinas@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/timecompare.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/time/timecompare.c b/kernel/time/timecompare.c index ac38fbb176cc..a9ae369925ce 100644 --- a/kernel/time/timecompare.c +++ b/kernel/time/timecompare.c @@ -21,6 +21,7 @@ #include <linux/module.h> #include <linux/slab.h> #include <linux/math64.h> +#include <linux/kernel.h> /* * fixed point arithmetic scale factor for skew @@ -57,11 +58,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; |