Skip to content
Snippets Groups Projects
Commit 3ddc76df authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer type cleanups from Thomas Gleixner:
 "This series does a tree wide cleanup of types related to
  timers/timekeeping.

   - Get rid of cycles_t and use a plain u64. The type is not really
     helpful and caused more confusion than clarity

   - Get rid of the ktime union. The union has become useless as we use
     the scalar nanoseconds storage unconditionally now. The 32bit
     timespec alike storage got removed due to the Y2038 limitations
     some time ago.

     That leaves the odd union access around for no reason. Clean it up.

  Both changes have been done with coccinelle and a small amount of
  manual mopping up"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  ktime: Get rid of ktime_equal()
  ktime: Cleanup ktime_set() usage
  ktime: Get rid of the union
  clocksource: Use a plain u64 instead of cycle_t
parents b272f732 1f3a8e49
No related branches found
No related tags found
No related merge requests found
Showing
with 32 additions and 32 deletions
...@@ -133,7 +133,7 @@ init_rtc_clockevent(void) ...@@ -133,7 +133,7 @@ init_rtc_clockevent(void)
* The QEMU clock as a clocksource primitive. * The QEMU clock as a clocksource primitive.
*/ */
static cycle_t static u64
qemu_cs_read(struct clocksource *cs) qemu_cs_read(struct clocksource *cs)
{ {
return qemu_get_vmtime(); return qemu_get_vmtime();
...@@ -260,7 +260,7 @@ common_init_rtc(void) ...@@ -260,7 +260,7 @@ common_init_rtc(void)
* use this method when WTINT is in use. * use this method when WTINT is in use.
*/ */
static cycle_t read_rpcc(struct clocksource *cs) static u64 read_rpcc(struct clocksource *cs)
{ {
return rpcc(); return rpcc();
} }
......
...@@ -268,7 +268,7 @@ static void __init timer_init(void) ...@@ -268,7 +268,7 @@ static void __init timer_init(void)
/* /*
* clocksource * clocksource
*/ */
static cycle_t read_cycles(struct clocksource *cs) static u64 read_cycles(struct clocksource *cs)
{ {
struct timer_s *t = &timers[TID_CLOCKSOURCE]; struct timer_s *t = &timers[TID_CLOCKSOURCE];
......
...@@ -59,13 +59,13 @@ static u64 notrace ep93xx_read_sched_clock(void) ...@@ -59,13 +59,13 @@ static u64 notrace ep93xx_read_sched_clock(void)
return ret; return ret;
} }
cycle_t ep93xx_clocksource_read(struct clocksource *c) u64 ep93xx_clocksource_read(struct clocksource *c)
{ {
u64 ret; u64 ret;
ret = readl(EP93XX_TIMER4_VALUE_LOW); ret = readl(EP93XX_TIMER4_VALUE_LOW);
ret |= ((u64) (readl(EP93XX_TIMER4_VALUE_HIGH) & 0xff) << 32); ret |= ((u64) (readl(EP93XX_TIMER4_VALUE_HIGH) & 0xff) << 32);
return (cycle_t) ret; return (u64) ret;
} }
static int ep93xx_clkevt_set_next_event(unsigned long next, static int ep93xx_clkevt_set_next_event(unsigned long next,
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "common.h" #include "common.h"
static cycle_t cksrc_dc21285_read(struct clocksource *cs) static u64 cksrc_dc21285_read(struct clocksource *cs)
{ {
return cs->mask - *CSR_TIMER2_VALUE; return cs->mask - *CSR_TIMER2_VALUE;
} }
......
...@@ -493,7 +493,7 @@ static u64 notrace ixp4xx_read_sched_clock(void) ...@@ -493,7 +493,7 @@ static u64 notrace ixp4xx_read_sched_clock(void)
* clocksource * clocksource
*/ */
static cycle_t ixp4xx_clocksource_read(struct clocksource *c) static u64 ixp4xx_clocksource_read(struct clocksource *c)
{ {
return *IXP4XX_OSTS; return *IXP4XX_OSTS;
} }
......
...@@ -144,7 +144,7 @@ static struct clock_event_device ckevt = { ...@@ -144,7 +144,7 @@ static struct clock_event_device ckevt = {
.set_state_oneshot = timer_set_shutdown, .set_state_oneshot = timer_set_shutdown,
}; };
static cycle_t clksrc_read(struct clocksource *cs) static u64 clksrc_read(struct clocksource *cs)
{ {
return timer_read(); return timer_read();
} }
......
...@@ -369,9 +369,9 @@ static bool use_gptimer_clksrc __initdata; ...@@ -369,9 +369,9 @@ static bool use_gptimer_clksrc __initdata;
/* /*
* clocksource * clocksource
*/ */
static cycle_t clocksource_read_cycles(struct clocksource *cs) static u64 clocksource_read_cycles(struct clocksource *cs)
{ {
return (cycle_t)__omap_dm_timer_read_counter(&clksrc, return (u64)__omap_dm_timer_read_counter(&clksrc,
OMAP_TIMER_NONPOSTED); OMAP_TIMER_NONPOSTED);
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
/* /*
* IOP clocksource (free-running timer 1). * IOP clocksource (free-running timer 1).
*/ */
static cycle_t notrace iop_clocksource_read(struct clocksource *unused) static u64 notrace iop_clocksource_read(struct clocksource *unused)
{ {
return 0xffffffffu - read_tcr1(); return 0xffffffffu - read_tcr1();
} }
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
static bool disable_cpu_idle_poll; static bool disable_cpu_idle_poll;
static cycle_t read_cycle_count(struct clocksource *cs) static u64 read_cycle_count(struct clocksource *cs)
{ {
return (cycle_t)sysreg_read(COUNT); return (u64)sysreg_read(COUNT);
} }
/* /*
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#if defined(CONFIG_CYCLES_CLOCKSOURCE) #if defined(CONFIG_CYCLES_CLOCKSOURCE)
static notrace cycle_t bfin_read_cycles(struct clocksource *cs) static notrace u64 bfin_read_cycles(struct clocksource *cs)
{ {
#ifdef CONFIG_CPU_FREQ #ifdef CONFIG_CPU_FREQ
return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod); return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod);
...@@ -80,7 +80,7 @@ void __init setup_gptimer0(void) ...@@ -80,7 +80,7 @@ void __init setup_gptimer0(void)
enable_gptimers(TIMER0bit); enable_gptimers(TIMER0bit);
} }
static cycle_t bfin_read_gptimer0(struct clocksource *cs) static u64 bfin_read_gptimer0(struct clocksource *cs)
{ {
return bfin_read_TIMER0_COUNTER(); return bfin_read_TIMER0_COUNTER();
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
static u32 sched_clock_multiplier; static u32 sched_clock_multiplier;
#define SCHED_CLOCK_SHIFT 16 #define SCHED_CLOCK_SHIFT 16
static cycle_t tsc_read(struct clocksource *cs) static u64 tsc_read(struct clocksource *cs)
{ {
return get_cycles(); return get_cycles();
} }
......
...@@ -72,9 +72,9 @@ struct adsp_hw_timer_struct { ...@@ -72,9 +72,9 @@ struct adsp_hw_timer_struct {
/* Look for "TCX0" for related constants. */ /* Look for "TCX0" for related constants. */
static __iomem struct adsp_hw_timer_struct *rtos_timer; static __iomem struct adsp_hw_timer_struct *rtos_timer;
static cycle_t timer_get_cycles(struct clocksource *cs) static u64 timer_get_cycles(struct clocksource *cs)
{ {
return (cycle_t) __vmgettime(); return (u64) __vmgettime();
} }
static struct clocksource hexagon_clocksource = { static struct clocksource hexagon_clocksource = {
......
...@@ -21,9 +21,9 @@ void __init cyclone_setup(void) ...@@ -21,9 +21,9 @@ void __init cyclone_setup(void)
static void __iomem *cyclone_mc; static void __iomem *cyclone_mc;
static cycle_t read_cyclone(struct clocksource *cs) static u64 read_cyclone(struct clocksource *cs)
{ {
return (cycle_t)readq((void __iomem *)cyclone_mc); return (u64)readq((void __iomem *)cyclone_mc);
} }
static struct clocksource clocksource_cyclone = { static struct clocksource clocksource_cyclone = {
......
...@@ -9,15 +9,15 @@ struct fsyscall_gtod_data_t { ...@@ -9,15 +9,15 @@ struct fsyscall_gtod_data_t {
seqcount_t seq; seqcount_t seq;
struct timespec wall_time; struct timespec wall_time;
struct timespec monotonic_time; struct timespec monotonic_time;
cycle_t clk_mask; u64 clk_mask;
u32 clk_mult; u32 clk_mult;
u32 clk_shift; u32 clk_shift;
void *clk_fsys_mmio; void *clk_fsys_mmio;
cycle_t clk_cycle_last; u64 clk_cycle_last;
} ____cacheline_aligned; } ____cacheline_aligned;
struct itc_jitter_data_t { struct itc_jitter_data_t {
int itc_jitter; int itc_jitter;
cycle_t itc_lastcycle; u64 itc_lastcycle;
} ____cacheline_aligned; } ____cacheline_aligned;
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "fsyscall_gtod_data.h" #include "fsyscall_gtod_data.h"
static cycle_t itc_get_cycles(struct clocksource *cs); static u64 itc_get_cycles(struct clocksource *cs);
struct fsyscall_gtod_data_t fsyscall_gtod_data; struct fsyscall_gtod_data_t fsyscall_gtod_data;
...@@ -323,7 +323,7 @@ void ia64_init_itm(void) ...@@ -323,7 +323,7 @@ void ia64_init_itm(void)
} }
} }
static cycle_t itc_get_cycles(struct clocksource *cs) static u64 itc_get_cycles(struct clocksource *cs)
{ {
unsigned long lcycle, now, ret; unsigned long lcycle, now, ret;
...@@ -397,7 +397,7 @@ void update_vsyscall_tz(void) ...@@ -397,7 +397,7 @@ void update_vsyscall_tz(void)
} }
void update_vsyscall_old(struct timespec *wall, struct timespec *wtm, void update_vsyscall_old(struct timespec *wall, struct timespec *wtm,
struct clocksource *c, u32 mult, cycle_t cycle_last) struct clocksource *c, u32 mult, u64 cycle_last)
{ {
write_seqcount_begin(&fsyscall_gtod_data.seq); write_seqcount_begin(&fsyscall_gtod_data.seq);
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
extern unsigned long sn_rtc_cycles_per_second; extern unsigned long sn_rtc_cycles_per_second;
static cycle_t read_sn2(struct clocksource *cs) static u64 read_sn2(struct clocksource *cs)
{ {
return (cycle_t)readq(RTC_COUNTER_ADDR); return (u64)readq(RTC_COUNTER_ADDR);
} }
static struct clocksource clocksource_sn2 = { static struct clocksource clocksource_sn2 = {
......
...@@ -76,7 +76,7 @@ static struct irqaction m68328_timer_irq = { ...@@ -76,7 +76,7 @@ static struct irqaction m68328_timer_irq = {
/***************************************************************************/ /***************************************************************************/
static cycle_t m68328_read_clk(struct clocksource *cs) static u64 m68328_read_clk(struct clocksource *cs)
{ {
unsigned long flags; unsigned long flags;
u32 cycles; u32 cycles;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define DMA_DTMR_CLK_DIV_16 (2 << 1) #define DMA_DTMR_CLK_DIV_16 (2 << 1)
#define DMA_DTMR_ENABLE (1 << 0) #define DMA_DTMR_ENABLE (1 << 0)
static cycle_t cf_dt_get_cycles(struct clocksource *cs) static u64 cf_dt_get_cycles(struct clocksource *cs)
{ {
return __raw_readl(DTCN0); return __raw_readl(DTCN0);
} }
......
...@@ -118,7 +118,7 @@ static struct irqaction pit_irq = { ...@@ -118,7 +118,7 @@ static struct irqaction pit_irq = {
/***************************************************************************/ /***************************************************************************/
static cycle_t pit_read_clk(struct clocksource *cs) static u64 pit_read_clk(struct clocksource *cs)
{ {
unsigned long flags; unsigned long flags;
u32 cycles; u32 cycles;
......
...@@ -97,7 +97,7 @@ static struct irqaction mcfslt_timer_irq = { ...@@ -97,7 +97,7 @@ static struct irqaction mcfslt_timer_irq = {
.handler = mcfslt_tick, .handler = mcfslt_tick,
}; };
static cycle_t mcfslt_read_clk(struct clocksource *cs) static u64 mcfslt_read_clk(struct clocksource *cs)
{ {
unsigned long flags; unsigned long flags;
u32 cycles, scnt; u32 cycles, scnt;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment