Skip to content

Commit

Permalink
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  • Loading branch information
torvalds committed Dec 25, 2016
2 parents b272f73 + 1f3a8e4 commit 3ddc76d
Show file tree
Hide file tree
Showing 227 changed files with 604 additions and 665 deletions.
4 changes: 2 additions & 2 deletions arch/alpha/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ init_rtc_clockevent(void)
* The QEMU clock as a clocksource primitive.
*/

static cycle_t
static u64
qemu_cs_read(struct clocksource *cs)
{
return qemu_get_vmtime();
Expand Down Expand Up @@ -260,7 +260,7 @@ common_init_rtc(void)
* 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();
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static void __init timer_init(void)
/*
* clocksource
*/
static cycle_t read_cycles(struct clocksource *cs)
static u64 read_cycles(struct clocksource *cs)
{
struct timer_s *t = &timers[TID_CLOCKSOURCE];

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-ep93xx/timer-ep93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ static u64 notrace ep93xx_read_sched_clock(void)
return ret;
}

cycle_t ep93xx_clocksource_read(struct clocksource *c)
u64 ep93xx_clocksource_read(struct clocksource *c)
{
u64 ret;

ret = readl(EP93XX_TIMER4_VALUE_LOW);
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,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/dc21285-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#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;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-ixp4xx/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ static u64 notrace ixp4xx_read_sched_clock(void)
* clocksource
*/

static cycle_t ixp4xx_clocksource_read(struct clocksource *c)
static u64 ixp4xx_clocksource_read(struct clocksource *c)
{
return *IXP4XX_OSTS;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static struct clock_event_device ckevt = {
.set_state_oneshot = timer_set_shutdown,
};

static cycle_t clksrc_read(struct clocksource *cs)
static u64 clksrc_read(struct clocksource *cs)
{
return timer_read();
}
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ static bool use_gptimer_clksrc __initdata;
/*
* 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);
}

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-iop/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/*
* 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();
}
Expand Down
4 changes: 2 additions & 2 deletions arch/avr32/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

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);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions arch/blackfin/kernel/time-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#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
return __bfin_cycles_off + (get_cycles() << __bfin_cycles_mod);
Expand Down Expand Up @@ -80,7 +80,7 @@ void __init setup_gptimer0(void)
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();
}
Expand Down
2 changes: 1 addition & 1 deletion arch/c6x/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
static u32 sched_clock_multiplier;
#define SCHED_CLOCK_SHIFT 16

static cycle_t tsc_read(struct clocksource *cs)
static u64 tsc_read(struct clocksource *cs)
{
return get_cycles();
}
Expand Down
4 changes: 2 additions & 2 deletions arch/hexagon/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ struct adsp_hw_timer_struct {
/* Look for "TCX0" for related constants. */
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 = {
Expand Down
4 changes: 2 additions & 2 deletions arch/ia64/kernel/cyclone.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ void __init cyclone_setup(void)

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 = {
Expand Down
6 changes: 3 additions & 3 deletions arch/ia64/kernel/fsyscall_gtod_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ struct fsyscall_gtod_data_t {
seqcount_t seq;
struct timespec wall_time;
struct timespec monotonic_time;
cycle_t clk_mask;
u64 clk_mask;
u32 clk_mult;
u32 clk_shift;
void *clk_fsys_mmio;
cycle_t clk_cycle_last;
u64 clk_cycle_last;
} ____cacheline_aligned;

struct itc_jitter_data_t {
int itc_jitter;
cycle_t itc_lastcycle;
u64 itc_lastcycle;
} ____cacheline_aligned;

6 changes: 3 additions & 3 deletions arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -397,7 +397,7 @@ void update_vsyscall_tz(void)
}

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);

Expand Down
4 changes: 2 additions & 2 deletions arch/ia64/sn/kernel/sn2/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

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 = {
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/68000/timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
u32 cycles;
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/coldfire/dma_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define DMA_DTMR_CLK_DIV_16 (2 << 1)
#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);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/coldfire/pit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
u32 cycles;
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/coldfire/sltimers.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static struct irqaction mcfslt_timer_irq = {
.handler = mcfslt_tick,
};

static cycle_t mcfslt_read_clk(struct clocksource *cs)
static u64 mcfslt_read_clk(struct clocksource *cs)
{
unsigned long flags;
u32 cycles, scnt;
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/coldfire/timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static struct irqaction mcftmr_timer_irq = {

/***************************************************************************/

static cycle_t mcftmr_read_clk(struct clocksource *cs)
static u64 mcftmr_read_clk(struct clocksource *cs)
{
unsigned long flags;
u32 cycles;
Expand Down
6 changes: 3 additions & 3 deletions arch/microblaze/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,17 @@ static u64 xilinx_clock_read(void)
return read_fn(timer_baseaddr + TCR1);
}

static cycle_t xilinx_read(struct clocksource *cs)
static u64 xilinx_read(struct clocksource *cs)
{
/* reading actual value of timer 1 */
return (cycle_t)xilinx_clock_read();
return (u64)xilinx_clock_read();
}

static struct timecounter xilinx_tc = {
.cc = NULL,
};

static cycle_t xilinx_cc_read(const struct cyclecounter *cc)
static u64 xilinx_cc_read(const struct cyclecounter *cc)
{
return xilinx_read(NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/alchemy/common/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/* 32kHz clock enabled and detected */
#define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S)

static cycle_t au1x_counter1_read(struct clocksource *cs)
static u64 au1x_counter1_read(struct clocksource *cs)
{
return alchemy_rdsys(AU1000_SYS_RTCREAD);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/cavium-octeon/csrc-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void octeon_init_cvmcount(void)
local_irq_restore(flags);
}

static cycle_t octeon_cvmcount_read(struct clocksource *cs)
static u64 octeon_cvmcount_read(struct clocksource *cs)
{
return read_c0_cvmcount();
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/jz4740/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

static uint16_t jz4740_jiffies_per_tick;

static cycle_t jz4740_clocksource_read(struct clocksource *cs)
static u64 jz4740_clocksource_read(struct clocksource *cs)
{
return jz4740_timer_get_count(TIMER_CLOCKSOURCE);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/cevt-txx9.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct txx9_clocksource {
struct txx9_tmr_reg __iomem *tmrptr;
};

static cycle_t txx9_cs_read(struct clocksource *cs)
static u64 txx9_cs_read(struct clocksource *cs)
{
struct txx9_clocksource *txx9_cs =
container_of(cs, struct txx9_clocksource, cs);
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/kernel/csrc-bcm1480.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

#include <asm/sibyte/sb1250.h>

static cycle_t bcm1480_hpt_read(struct clocksource *cs)
static u64 bcm1480_hpt_read(struct clocksource *cs)
{
return (cycle_t) __raw_readq(IOADDR(A_SCD_ZBBUS_CYCLE_COUNT));
return (u64) __raw_readq(IOADDR(A_SCD_ZBBUS_CYCLE_COUNT));
}

struct clocksource bcm1480_clocksource = {
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/csrc-ioasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <asm/dec/ioasic.h>
#include <asm/dec/ioasic_addrs.h>

static cycle_t dec_ioasic_hpt_read(struct clocksource *cs)
static u64 dec_ioasic_hpt_read(struct clocksource *cs)
{
return ioasic_read(IO_REG_FCTR);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/csrc-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <asm/time.h>

static cycle_t c0_hpt_read(struct clocksource *cs)
static u64 c0_hpt_read(struct clocksource *cs)
{
return read_c0_count();
}
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/kernel/csrc-sb1250.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* The HPT is free running from SB1250_HPT_VALUE down to 0 then starts over
* again.
*/
static inline cycle_t sb1250_hpt_get_cycles(void)
static inline u64 sb1250_hpt_get_cycles(void)
{
unsigned int count;
void __iomem *addr;
Expand All @@ -41,7 +41,7 @@ static inline cycle_t sb1250_hpt_get_cycles(void)
return SB1250_HPT_VALUE - count;
}

static cycle_t sb1250_hpt_read(struct clocksource *cs)
static u64 sb1250_hpt_read(struct clocksource *cs)
{
return sb1250_hpt_get_cycles();
}
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/loongson32/common/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void __init ls1x_pwmtimer_init(void)
ls1x_pwmtimer_restart();
}

static cycle_t ls1x_clocksource_read(struct clocksource *cs)
static u64 ls1x_clocksource_read(struct clocksource *cs)
{
unsigned long flags;
int count;
Expand Down Expand Up @@ -107,7 +107,7 @@ static cycle_t ls1x_clocksource_read(struct clocksource *cs)

raw_spin_unlock_irqrestore(&ls1x_timer_lock, flags);

return (cycle_t) (jifs * ls1x_jiffies_per_tick) + count;
return (u64) (jifs * ls1x_jiffies_per_tick) + count;
}

static struct clocksource ls1x_clocksource = {
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void __init setup_mfgpt0_timer(void)
* to just read by itself. So use jiffies to emulate a free
* running counter:
*/
static cycle_t mfgpt_read(struct clocksource *cs)
static u64 mfgpt_read(struct clocksource *cs)
{
unsigned long flags;
int count;
Expand Down Expand Up @@ -188,7 +188,7 @@ static cycle_t mfgpt_read(struct clocksource *cs)

raw_spin_unlock_irqrestore(&mfgpt_lock, flags);

return (cycle_t) (jifs * COMPARE) + count;
return (u64) (jifs * COMPARE) + count;
}

static struct clocksource clocksource_mfgpt = {
Expand Down
Loading

0 comments on commit 3ddc76d

Please sign in to comment.