x86 acpi: remove redundant function call.

PM_TIMER_TICKS_TO_US() and acpi_pm_tick_to_ns() does the almost the
same stuff.  Thus remove the old one.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Wei Gang <wei.gang@intel.com>
This commit is contained in:
Keir Fraser committed 2009-01-15 12:39:59 +00:00
1 parent 3967bb3aff
commit dcf9f950dc
3 files changed
+10 -7

No files matched your search

+2 -7
View File
@@ -50,11 +50,6 @@
#define DEBUG_PM_CX
#define US_TO_PM_TIMER_TICKS(t) ((t * (PM_TIMER_FREQUENCY/1000)) / 1000)
#define PM_TIMER_TICKS_TO_US(t) ((t * 1000) / (PM_TIMER_FREQUENCY / 1000))
#define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */
#define C3_OVERHEAD 4 /* 1us (3.579 ticks per us) */
static void (*lapic_timer_off)(void);
static void (*lapic_timer_on)(void);
@@ -366,7 +361,7 @@ static void acpi_processor_idle(void)
cx->usage++;
if ( sleep_ticks > 0 )
{
power->last_residency = PM_TIMER_TICKS_TO_US(sleep_ticks);
power->last_residency = acpi_pm_tick_to_ns(sleep_ticks) / 1000UL;
cx->time += sleep_ticks;
}
@@ -611,7 +606,7 @@ static void set_cx(
cx->latency = xen_cx->latency;
cx->power = xen_cx->power;
cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
cx->latency_ticks = ns_to_acpi_pm_tick(cx->latency * 1000UL);
cx->target_residency = cx->latency * latency_factor;
if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
acpi_power->safe_state = cx;
+7
View File
@@ -532,9 +532,11 @@ static struct platform_timesource plt_pmtimer =
};
static struct time_scale pmt_scale;
static struct time_scale pmt_scale_r;
static __init int init_pmtmr_scale(void)
{
set_time_scale(&pmt_scale, ACPI_PM_FREQUENCY);
pmt_scale_r = scale_reciprocal(pmt_scale);
return 0;
}
__initcall(init_pmtmr_scale);
@@ -544,6 +546,11 @@ uint64_t acpi_pm_tick_to_ns(uint64_t ticks)
return scale_delta(ticks, &pmt_scale);
}
uint64_t ns_to_acpi_pm_tick(uint64_t ns)
{
return scale_delta(ns, &pmt_scale_r);
}
/************************************************************
* GENERIC PLATFORM TIMER INFRASTRUCTURE
*/
+1
View File
@@ -39,5 +39,6 @@ void pit_broadcast_exit(void);
int pit_broadcast_is_available(void);
uint64_t acpi_pm_tick_to_ns(uint64_t ticks);
uint64_t ns_to_acpi_pm_tick(uint64_t ns);
#endif /* __X86_TIME_H__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.