linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/15] timer: move enum definition out of ifdef section
Date: Mon, 25 Mar 2013 18:55:26 +0100	[thread overview]
Message-ID: <1364234140-514-2-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1364234140-514-1-git-send-email-daniel.lezcano@linaro.org>

The next patch will setup automatically the broadcast timer for
the different cpuidle driver when one idle state stops its timer.
This will be part of the generic code.

But some ARM boards, like s3c64xx, uses cpuidle but without the
CONFIG_GENERIC_CLOCKEVENTS_BUILD set. Hence the cpuidle framework
will be compiled with the code supposed to be generic, that is
with clockevents_notify and the different enum, but will fail to
compile because the enum is not defined.

Also the function clockevents_notify is a noop macro, this is fine
except the usual code is:

	int cpu = smp_processor_id();
	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);

and that raises a warning telling the variable 'cpu' is not used.

Move the clock_event_nofitiers enum definition out of the
CONFIG_GENERIC_CLOCKEVENTS_BUILD section to prevent a compilation
error when these are used in the code.

Change the clockevents_notify macro to a static inline noop function
to prevent a compilation warning.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/clockchips.h |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 6634652..ba661e9 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -8,15 +8,6 @@
 #ifndef _LINUX_CLOCKCHIPS_H
 #define _LINUX_CLOCKCHIPS_H
 
-#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
-
-#include <linux/clocksource.h>
-#include <linux/cpumask.h>
-#include <linux/ktime.h>
-#include <linux/notifier.h>
-
-struct clock_event_device;
-
 /* Clock event mode commands */
 enum clock_event_mode {
 	CLOCK_EVT_MODE_UNUSED = 0,
@@ -40,6 +31,15 @@ enum clock_event_nofitiers {
 	CLOCK_EVT_NOTIFY_CPU_DEAD,
 };
 
+#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
+
+#include <linux/clocksource.h>
+#include <linux/cpumask.h>
+#include <linux/ktime.h>
+#include <linux/notifier.h>
+
+struct clock_event_device;
+
 /*
  * Clock event features
  */
@@ -173,7 +173,7 @@ extern int tick_receive_broadcast(void);
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
 extern void clockevents_notify(unsigned long reason, void *arg);
 #else
-# define clockevents_notify(reason, arg) do { } while (0)
+static inline void clockevents_notify(unsigned long reason, void *arg) {}
 #endif
 
 #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
@@ -181,7 +181,7 @@ extern void clockevents_notify(unsigned long reason, void *arg);
 static inline void clockevents_suspend(void) {}
 static inline void clockevents_resume(void) {}
 
-#define clockevents_notify(reason, arg) do { } while (0)
+static inline void clockevents_notify(unsigned long reason, void *arg) {}
 
 #endif
 
-- 
1.7.9.5

  reply	other threads:[~2013-03-25 17:55 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 17:55 [PATCH 00/15] ARM: cpuidle: code consolidation Daniel Lezcano
2013-03-25 17:55 ` Daniel Lezcano [this message]
2013-03-26  4:36   ` [PATCH 01/15] timer: move enum definition out of ifdef section Santosh Shilimkar
2013-03-26  9:55     ` Daniel Lezcano
2013-03-25 17:55 ` [PATCH 02/15] cpuidle: initialize the broadcast timer framework Daniel Lezcano
2013-03-26  4:39   ` Santosh Shilimkar
2013-03-25 17:55 ` [PATCH 03/15] cpuidle: ux500: remove timer broadcast initialization Daniel Lezcano
2013-03-27 14:46   ` Linus Walleij
2013-03-25 17:55 ` [PATCH 04/15] cpuidle: OMAP4: " Daniel Lezcano
2013-03-26  4:41   ` Santosh Shilimkar
2013-03-25 17:55 ` [PATCH 05/15] cpuidle: imx6: " Daniel Lezcano
2013-03-26  7:25   ` Shawn Guo
2013-03-26  9:43     ` Daniel Lezcano
2013-03-26 12:40       ` Shawn Guo
2013-03-26 12:53         ` Daniel Lezcano
2013-03-26 13:06           ` Rafael J. Wysocki
2013-03-26 14:28   ` Shawn Guo
2013-03-25 17:55 ` [PATCH 06/15] ARM: cpuidle: remove useless declaration Daniel Lezcano
2013-03-25 17:55 ` [PATCH 07/15] ARM: cpuidle: add init/exit routine Daniel Lezcano
2013-03-25 18:10   ` Andrew Lunn
2013-03-25 18:33     ` Daniel Lezcano
2013-03-25 19:09       ` Andrew Lunn
2013-03-25 19:20         ` Daniel Lezcano
2013-03-25 19:31           ` Amit Kucheria
2013-03-25 19:46             ` Daniel Lezcano
2013-03-25 21:42           ` Andrew Lunn
2013-03-25 22:09             ` Daniel Lezcano
2013-03-25 20:28       ` Nicolas Pitre
2013-03-25 21:53         ` Daniel Lezcano
2013-03-25 21:57           ` Nicolas Pitre
2013-03-25 17:55 ` [PATCH 08/15] ARM: ux500: cpuidle: use init/exit common routine Daniel Lezcano
2013-03-27 14:47   ` Linus Walleij
2013-03-25 17:55 ` [PATCH 09/15] ARM: at91: " Daniel Lezcano
2013-03-26  8:48   ` Nicolas Ferre
2013-03-25 17:55 ` [PATCH 10/15] ARM: OMAP3: " Daniel Lezcano
2013-03-25 17:55 ` [PATCH 11/15] ARM: s3c64xx: " Daniel Lezcano
2013-03-25 17:55 ` [PATCH 12/15] ARM: tegra1: " Daniel Lezcano
2013-03-25 17:55 ` [PATCH 13/15] ARM: shmobile: pm: fix init sections Daniel Lezcano
2013-03-27 14:09   ` Simon Horman
2013-03-25 17:55 ` [PATCH 14/15] ARM: shmobile: cpuidle: remove useless WFI function Daniel Lezcano
2013-03-27 14:09   ` Simon Horman
2013-03-25 17:55 ` [PATCH 15/15] ARM: shmobile: cpuidle: use init/exit common routine Daniel Lezcano
2013-03-27 14:10   ` Simon Horman
2013-03-25 20:27 ` [PATCH 00/15] ARM: cpuidle: code consolidation Rob Herring
2013-03-25 21:55   ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364234140-514-2-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).