|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC 6/8] x86/hpet: Adjust pointer vs array semantics of hpet_boot_cfg
There should be no functional change as a result, but hpet_boot_cfg is an
array, not a pointer. Code it as such.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Keir Fraser <keir@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
---
xen/arch/x86/hpet.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 2c39808..e8a3f66 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -53,6 +53,9 @@ DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
unsigned long __initdata hpet_address;
u8 __initdata hpet_blockid;
+/* BIOS HPET configuration */
+static u32 *hpet_boot_cfg;
+
/*
* force_hpet_broadcast: by default legacy hpet broadcast will be stopped
* if RTC interrupts are enabled. Enable this option if want to always enable
@@ -803,8 +806,8 @@ void hpet_broadcast_exit(void)
int hpet_broadcast_is_available(void)
{
- return ((hpet_events && (hpet_events->flags & HPET_EVT_LEGACY))
- || num_hpets_used > 0);
+ return ( num_hpets_used > 0 ||
+ (hpet_events && (hpet_events->flags & HPET_EVT_LEGACY)) );
}
int hpet_legacy_irq_tick(void)
@@ -819,8 +822,6 @@ int hpet_legacy_irq_tick(void)
return 1;
}
-static u32 *hpet_boot_cfg;
-
u64 __init hpet_setup(void)
{
static u64 __initdata hpet_rate;
@@ -893,7 +894,7 @@ void hpet_resume(u32 *boot_cfg)
cfg = hpet_read32(HPET_CFG);
if ( boot_cfg )
- *boot_cfg = cfg;
+ boot_cfg[0] = cfg;
cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
if ( cfg )
{
@@ -942,12 +943,12 @@ void hpet_disable(void)
return;
}
- hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+ hpet_write32(hpet_boot_cfg[0] & ~HPET_CFG_ENABLE, HPET_CFG);
id = hpet_read32(HPET_ID);
for ( i = 0; i <= ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT); ++i )
hpet_write32(hpet_boot_cfg[i + 1], HPET_Tn_CFG(i));
- if ( *hpet_boot_cfg & HPET_CFG_ENABLE )
- hpet_write32(*hpet_boot_cfg, HPET_CFG);
+ if ( hpet_boot_cfg[0] & HPET_CFG_ENABLE )
+ hpet_write32(hpet_boot_cfg[0], HPET_CFG);
}
--
1.7.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |