Skip to content

Commit 4dbad81

Browse files
Daniel Lezcanorafaeljw
authored andcommitted
timer: move enum definition out of ifdef section
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. 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 for the variable cpu which 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> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 488540b commit 4dbad81

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

‎include/linux/clockchips.h‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@
88
#ifndef _LINUX_CLOCKCHIPS_H
99
#define _LINUX_CLOCKCHIPS_H
1010

11+
/* Clock event notification values */
12+
enum clock_event_nofitiers {
13+
CLOCK_EVT_NOTIFY_ADD,
14+
CLOCK_EVT_NOTIFY_BROADCAST_ON,
15+
CLOCK_EVT_NOTIFY_BROADCAST_OFF,
16+
CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
17+
CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
18+
CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
19+
CLOCK_EVT_NOTIFY_SUSPEND,
20+
CLOCK_EVT_NOTIFY_RESUME,
21+
CLOCK_EVT_NOTIFY_CPU_DYING,
22+
CLOCK_EVT_NOTIFY_CPU_DEAD,
23+
};
24+
1125
#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
1226

1327
#include <linux/clocksource.h>
@@ -26,20 +40,6 @@ enum clock_event_mode {
2640
CLOCK_EVT_MODE_RESUME,
2741
};
2842

29-
/* Clock event notification values */
30-
enum clock_event_nofitiers {
31-
CLOCK_EVT_NOTIFY_ADD,
32-
CLOCK_EVT_NOTIFY_BROADCAST_ON,
33-
CLOCK_EVT_NOTIFY_BROADCAST_OFF,
34-
CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
35-
CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
36-
CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
37-
CLOCK_EVT_NOTIFY_SUSPEND,
38-
CLOCK_EVT_NOTIFY_RESUME,
39-
CLOCK_EVT_NOTIFY_CPU_DYING,
40-
CLOCK_EVT_NOTIFY_CPU_DEAD,
41-
};
42-
4343
/*
4444
* Clock event features
4545
*/
@@ -173,15 +173,15 @@ extern int tick_receive_broadcast(void);
173173
#ifdef CONFIG_GENERIC_CLOCKEVENTS
174174
extern void clockevents_notify(unsigned long reason, void *arg);
175175
#else
176-
# define clockevents_notify(reason, arg) do { } while (0)
176+
static inline void clockevents_notify(unsigned long reason, void *arg) {}
177177
#endif
178178

179179
#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
180180

181181
static inline void clockevents_suspend(void) {}
182182
static inline void clockevents_resume(void) {}
183183

184-
#define clockevents_notify(reason, arg) do { } while (0)
184+
static inline void clockevents_notify(unsigned long reason, void *arg) {}
185185

186186
#endif
187187

0 commit comments

Comments
 (0)