diff mbox

[3/3] mach-u300: cleanup clockevent code

Message ID BANLkTi=p_i0nsLWO_6Y06dw_UJyeo0ygxA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Linus Walleij June 1, 2011, 8:53 a.m. UTC
2011/6/1 Thomas Gleixner <tglx@linutronix.de>:

> We need it even on UP for the &!^%$@ broadcast mechanism to avoid a
> massive ifdef mess there :(
>
> But yeah, we can make it conditional for SMP and simply set
> cpumask_of(0) in the UP case.

Like this?

From e5d452d12c510a237c608175ecf0c8218210080f Mon Sep 17 00:00:00 2001
From: Linus Walleij <linus.walleij@linaro.org>
Date: Wed, 1 Jun 2011 10:49:43 +0200
Subject: [PATCH] clockevents: make register functions work on UP

On UP systems the clkevt->cpumask is not required, and so as to
avoid ifdef:ing it out of the struct on UP, we remove the mask
warning on UP and force the mask to CPU0 for consistency.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 kernel/time/clockevents.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index c027d4f..aa664f4 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -182,7 +182,11 @@  void clockevents_register_device(struct
clock_event_device *dev)
 	unsigned long flags;

 	BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
+#ifdef CONFIG_SMP
 	BUG_ON(!dev->cpumask);
+#else
+	dev->cpumask = cpumask_of(0);
+#endif

 	raw_spin_lock_irqsave(&clockevents_lock, flags);