Commit 8c273f2c authored by Thomas Gleixner's avatar Thomas Gleixner

x86/hpet: Move static and global variables to one place

Having static and global variables sprinkled all over the code is just
annoying to read. Move them all to the top of the file.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Andi Kleen <andi.kleen@intel.com>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Ravi Shankar <ravi.v.shankar@intel.com>
Link: https://lkml.kernel.org/r/20190623132434.860549134@linutronix.de
parent 4ce78e20
...@@ -23,6 +23,15 @@ ...@@ -23,6 +23,15 @@
#undef pr_fmt #undef pr_fmt
#define pr_fmt(fmt) "hpet: " fmt #define pr_fmt(fmt) "hpet: " fmt
struct hpet_dev {
struct clock_event_device evt;
unsigned int num;
int cpu;
unsigned int irq;
unsigned int flags;
char name[10];
};
#define HPET_MASK CLOCKSOURCE_MASK(32) #define HPET_MASK CLOCKSOURCE_MASK(32)
#define HPET_DEV_USED_BIT 2 #define HPET_DEV_USED_BIT 2
...@@ -43,18 +52,22 @@ bool hpet_msi_disable; ...@@ -43,18 +52,22 @@ bool hpet_msi_disable;
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
static unsigned int hpet_num_timers; static unsigned int hpet_num_timers;
static struct hpet_dev *hpet_devs;
static DEFINE_PER_CPU(struct hpet_dev *, cpu_hpet_dev);
static struct irq_domain *hpet_domain;
#endif #endif
static void __iomem *hpet_virt_address; static void __iomem *hpet_virt_address;
static u32 *hpet_boot_cfg; static u32 *hpet_boot_cfg;
struct hpet_dev { static bool hpet_legacy_int_enabled;
struct clock_event_device evt; static unsigned long hpet_freq;
unsigned int num;
int cpu; bool boot_hpet_disable;
unsigned int irq; bool hpet_force_user;
unsigned int flags; static bool hpet_verbose;
char name[10];
}; static struct clock_event_device hpet_clockevent;
static inline struct hpet_dev *EVT_TO_HPET_DEV(struct clock_event_device *evtdev) static inline struct hpet_dev *EVT_TO_HPET_DEV(struct clock_event_device *evtdev)
{ {
...@@ -85,10 +98,6 @@ static inline void hpet_clear_mapping(void) ...@@ -85,10 +98,6 @@ static inline void hpet_clear_mapping(void)
/* /*
* HPET command line enable / disable * HPET command line enable / disable
*/ */
bool boot_hpet_disable;
bool hpet_force_user;
static bool hpet_verbose;
static int __init hpet_setup(char *str) static int __init hpet_setup(char *str)
{ {
while (str) { while (str) {
...@@ -120,11 +129,6 @@ static inline int is_hpet_capable(void) ...@@ -120,11 +129,6 @@ static inline int is_hpet_capable(void)
return !boot_hpet_disable && hpet_address; return !boot_hpet_disable && hpet_address;
} }
/*
* HPET timer interrupt enable / disable
*/
static bool hpet_legacy_int_enabled;
/** /**
* is_hpet_enabled - check whether the hpet timer interrupt is enabled * is_hpet_enabled - check whether the hpet timer interrupt is enabled
*/ */
...@@ -217,13 +221,7 @@ static void __init hpet_reserve_platform_timers(unsigned int id) ...@@ -217,13 +221,7 @@ static void __init hpet_reserve_platform_timers(unsigned int id)
static void hpet_reserve_platform_timers(unsigned int id) { } static void hpet_reserve_platform_timers(unsigned int id) { }
#endif #endif
/* /* Common hpet functions */
* Common hpet info
*/
static unsigned long hpet_freq;
static struct clock_event_device hpet_clockevent;
static void hpet_stop_counter(void) static void hpet_stop_counter(void)
{ {
u32 cfg = hpet_readl(HPET_CFG); u32 cfg = hpet_readl(HPET_CFG);
...@@ -430,10 +428,6 @@ static struct clock_event_device hpet_clockevent = { ...@@ -430,10 +428,6 @@ static struct clock_event_device hpet_clockevent = {
*/ */
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
static DEFINE_PER_CPU(struct hpet_dev *, cpu_hpet_dev);
static struct hpet_dev *hpet_devs;
static struct irq_domain *hpet_domain;
void hpet_msi_unmask(struct irq_data *data) void hpet_msi_unmask(struct irq_data *data)
{ {
struct hpet_dev *hdev = irq_data_get_irq_handler_data(data); struct hpet_dev *hdev = irq_data_get_irq_handler_data(data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment