Commit 844056fd authored by Linus Torvalds's avatar Linus Torvalds

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

Pull timer updates from Thomas Gleixner:

 - The final conversion of timer wheel timers to timer_setup().

   A few manual conversions and a large coccinelle assisted sweep and
   the removal of the old initialization mechanisms and the related
   code.

 - Remove the now unused VSYSCALL update code

 - Fix permissions of /proc/timer_list. I still need to get rid of that
   file completely

 - Rename a misnomed clocksource function and remove a stale declaration

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
  m68k/macboing: Fix missed timer callback assignment
  treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts
  timer: Remove redundant __setup_timer*() macros
  timer: Pass function down to initialization routines
  timer: Remove unused data arguments from macros
  timer: Switch callback prototype to take struct timer_list * argument
  timer: Pass timer_list pointer to callbacks unconditionally
  Coccinelle: Remove setup_timer.cocci
  timer: Remove setup_*timer() interface
  timer: Remove init_timer() interface
  treewide: setup_timer() -> timer_setup() (2 field)
  treewide: setup_timer() -> timer_setup()
  treewide: init_timer() -> setup_timer()
  treewide: Switch DEFINE_TIMER callbacks to struct timer_list *
  s390: cmm: Convert timers to use timer_setup()
  lightnvm: Convert timers to use timer_setup()
  drivers/net: cris: Convert timers to use timer_setup()
  drm/vc4: Convert timers to use timer_setup()
  block/laptop_mode: Convert timers to use timer_setup()
  net/atm/mpc: Avoid open-coded assignment of timer callback function
  ...
parents ca122fe3 54b8a230
......@@ -177,18 +177,14 @@ Here is a sample module which implements a basic per cpu counter using
printk("Read : CPU %d, count %ld\n", cpu,
local_read(&per_cpu(counters, cpu)));
}
del_timer(&test_timer);
test_timer.expires = jiffies + 1000;
add_timer(&test_timer);
mod_timer(&test_timer, jiffies + 1000);
}
static int __init test_init(void)
{
/* initialize the timer that will increment the counter */
init_timer(&test_timer);
test_timer.function = do_test_timer;
test_timer.expires = jiffies + 1;
add_timer(&test_timer);
timer_setup(&test_timer, do_test_timer, 0);
mod_timer(&test_timer, jiffies + 1);
return 0;
}
......
......@@ -65,9 +65,9 @@ srmcons_do_receive_chars(struct tty_port *port)
}
static void
srmcons_receive_chars(unsigned long data)
srmcons_receive_chars(struct timer_list *t)
{
struct srmcons_private *srmconsp = (struct srmcons_private *)data;
struct srmcons_private *srmconsp = from_timer(srmconsp, t, timer);
struct tty_port *port = &srmconsp->port;
unsigned long flags;
int incr = 10;
......@@ -206,8 +206,7 @@ static const struct tty_operations srmcons_ops = {
static int __init
srmcons_init(void)
{
setup_timer(&srmcons_singleton.timer, srmcons_receive_chars,
(unsigned long)&srmcons_singleton);
timer_setup(&srmcons_singleton.timer, srmcons_receive_chars, 0);
if (srm_is_registered_console) {
struct tty_driver *driver;
int err;
......
......@@ -305,7 +305,7 @@ static void n2100_restart(enum reboot_mode mode, const char *cmd)
static struct timer_list power_button_poll_timer;
static void power_button_poll(unsigned long dummy)
static void power_button_poll(struct timer_list *unused)
{
if (gpio_get_value(N2100_POWER_BUTTON) == 0) {
ctrl_alt_del();
......@@ -336,8 +336,7 @@ static int __init n2100_request_gpios(void)
pr_err("could not set power GPIO as input\n");
}
/* Set up power button poll timer */
init_timer(&power_button_poll_timer);
power_button_poll_timer.function = power_button_poll;
timer_setup(&power_button_poll_timer, power_button_poll, 0);
power_button_poll_timer.expires = jiffies + (HZ / 10);
add_timer(&power_button_poll_timer);
return 0;
......
......@@ -179,10 +179,10 @@ static int power_button_countdown;
/* Must hold the button down for at least this many counts to be processed */
#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
static void dsmg600_power_handler(unsigned long data);
static void dsmg600_power_handler(struct timer_list *unused);
static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler);
static void dsmg600_power_handler(unsigned long data)
static void dsmg600_power_handler(struct timer_list *unused)
{
/* This routine is called twice per second to check the
* state of the power button.
......
......@@ -202,10 +202,10 @@ static int power_button_countdown;
/* Must hold the button down for at least this many counts to be processed */
#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
static void nas100d_power_handler(unsigned long data);
static void nas100d_power_handler(struct timer_list *unused);
static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler);
static void nas100d_power_handler(unsigned long data)
static void nas100d_power_handler(struct timer_list *unused)
{
/* This routine is called twice per second to check the
* state of the power button.
......
......@@ -172,7 +172,7 @@ static struct platform_device db88f5281_nand_flash = {
static void __iomem *db88f5281_7seg;
static struct timer_list db88f5281_timer;
static void db88f5281_7seg_event(unsigned long data)
static void db88f5281_7seg_event(struct timer_list *unused)
{
static int count = 0;
writel(0, db88f5281_7seg + (count << 4));
......@@ -189,7 +189,7 @@ static int __init db88f5281_7seg_init(void)
printk(KERN_ERR "Failed to ioremap db88f5281_7seg\n");
return -EIO;
}
setup_timer(&db88f5281_timer, db88f5281_7seg_event, 0);
timer_setup(&db88f5281_timer, db88f5281_7seg_event, 0);
mod_timer(&db88f5281_timer, jiffies + 2 * HZ);
}
......
......@@ -166,7 +166,7 @@ int check_nmi_wdt_touched(void)
return 1;
}
static void nmi_wdt_timer(unsigned long data)
static void nmi_wdt_timer(struct timer_list *unused)
{
if (check_nmi_wdt_touched())
nmi_wdt_keepalive();
......@@ -180,8 +180,7 @@ static int __init init_nmi_wdt(void)
nmi_wdt_start();
nmi_active = true;
init_timer(&ntimer);
ntimer.function = nmi_wdt_timer;
timer_setup(&ntimer, nmi_wdt_timer, 0);
ntimer.expires = jiffies + NMI_CHECK_TIMEOUT;
add_timer(&ntimer);
......
......@@ -65,7 +65,7 @@ void __init amiga_init_sound(void)
#endif
}
static void nosound( unsigned long ignored );
static void nosound(struct timer_list *unused);
static DEFINE_TIMER(sound_timer, nosound);
void amiga_mksound( unsigned int hz, unsigned int ticks )
......@@ -107,7 +107,7 @@ void amiga_mksound( unsigned int hz, unsigned int ticks )
}
static void nosound( unsigned long ignored )
static void nosound(struct timer_list *unused)
{
/* turn off DMA for audio channel 2 */
custom.dmacon = DMAF_AUD2;
......
......@@ -48,9 +48,9 @@ static unsigned long mac_bell_phasepersample;
* some function protos
*/
static void mac_init_asc( void );
static void mac_nosound( unsigned long );
static void mac_nosound(struct timer_list *);
static void mac_quadra_start_bell( unsigned int, unsigned int, unsigned int );
static void mac_quadra_ring_bell( unsigned long );
static void mac_quadra_ring_bell(struct timer_list *);
static void mac_av_start_bell( unsigned int, unsigned int, unsigned int );
static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int );
......@@ -216,7 +216,7 @@ void mac_mksound( unsigned int freq, unsigned int length )
/*
* regular ASC: stop whining ..
*/
static void mac_nosound( unsigned long ignored )
static void mac_nosound(struct timer_list *unused)
{
mac_asc_regs[ ASC_ENABLE ] = 0;
}
......@@ -270,7 +270,7 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig
* already load the wave table, or at least call this one...
* This piece keeps reloading the wave table until done.
*/
static void mac_quadra_ring_bell( unsigned long ignored )
static void mac_quadra_ring_bell(struct timer_list *unused)
{
int i, count = mac_asc_samplespersec / HZ;
unsigned long flags;
......
......@@ -156,7 +156,7 @@ static const struct file_operations pvc_scroll_proc_fops = {
.write = pvc_scroll_proc_write,
};
void pvc_proc_timerfunc(unsigned long data)
void pvc_proc_timerfunc(struct timer_list *unused)
{
if (scroll_dir < 0)
pvc_move(DISPLAY|RIGHT);
......@@ -197,7 +197,7 @@ static int __init pvc_proc_init(void)
if (proc_entry == NULL)
goto error;
setup_timer(&timer, pvc_proc_timerfunc, 0UL);
timer_setup(&timer, pvc_proc_timerfunc, 0);
return 0;
error:
......
......@@ -36,10 +36,10 @@ void mips_display_message(const char *str)
}
}
static void scroll_display_message(unsigned long unused);
static void scroll_display_message(struct timer_list *unused);
static DEFINE_TIMER(mips_scroll_timer, scroll_display_message);
static void scroll_display_message(unsigned long unused)
static void scroll_display_message(struct timer_list *unused)
{
mips_display_message(&display_string[display_count++]);
if (display_count == max_display_count)
......
......@@ -91,7 +91,7 @@ static int pdc_console_setup(struct console *co, char *options)
#define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
static void pdc_console_poll(unsigned long unused);
static void pdc_console_poll(struct timer_list *unused);
static DEFINE_TIMER(pdc_console_timer, pdc_console_poll);
static struct tty_port tty_port;
......@@ -135,7 +135,7 @@ static const struct tty_operations pdc_console_tty_ops = {
.chars_in_buffer = pdc_console_tty_chars_in_buffer,
};
static void pdc_console_poll(unsigned long unused)
static void pdc_console_poll(struct timer_list *unused)
{
int data, count = 0;
......
......@@ -188,7 +188,7 @@ static void tau_timeout(void * info)
local_irq_restore(flags);
}
static void tau_timeout_smp(unsigned long unused)
static void tau_timeout_smp(struct timer_list *unused)
{
/* schedule ourselves to be run again */
......@@ -230,7 +230,7 @@ int __init TAU_init(void)
/* first, set up the window shrinking timer */
setup_timer(&tau_timer, tau_timeout_smp, 0UL);
timer_setup(&tau_timer, tau_timeout_smp, 0);
tau_timer.expires = jiffies + shrink_timer;
add_timer(&tau_timer);
......
......@@ -599,9 +599,9 @@ static void arm_next_watchdog(struct kvm_vcpu *vcpu)
spin_unlock_irqrestore(&vcpu->arch.wdt_lock, flags);
}
void kvmppc_watchdog_func(unsigned long data)
void kvmppc_watchdog_func(struct timer_list *t)
{
struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
struct kvm_vcpu *vcpu = from_timer(vcpu, t, arch.wdt_timer);
u32 tsr, new_tsr;
int final;
......@@ -1412,8 +1412,7 @@ int kvmppc_subarch_vcpu_init(struct kvm_vcpu *vcpu)
{
/* setup watchdog timer once */
spin_lock_init(&vcpu->arch.wdt_lock);
setup_timer(&vcpu->arch.wdt_timer, kvmppc_watchdog_func,
(unsigned long)vcpu);
timer_setup(&vcpu->arch.wdt_timer, kvmppc_watchdog_func, 0);
/*
* Clear DBSR.MRR to avoid guest debug interrupt as
......
......@@ -451,7 +451,7 @@ static inline void enable_ctr(u32 cpu, u32 ctr, u32 *pm07_cntrl)
* This routine will alternate loading the virtual counters for
* virtual CPUs
*/
static void cell_virtual_cntr(unsigned long data)
static void cell_virtual_cntr(struct timer_list *unused)
{
int i, prev_hdw_thread, next_hdw_thread;
u32 cpu;
......@@ -555,7 +555,7 @@ static void cell_virtual_cntr(unsigned long data)
static void start_virt_cntrs(void)
{
setup_timer(&timer_virt_cntr, cell_virtual_cntr, 0UL);
timer_setup(&timer_virt_cntr, cell_virtual_cntr, 0);
timer_virt_cntr.expires = jiffies + HZ / 10;
add_timer(&timer_virt_cntr);
}
......@@ -587,7 +587,7 @@ static int cell_reg_setup_spu_cycles(struct op_counter_config *ctr,
* periodically based on kernel timer to switch which SPU is
* being monitored in a round robbin fashion.
*/
static void spu_evnt_swap(unsigned long data)
static void spu_evnt_swap(struct timer_list *unused)
{
int node;
int cur_phys_spu, nxt_phys_spu, cur_spu_evnt_phys_spu_indx;
......@@ -677,7 +677,7 @@ static void spu_evnt_swap(unsigned long data)
static void start_spu_event_swap(void)
{
setup_timer(&timer_spu_event_swap, spu_evnt_swap, 0UL);
timer_setup(&timer_spu_event_swap, spu_evnt_swap, 0);
timer_spu_event_swap.expires = jiffies + HZ / 25;
add_timer(&timer_spu_event_swap);
}
......
......@@ -992,13 +992,13 @@ static void spu_calc_load(void)
CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks);
}
static void spusched_wake(unsigned long data)
static void spusched_wake(struct timer_list *unused)
{
mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
wake_up_process(spusched_task);
}
static void spuloadavg_wake(unsigned long data)
static void spuloadavg_wake(struct timer_list *unused)
{
mod_timer(&spuloadavg_timer, jiffies + LOAD_FREQ);
spu_calc_load();
......@@ -1124,8 +1124,8 @@ int __init spu_sched_init(void)
}
spin_lock_init(&spu_prio->runq_lock);
setup_timer(&spusched_timer, spusched_wake, 0);
setup_timer(&spuloadavg_timer, spuloadavg_wake, 0);
timer_setup(&spusched_timer, spusched_wake, 0);
timer_setup(&spuloadavg_timer, spuloadavg_wake, 0);
spusched_task = kthread_run(spusched_thread, NULL, "spusched");
if (IS_ERR(spusched_task)) {
......
......@@ -361,9 +361,9 @@ static irqreturn_t kw_i2c_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}
static void kw_i2c_timeout(unsigned long data)
static void kw_i2c_timeout(struct timer_list *t)
{
struct pmac_i2c_host_kw *host = (struct pmac_i2c_host_kw *)data;
struct pmac_i2c_host_kw *host = from_timer(host, t, timeout_timer);
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
......@@ -513,7 +513,7 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
mutex_init(&host->mutex);
init_completion(&host->complete);
spin_lock_init(&host->lock);
setup_timer(&host->timeout_timer, kw_i2c_timeout, (unsigned long)host);
timer_setup(&host->timeout_timer, kw_i2c_timeout, 0);
psteps = of_get_property(np, "AAPL,address-step", NULL);
steps = psteps ? (*psteps) : 0x10;
......
......@@ -523,7 +523,7 @@ static void __init stp_reset(void)
}
}
static void stp_timeout(unsigned long dummy)
static void stp_timeout(struct timer_list *unused)
{
queue_work(time_sync_wq, &stp_work);
}
......@@ -532,7 +532,7 @@ static int __init stp_init(void)
{
if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags))
return 0;
setup_timer(&stp_timer, stp_timeout, 0UL);
timer_setup(&stp_timer, stp_timeout, 0);
time_init_wq();
if (!stp_online)
return 0;
......
......@@ -56,10 +56,10 @@ static DEFINE_SPINLOCK(cmm_lock);
static struct task_struct *cmm_thread_ptr;
static DECLARE_WAIT_QUEUE_HEAD(cmm_thread_wait);
static DEFINE_TIMER(cmm_timer, NULL);
static void cmm_timer_fn(unsigned long);
static void cmm_timer_fn(struct timer_list *);
static void cmm_set_timer(void);
static DEFINE_TIMER(cmm_timer, cmm_timer_fn);
static long cmm_alloc_pages(long nr, long *counter,
struct cmm_page_array **list)
......@@ -194,13 +194,11 @@ static void cmm_set_timer(void)
if (mod_timer(&cmm_timer, jiffies + cmm_timeout_seconds*HZ))
return;
}
cmm_timer.function = cmm_timer_fn;
cmm_timer.data = 0;
cmm_timer.expires = jiffies + cmm_timeout_seconds*HZ;
add_timer(&cmm_timer);
}
static void cmm_timer_fn(unsigned long ignored)
static void cmm_timer_fn(struct timer_list *unused)
{
long nr;
......
......@@ -59,9 +59,9 @@ static inline void heartbeat_toggle_bit(struct heartbeat_data *hd,
}
}
static void heartbeat_timer(unsigned long data)
static void heartbeat_timer(struct timer_list *t)
{
struct heartbeat_data *hd = (struct heartbeat_data *)data;
struct heartbeat_data *hd = from_timer(hd, t, timer);
static unsigned bit = 0, up = 1;
heartbeat_toggle_bit(hd, bit, hd->flags & HEARTBEAT_INVERTED);
......@@ -133,7 +133,7 @@ static int heartbeat_drv_probe(struct platform_device *pdev)
}
}
setup_timer(&hd->timer, heartbeat_timer, (unsigned long)hd);
timer_setup(&hd->timer, heartbeat_timer, 0);
platform_set_drvdata(pdev, hd);
return mod_timer(&hd->timer, jiffies + 1);
......
......@@ -85,18 +85,18 @@ int __init pci_is_66mhz_capable(struct pci_channel *hose,
return cap66 > 0;
}
static void pcibios_enable_err(unsigned long __data)
static void pcibios_enable_err(struct timer_list *t)
{
struct pci_channel *hose = (struct pci_channel *)__data;
struct pci_channel *hose = from_timer(hose, t, err_timer);
del_timer(&hose->err_timer);
printk(KERN_DEBUG "PCI: re-enabling error IRQ.\n");
enable_irq(hose->err_irq);
}
static void pcibios_enable_serr(unsigned long __data)
static void pcibios_enable_serr(struct timer_list *t)
{
struct pci_channel *hose = (struct pci_channel *)__data;
struct pci_channel *hose = from_timer(hose, t, serr_timer);
del_timer(&hose->serr_timer);
printk(KERN_DEBUG "PCI: re-enabling system error IRQ.\n");
......@@ -106,15 +106,11 @@ static void pcibios_enable_serr(unsigned long __data)
void pcibios_enable_timers(struct pci_channel *hose)
{
if (hose->err_irq) {
init_timer(&hose->err_timer);
hose->err_timer.data = (unsigned long)hose;
hose->err_timer.function = pcibios_enable_err;
timer_setup(&hose->err_timer, pcibios_enable_err, 0);
}
if (hose->serr_irq) {
init_timer(&hose->serr_timer);
hose->serr_timer.data = (unsigned long)hose;
hose->serr_timer.function = pcibios_enable_serr;
timer_setup(&hose->serr_timer, pcibios_enable_serr, 0);
}
}
......
......@@ -26,9 +26,9 @@ static ssize_t switch_show(struct device *dev,
}
static DEVICE_ATTR(switch, S_IRUGO, switch_show, NULL);
static void switch_timer(unsigned long data)
static void switch_timer(struct timer_list *t)
{
struct push_switch *psw = (struct push_switch *)data;
struct push_switch *psw = from_timer(psw, t, debounce);
schedule_work(&psw->work);
}
......@@ -78,10 +78,7 @@ static int switch_drv_probe(struct platform_device *pdev)
}
INIT_WORK(&psw->work, switch_work_handler);
init_timer(&psw->debounce);
psw->debounce.function = switch_timer;
psw->debounce.data = (unsigned long)psw;
timer_setup(&psw->debounce, switch_timer, 0);
/* Workqueue API brain-damage */
psw->pdev = pdev;
......
......@@ -863,9 +863,9 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref)
wake_up_all(&q->mq_freeze_wq);
}
static void blk_rq_timed_out_timer(unsigned long data)
static void blk_rq_timed_out_timer(struct timer_list *t)
{
struct request_queue *q = (struct request_queue *)data;
struct request_queue *q = from_timer(q, t, timeout);
kblockd_schedule_work(&q->timeout_work);
}
......@@ -901,9 +901,9 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
q->backing_dev_info->name = "block";
q->node = node_id;
setup_timer(&q->backing_dev_info->laptop_mode_wb_timer,
laptop_mode_timer_fn, (unsigned long) q);
setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q);
timer_setup(&q->backing_dev_info->laptop_mode_wb_timer,
laptop_mode_timer_fn, 0);
timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
INIT_WORK(&q->timeout_work, NULL);
INIT_LIST_HEAD(&q->queue_head);
INIT_LIST_HEAD(&q->timeout_list);
......
......@@ -79,9 +79,9 @@ void blk_stat_add(struct request *rq)
rcu_read_unlock();
}
static void blk_stat_timer_fn(unsigned long data)
static void blk_stat_timer_fn(struct timer_list *t)
{
struct blk_stat_callback *cb = (void *)data;
struct blk_stat_callback *cb = from_timer(cb, t, timer);
unsigned int bucket;
int cpu;
......@@ -130,7 +130,7 @@ blk_stat_alloc_callback(void (*timer_fn)(struct blk_stat_callback *),
cb->bucket_fn = bucket_fn;
cb->data = data;
cb->buckets = buckets;
setup_timer(&cb->timer, blk_stat_timer_fn, (unsigned long)cb);
timer_setup(&cb->timer, blk_stat_timer_fn, 0);
return cb;
}
......
......@@ -225,7 +225,7 @@ struct throtl_data
bool track_bio_latency;
};
static void throtl_pending_timer_fn(unsigned long arg);
static void throtl_pending_timer_fn(struct timer_list *t);
static inline struct throtl_grp *pd_to_tg(struct blkg_policy_data *pd)
{
......@@ -478,8 +478,7 @@ static void throtl_service_queue_init(struct throtl_service_queue *sq)
INIT_LIST_HEAD(&sq->queued[0]);
INIT_LIST_HEAD(&sq->queued[1]);
sq->pending_tree = RB_ROOT;
setup_timer(&sq->pending_timer, throtl_pending_timer_fn,
(unsigned long)sq);
timer_setup(&sq->pending_timer, throtl_pending_timer_fn, 0);
}
static struct blkg_policy_data *throtl_pd_alloc(gfp_t gfp, int node)
......@@ -1249,9 +1248,9 @@ static bool throtl_can_upgrade(struct throtl_data *td,