Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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
...

+1227 -1775
+3 -7
Documentation/core-api/local_ops.rst
··· 177 177 printk("Read : CPU %d, count %ld\n", cpu, 178 178 local_read(&per_cpu(counters, cpu))); 179 179 } 180 - del_timer(&test_timer); 181 - test_timer.expires = jiffies + 1000; 182 - add_timer(&test_timer); 180 + mod_timer(&test_timer, jiffies + 1000); 183 181 } 184 182 185 183 static int __init test_init(void) 186 184 { 187 185 /* initialize the timer that will increment the counter */ 188 - init_timer(&test_timer); 189 - test_timer.function = do_test_timer; 190 - test_timer.expires = jiffies + 1; 191 - add_timer(&test_timer); 186 + timer_setup(&test_timer, do_test_timer, 0); 187 + mod_timer(&test_timer, jiffies + 1); 192 188 193 189 return 0; 194 190 }
+3 -4
arch/alpha/kernel/srmcons.c
··· 65 65 } 66 66 67 67 static void 68 - srmcons_receive_chars(unsigned long data) 68 + srmcons_receive_chars(struct timer_list *t) 69 69 { 70 - struct srmcons_private *srmconsp = (struct srmcons_private *)data; 70 + struct srmcons_private *srmconsp = from_timer(srmconsp, t, timer); 71 71 struct tty_port *port = &srmconsp->port; 72 72 unsigned long flags; 73 73 int incr = 10; ··· 206 206 static int __init 207 207 srmcons_init(void) 208 208 { 209 - setup_timer(&srmcons_singleton.timer, srmcons_receive_chars, 210 - (unsigned long)&srmcons_singleton); 209 + timer_setup(&srmcons_singleton.timer, srmcons_receive_chars, 0); 211 210 if (srm_is_registered_console) { 212 211 struct tty_driver *driver; 213 212 int err;
+2 -3
arch/arm/mach-iop32x/n2100.c
··· 305 305 306 306 static struct timer_list power_button_poll_timer; 307 307 308 - static void power_button_poll(unsigned long dummy) 308 + static void power_button_poll(struct timer_list *unused) 309 309 { 310 310 if (gpio_get_value(N2100_POWER_BUTTON) == 0) { 311 311 ctrl_alt_del(); ··· 336 336 pr_err("could not set power GPIO as input\n"); 337 337 } 338 338 /* Set up power button poll timer */ 339 - init_timer(&power_button_poll_timer); 340 - power_button_poll_timer.function = power_button_poll; 339 + timer_setup(&power_button_poll_timer, power_button_poll, 0); 341 340 power_button_poll_timer.expires = jiffies + (HZ / 10); 342 341 add_timer(&power_button_poll_timer); 343 342 return 0;
+2 -2
arch/arm/mach-ixp4xx/dsmg600-setup.c
··· 179 179 /* Must hold the button down for at least this many counts to be processed */ 180 180 #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */ 181 181 182 - static void dsmg600_power_handler(unsigned long data); 182 + static void dsmg600_power_handler(struct timer_list *unused); 183 183 static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler); 184 184 185 - static void dsmg600_power_handler(unsigned long data) 185 + static void dsmg600_power_handler(struct timer_list *unused) 186 186 { 187 187 /* This routine is called twice per second to check the 188 188 * state of the power button.
+2 -2
arch/arm/mach-ixp4xx/nas100d-setup.c
··· 202 202 /* Must hold the button down for at least this many counts to be processed */ 203 203 #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */ 204 204 205 - static void nas100d_power_handler(unsigned long data); 205 + static void nas100d_power_handler(struct timer_list *unused); 206 206 static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler); 207 207 208 - static void nas100d_power_handler(unsigned long data) 208 + static void nas100d_power_handler(struct timer_list *unused) 209 209 { 210 210 /* This routine is called twice per second to check the 211 211 * state of the power button.
+2 -2
arch/arm/mach-orion5x/db88f5281-setup.c
··· 172 172 static void __iomem *db88f5281_7seg; 173 173 static struct timer_list db88f5281_timer; 174 174 175 - static void db88f5281_7seg_event(unsigned long data) 175 + static void db88f5281_7seg_event(struct timer_list *unused) 176 176 { 177 177 static int count = 0; 178 178 writel(0, db88f5281_7seg + (count << 4)); ··· 189 189 printk(KERN_ERR "Failed to ioremap db88f5281_7seg\n"); 190 190 return -EIO; 191 191 } 192 - setup_timer(&db88f5281_timer, db88f5281_7seg_event, 0); 192 + timer_setup(&db88f5281_timer, db88f5281_7seg_event, 0); 193 193 mod_timer(&db88f5281_timer, jiffies + 2 * HZ); 194 194 } 195 195
+2 -3
arch/blackfin/kernel/nmi.c
··· 166 166 return 1; 167 167 } 168 168 169 - static void nmi_wdt_timer(unsigned long data) 169 + static void nmi_wdt_timer(struct timer_list *unused) 170 170 { 171 171 if (check_nmi_wdt_touched()) 172 172 nmi_wdt_keepalive(); ··· 180 180 nmi_wdt_start(); 181 181 nmi_active = true; 182 182 183 - init_timer(&ntimer); 184 - ntimer.function = nmi_wdt_timer; 183 + timer_setup(&ntimer, nmi_wdt_timer, 0); 185 184 ntimer.expires = jiffies + NMI_CHECK_TIMEOUT; 186 185 add_timer(&ntimer); 187 186
+2 -2
arch/m68k/amiga/amisound.c
··· 65 65 #endif 66 66 } 67 67 68 - static void nosound( unsigned long ignored ); 68 + static void nosound(struct timer_list *unused); 69 69 static DEFINE_TIMER(sound_timer, nosound); 70 70 71 71 void amiga_mksound( unsigned int hz, unsigned int ticks ) ··· 107 107 } 108 108 109 109 110 - static void nosound( unsigned long ignored ) 110 + static void nosound(struct timer_list *unused) 111 111 { 112 112 /* turn off DMA for audio channel 2 */ 113 113 custom.dmacon = DMAF_AUD2;
+4 -4
arch/m68k/mac/macboing.c
··· 48 48 * some function protos 49 49 */ 50 50 static void mac_init_asc( void ); 51 - static void mac_nosound( unsigned long ); 51 + static void mac_nosound(struct timer_list *); 52 52 static void mac_quadra_start_bell( unsigned int, unsigned int, unsigned int ); 53 - static void mac_quadra_ring_bell( unsigned long ); 53 + static void mac_quadra_ring_bell(struct timer_list *); 54 54 static void mac_av_start_bell( unsigned int, unsigned int, unsigned int ); 55 55 static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int ); 56 56 ··· 216 216 /* 217 217 * regular ASC: stop whining .. 218 218 */ 219 - static void mac_nosound( unsigned long ignored ) 219 + static void mac_nosound(struct timer_list *unused) 220 220 { 221 221 mac_asc_regs[ ASC_ENABLE ] = 0; 222 222 } ··· 270 270 * already load the wave table, or at least call this one... 271 271 * This piece keeps reloading the wave table until done. 272 272 */ 273 - static void mac_quadra_ring_bell( unsigned long ignored ) 273 + static void mac_quadra_ring_bell(struct timer_list *unused) 274 274 { 275 275 int i, count = mac_asc_samplespersec / HZ; 276 276 unsigned long flags;
+2 -2
arch/mips/lasat/picvue_proc.c
··· 156 156 .write = pvc_scroll_proc_write, 157 157 }; 158 158 159 - void pvc_proc_timerfunc(unsigned long data) 159 + void pvc_proc_timerfunc(struct timer_list *unused) 160 160 { 161 161 if (scroll_dir < 0) 162 162 pvc_move(DISPLAY|RIGHT); ··· 197 197 if (proc_entry == NULL) 198 198 goto error; 199 199 200 - setup_timer(&timer, pvc_proc_timerfunc, 0UL); 200 + timer_setup(&timer, pvc_proc_timerfunc, 0); 201 201 202 202 return 0; 203 203 error:
+2 -2
arch/mips/mti-malta/malta-display.c
··· 36 36 } 37 37 } 38 38 39 - static void scroll_display_message(unsigned long unused); 39 + static void scroll_display_message(struct timer_list *unused); 40 40 static DEFINE_TIMER(mips_scroll_timer, scroll_display_message); 41 41 42 - static void scroll_display_message(unsigned long unused) 42 + static void scroll_display_message(struct timer_list *unused) 43 43 { 44 44 mips_display_message(&display_string[display_count++]); 45 45 if (display_count == max_display_count)
+2 -2
arch/parisc/kernel/pdc_cons.c
··· 91 91 92 92 #define PDC_CONS_POLL_DELAY (30 * HZ / 1000) 93 93 94 - static void pdc_console_poll(unsigned long unused); 94 + static void pdc_console_poll(struct timer_list *unused); 95 95 static DEFINE_TIMER(pdc_console_timer, pdc_console_poll); 96 96 static struct tty_port tty_port; 97 97 ··· 135 135 .chars_in_buffer = pdc_console_tty_chars_in_buffer, 136 136 }; 137 137 138 - static void pdc_console_poll(unsigned long unused) 138 + static void pdc_console_poll(struct timer_list *unused) 139 139 { 140 140 int data, count = 0; 141 141
+2 -2
arch/powerpc/kernel/tau_6xx.c
··· 188 188 local_irq_restore(flags); 189 189 } 190 190 191 - static void tau_timeout_smp(unsigned long unused) 191 + static void tau_timeout_smp(struct timer_list *unused) 192 192 { 193 193 194 194 /* schedule ourselves to be run again */ ··· 230 230 231 231 232 232 /* first, set up the window shrinking timer */ 233 - setup_timer(&tau_timer, tau_timeout_smp, 0UL); 233 + timer_setup(&tau_timer, tau_timeout_smp, 0); 234 234 tau_timer.expires = jiffies + shrink_timer; 235 235 add_timer(&tau_timer); 236 236
+3 -4
arch/powerpc/kvm/booke.c
··· 599 599 spin_unlock_irqrestore(&vcpu->arch.wdt_lock, flags); 600 600 } 601 601 602 - void kvmppc_watchdog_func(unsigned long data) 602 + void kvmppc_watchdog_func(struct timer_list *t) 603 603 { 604 - struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; 604 + struct kvm_vcpu *vcpu = from_timer(vcpu, t, arch.wdt_timer); 605 605 u32 tsr, new_tsr; 606 606 int final; 607 607 ··· 1412 1412 { 1413 1413 /* setup watchdog timer once */ 1414 1414 spin_lock_init(&vcpu->arch.wdt_lock); 1415 - setup_timer(&vcpu->arch.wdt_timer, kvmppc_watchdog_func, 1416 - (unsigned long)vcpu); 1415 + timer_setup(&vcpu->arch.wdt_timer, kvmppc_watchdog_func, 0); 1417 1416 1418 1417 /* 1419 1418 * Clear DBSR.MRR to avoid guest debug interrupt as
+4 -4
arch/powerpc/oprofile/op_model_cell.c
··· 451 451 * This routine will alternate loading the virtual counters for 452 452 * virtual CPUs 453 453 */ 454 - static void cell_virtual_cntr(unsigned long data) 454 + static void cell_virtual_cntr(struct timer_list *unused) 455 455 { 456 456 int i, prev_hdw_thread, next_hdw_thread; 457 457 u32 cpu; ··· 555 555 556 556 static void start_virt_cntrs(void) 557 557 { 558 - setup_timer(&timer_virt_cntr, cell_virtual_cntr, 0UL); 558 + timer_setup(&timer_virt_cntr, cell_virtual_cntr, 0); 559 559 timer_virt_cntr.expires = jiffies + HZ / 10; 560 560 add_timer(&timer_virt_cntr); 561 561 } ··· 587 587 * periodically based on kernel timer to switch which SPU is 588 588 * being monitored in a round robbin fashion. 589 589 */ 590 - static void spu_evnt_swap(unsigned long data) 590 + static void spu_evnt_swap(struct timer_list *unused) 591 591 { 592 592 int node; 593 593 int cur_phys_spu, nxt_phys_spu, cur_spu_evnt_phys_spu_indx; ··· 677 677 678 678 static void start_spu_event_swap(void) 679 679 { 680 - setup_timer(&timer_spu_event_swap, spu_evnt_swap, 0UL); 680 + timer_setup(&timer_spu_event_swap, spu_evnt_swap, 0); 681 681 timer_spu_event_swap.expires = jiffies + HZ / 25; 682 682 add_timer(&timer_spu_event_swap); 683 683 }
+4 -4
arch/powerpc/platforms/cell/spufs/sched.c
··· 992 992 CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks); 993 993 } 994 994 995 - static void spusched_wake(unsigned long data) 995 + static void spusched_wake(struct timer_list *unused) 996 996 { 997 997 mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK); 998 998 wake_up_process(spusched_task); 999 999 } 1000 1000 1001 - static void spuloadavg_wake(unsigned long data) 1001 + static void spuloadavg_wake(struct timer_list *unused) 1002 1002 { 1003 1003 mod_timer(&spuloadavg_timer, jiffies + LOAD_FREQ); 1004 1004 spu_calc_load(); ··· 1124 1124 } 1125 1125 spin_lock_init(&spu_prio->runq_lock); 1126 1126 1127 - setup_timer(&spusched_timer, spusched_wake, 0); 1128 - setup_timer(&spuloadavg_timer, spuloadavg_wake, 0); 1127 + timer_setup(&spusched_timer, spusched_wake, 0); 1128 + timer_setup(&spuloadavg_timer, spuloadavg_wake, 0); 1129 1129 1130 1130 spusched_task = kthread_run(spusched_thread, NULL, "spusched"); 1131 1131 if (IS_ERR(spusched_task)) {
+3 -3
arch/powerpc/platforms/powermac/low_i2c.c
··· 361 361 return IRQ_HANDLED; 362 362 } 363 363 364 - static void kw_i2c_timeout(unsigned long data) 364 + static void kw_i2c_timeout(struct timer_list *t) 365 365 { 366 - struct pmac_i2c_host_kw *host = (struct pmac_i2c_host_kw *)data; 366 + struct pmac_i2c_host_kw *host = from_timer(host, t, timeout_timer); 367 367 unsigned long flags; 368 368 369 369 spin_lock_irqsave(&host->lock, flags); ··· 513 513 mutex_init(&host->mutex); 514 514 init_completion(&host->complete); 515 515 spin_lock_init(&host->lock); 516 - setup_timer(&host->timeout_timer, kw_i2c_timeout, (unsigned long)host); 516 + timer_setup(&host->timeout_timer, kw_i2c_timeout, 0); 517 517 518 518 psteps = of_get_property(np, "AAPL,address-step", NULL); 519 519 steps = psteps ? (*psteps) : 0x10;
+2 -2
arch/s390/kernel/time.c
··· 523 523 } 524 524 } 525 525 526 - static void stp_timeout(unsigned long dummy) 526 + static void stp_timeout(struct timer_list *unused) 527 527 { 528 528 queue_work(time_sync_wq, &stp_work); 529 529 } ··· 532 532 { 533 533 if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags)) 534 534 return 0; 535 - setup_timer(&stp_timer, stp_timeout, 0UL); 535 + timer_setup(&stp_timer, stp_timeout, 0); 536 536 time_init_wq(); 537 537 if (!stp_online) 538 538 return 0;
+3 -5
arch/s390/mm/cmm.c
··· 56 56 57 57 static struct task_struct *cmm_thread_ptr; 58 58 static DECLARE_WAIT_QUEUE_HEAD(cmm_thread_wait); 59 - static DEFINE_TIMER(cmm_timer, NULL); 60 59 61 - static void cmm_timer_fn(unsigned long); 60 + static void cmm_timer_fn(struct timer_list *); 62 61 static void cmm_set_timer(void); 62 + static DEFINE_TIMER(cmm_timer, cmm_timer_fn); 63 63 64 64 static long cmm_alloc_pages(long nr, long *counter, 65 65 struct cmm_page_array **list) ··· 194 194 if (mod_timer(&cmm_timer, jiffies + cmm_timeout_seconds*HZ)) 195 195 return; 196 196 } 197 - cmm_timer.function = cmm_timer_fn; 198 - cmm_timer.data = 0; 199 197 cmm_timer.expires = jiffies + cmm_timeout_seconds*HZ; 200 198 add_timer(&cmm_timer); 201 199 } 202 200 203 - static void cmm_timer_fn(unsigned long ignored) 201 + static void cmm_timer_fn(struct timer_list *unused) 204 202 { 205 203 long nr; 206 204
+3 -3
arch/sh/drivers/heartbeat.c
··· 59 59 } 60 60 } 61 61 62 - static void heartbeat_timer(unsigned long data) 62 + static void heartbeat_timer(struct timer_list *t) 63 63 { 64 - struct heartbeat_data *hd = (struct heartbeat_data *)data; 64 + struct heartbeat_data *hd = from_timer(hd, t, timer); 65 65 static unsigned bit = 0, up = 1; 66 66 67 67 heartbeat_toggle_bit(hd, bit, hd->flags & HEARTBEAT_INVERTED); ··· 133 133 } 134 134 } 135 135 136 - setup_timer(&hd->timer, heartbeat_timer, (unsigned long)hd); 136 + timer_setup(&hd->timer, heartbeat_timer, 0); 137 137 platform_set_drvdata(pdev, hd); 138 138 139 139 return mod_timer(&hd->timer, jiffies + 1);
+6 -10
arch/sh/drivers/pci/common.c
··· 85 85 return cap66 > 0; 86 86 } 87 87 88 - static void pcibios_enable_err(unsigned long __data) 88 + static void pcibios_enable_err(struct timer_list *t) 89 89 { 90 - struct pci_channel *hose = (struct pci_channel *)__data; 90 + struct pci_channel *hose = from_timer(hose, t, err_timer); 91 91 92 92 del_timer(&hose->err_timer); 93 93 printk(KERN_DEBUG "PCI: re-enabling error IRQ.\n"); 94 94 enable_irq(hose->err_irq); 95 95 } 96 96 97 - static void pcibios_enable_serr(unsigned long __data) 97 + static void pcibios_enable_serr(struct timer_list *t) 98 98 { 99 - struct pci_channel *hose = (struct pci_channel *)__data; 99 + struct pci_channel *hose = from_timer(hose, t, serr_timer); 100 100 101 101 del_timer(&hose->serr_timer); 102 102 printk(KERN_DEBUG "PCI: re-enabling system error IRQ.\n"); ··· 106 106 void pcibios_enable_timers(struct pci_channel *hose) 107 107 { 108 108 if (hose->err_irq) { 109 - init_timer(&hose->err_timer); 110 - hose->err_timer.data = (unsigned long)hose; 111 - hose->err_timer.function = pcibios_enable_err; 109 + timer_setup(&hose->err_timer, pcibios_enable_err, 0); 112 110 } 113 111 114 112 if (hose->serr_irq) { 115 - init_timer(&hose->serr_timer); 116 - hose->serr_timer.data = (unsigned long)hose; 117 - hose->serr_timer.function = pcibios_enable_serr; 113 + timer_setup(&hose->serr_timer, pcibios_enable_serr, 0); 118 114 } 119 115 } 120 116
+3 -6
arch/sh/drivers/push-switch.c
··· 26 26 } 27 27 static DEVICE_ATTR(switch, S_IRUGO, switch_show, NULL); 28 28 29 - static void switch_timer(unsigned long data) 29 + static void switch_timer(struct timer_list *t) 30 30 { 31 - struct push_switch *psw = (struct push_switch *)data; 31 + struct push_switch *psw = from_timer(psw, t, debounce); 32 32 33 33 schedule_work(&psw->work); 34 34 } ··· 78 78 } 79 79 80 80 INIT_WORK(&psw->work, switch_work_handler); 81 - init_timer(&psw->debounce); 82 - 83 - psw->debounce.function = switch_timer; 84 - psw->debounce.data = (unsigned long)psw; 81 + timer_setup(&psw->debounce, switch_timer, 0); 85 82 86 83 /* Workqueue API brain-damage */ 87 84 psw->pdev = pdev;
+5 -5
block/blk-core.c
··· 863 863 wake_up_all(&q->mq_freeze_wq); 864 864 } 865 865 866 - static void blk_rq_timed_out_timer(unsigned long data) 866 + static void blk_rq_timed_out_timer(struct timer_list *t) 867 867 { 868 - struct request_queue *q = (struct request_queue *)data; 868 + struct request_queue *q = from_timer(q, t, timeout); 869 869 870 870 kblockd_schedule_work(&q->timeout_work); 871 871 } ··· 901 901 q->backing_dev_info->name = "block"; 902 902 q->node = node_id; 903 903 904 - setup_timer(&q->backing_dev_info->laptop_mode_wb_timer, 905 - laptop_mode_timer_fn, (unsigned long) q); 906 - setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); 904 + timer_setup(&q->backing_dev_info->laptop_mode_wb_timer, 905 + laptop_mode_timer_fn, 0); 906 + timer_setup(&q->timeout, blk_rq_timed_out_timer, 0); 907 907 INIT_WORK(&q->timeout_work, NULL); 908 908 INIT_LIST_HEAD(&q->queue_head); 909 909 INIT_LIST_HEAD(&q->timeout_list);
+3 -3
block/blk-stat.c
··· 79 79 rcu_read_unlock(); 80 80 } 81 81 82 - static void blk_stat_timer_fn(unsigned long data) 82 + static void blk_stat_timer_fn(struct timer_list *t) 83 83 { 84 - struct blk_stat_callback *cb = (void *)data; 84 + struct blk_stat_callback *cb = from_timer(cb, t, timer); 85 85 unsigned int bucket; 86 86 int cpu; 87 87 ··· 130 130 cb->bucket_fn = bucket_fn; 131 131 cb->data = data; 132 132 cb->buckets = buckets; 133 - setup_timer(&cb->timer, blk_stat_timer_fn, (unsigned long)cb); 133 + timer_setup(&cb->timer, blk_stat_timer_fn, 0); 134 134 135 135 return cb; 136 136 }
+4 -5
block/blk-throttle.c
··· 225 225 bool track_bio_latency; 226 226 }; 227 227 228 - static void throtl_pending_timer_fn(unsigned long arg); 228 + static void throtl_pending_timer_fn(struct timer_list *t); 229 229 230 230 static inline struct throtl_grp *pd_to_tg(struct blkg_policy_data *pd) 231 231 { ··· 478 478 INIT_LIST_HEAD(&sq->queued[0]); 479 479 INIT_LIST_HEAD(&sq->queued[1]); 480 480 sq->pending_tree = RB_ROOT; 481 - setup_timer(&sq->pending_timer, throtl_pending_timer_fn, 482 - (unsigned long)sq); 481 + timer_setup(&sq->pending_timer, throtl_pending_timer_fn, 0); 483 482 } 484 483 485 484 static struct blkg_policy_data *throtl_pd_alloc(gfp_t gfp, int node) ··· 1248 1249 * the top-level service_tree is reached, throtl_data->dispatch_work is 1249 1250 * kicked so that the ready bio's are issued. 1250 1251 */ 1251 - static void throtl_pending_timer_fn(unsigned long arg) 1252 + static void throtl_pending_timer_fn(struct timer_list *t) 1252 1253 { 1253 - struct throtl_service_queue *sq = (void *)arg; 1254 + struct throtl_service_queue *sq = from_timer(sq, t, pending_timer); 1254 1255 struct throtl_grp *tg = sq_to_tg(sq); 1255 1256 struct throtl_data *td = sq_to_td(sq); 1256 1257 struct request_queue *q = td->queue;
+4 -5
drivers/atm/ambassador.c
··· 293 293 294 294 */ 295 295 296 - static void do_housekeeping (unsigned long arg); 296 + static void do_housekeeping (struct timer_list *t); 297 297 /********** globals **********/ 298 298 299 299 static unsigned short debug = 0; ··· 1493 1493 }; 1494 1494 1495 1495 /********** housekeeping **********/ 1496 - static void do_housekeeping (unsigned long arg) { 1497 - amb_dev * dev = (amb_dev *) arg; 1496 + static void do_housekeeping (struct timer_list *t) { 1497 + amb_dev * dev = from_timer(dev, t, housekeeping); 1498 1498 1499 1499 // could collect device-specific (not driver/atm-linux) stats here 1500 1500 ··· 2267 2267 dev->atm_dev->ci_range.vpi_bits = NUM_VPI_BITS; 2268 2268 dev->atm_dev->ci_range.vci_bits = NUM_VCI_BITS; 2269 2269 2270 - setup_timer(&dev->housekeeping, do_housekeeping, 2271 - (unsigned long)dev); 2270 + timer_setup(&dev->housekeeping, do_housekeeping, 0); 2272 2271 mod_timer(&dev->housekeeping, jiffies); 2273 2272 2274 2273 // enable host interrupts
+3 -5
drivers/atm/firestream.c
··· 1656 1656 1657 1657 1658 1658 #ifdef FS_POLL_FREQ 1659 - static void fs_poll (unsigned long data) 1659 + static void fs_poll (struct timer_list *t) 1660 1660 { 1661 - struct fs_dev *dev = (struct fs_dev *) data; 1661 + struct fs_dev *dev = from_timer(dev, t, timer); 1662 1662 1663 1663 fs_irq (0, dev); 1664 1664 dev->timer.expires = jiffies + FS_POLL_FREQ; ··· 1885 1885 } 1886 1886 1887 1887 #ifdef FS_POLL_FREQ 1888 - init_timer (&dev->timer); 1889 - dev->timer.data = (unsigned long) dev; 1890 - dev->timer.function = fs_poll; 1888 + timer_setup(&dev->timer, fs_poll, 0); 1891 1889 dev->timer.expires = jiffies + FS_POLL_FREQ; 1892 1890 add_timer (&dev->timer); 1893 1891 #endif
+4 -4
drivers/atm/horizon.c
··· 357 357 358 358 /********** globals **********/ 359 359 360 - static void do_housekeeping (unsigned long arg); 360 + static void do_housekeeping (struct timer_list *t); 361 361 362 362 static unsigned short debug = 0; 363 363 static unsigned short vpi_bits = 0; ··· 1418 1418 1419 1419 /********** housekeeping **********/ 1420 1420 1421 - static void do_housekeeping (unsigned long arg) { 1421 + static void do_housekeeping (struct timer_list *t) { 1422 1422 // just stats at the moment 1423 - hrz_dev * dev = (hrz_dev *) arg; 1423 + hrz_dev * dev = from_timer(dev, t, housekeeping); 1424 1424 1425 1425 // collect device-specific (not driver/atm-linux) stats here 1426 1426 dev->tx_cell_count += rd_regw (dev, TX_CELL_COUNT_OFF); ··· 2796 2796 dev->atm_dev->ci_range.vpi_bits = vpi_bits; 2797 2797 dev->atm_dev->ci_range.vci_bits = 10-vpi_bits; 2798 2798 2799 - setup_timer(&dev->housekeeping, do_housekeeping, (unsigned long) dev); 2799 + timer_setup(&dev->housekeeping, do_housekeeping, 0); 2800 2800 mod_timer(&dev->housekeeping, jiffies); 2801 2801 2802 2802 out:
+4 -4
drivers/atm/idt77105.c
··· 45 45 #define PUT(val,reg) dev->ops->phy_put(dev,val,IDT77105_##reg) 46 46 #define GET(reg) dev->ops->phy_get(dev,IDT77105_##reg) 47 47 48 - static void idt77105_stats_timer_func(unsigned long); 49 - static void idt77105_restart_timer_func(unsigned long); 48 + static void idt77105_stats_timer_func(struct timer_list *); 49 + static void idt77105_restart_timer_func(struct timer_list *); 50 50 51 51 52 52 static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func); ··· 80 80 * a separate copy of the stats allows implementation of 81 81 * an ioctl which gathers the stats *without* zero'ing them. 82 82 */ 83 - static void idt77105_stats_timer_func(unsigned long dummy) 83 + static void idt77105_stats_timer_func(struct timer_list *unused) 84 84 { 85 85 struct idt77105_priv *walk; 86 86 struct atm_dev *dev; ··· 109 109 * interrupts need to be disabled when the cable is pulled out 110 110 * to avoid lots of spurious cell error interrupts. 111 111 */ 112 - static void idt77105_restart_timer_func(unsigned long dummy) 112 + static void idt77105_restart_timer_func(struct timer_list *unused) 113 113 { 114 114 struct idt77105_priv *walk; 115 115 struct atm_dev *dev;
+3 -3
drivers/atm/idt77252.c
··· 1528 1528 1529 1529 1530 1530 static void 1531 - tst_timer(unsigned long data) 1531 + tst_timer(struct timer_list *t) 1532 1532 { 1533 - struct idt77252_dev *card = (struct idt77252_dev *)data; 1533 + struct idt77252_dev *card = from_timer(card, t, tst_timer); 1534 1534 unsigned long base, idle, jump; 1535 1535 unsigned long flags; 1536 1536 u32 pc; ··· 3634 3634 spin_lock_init(&card->cmd_lock); 3635 3635 spin_lock_init(&card->tst_lock); 3636 3636 3637 - setup_timer(&card->tst_timer, tst_timer, (unsigned long)card); 3637 + timer_setup(&card->tst_timer, tst_timer, 0); 3638 3638 3639 3639 /* Do the I/O remapping... */ 3640 3640 card->membase = ioremap(membase, 1024);
+2 -2
drivers/atm/iphase.c
··· 75 75 static IADEV *ia_dev[8]; 76 76 static struct atm_dev *_ia_dev[8]; 77 77 static int iadev_count; 78 - static void ia_led_timer(unsigned long arg); 78 + static void ia_led_timer(struct timer_list *unused); 79 79 static DEFINE_TIMER(ia_timer, ia_led_timer); 80 80 static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ; 81 81 static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ; ··· 2432 2432 return; 2433 2433 } 2434 2434 2435 - static void ia_led_timer(unsigned long arg) { 2435 + static void ia_led_timer(struct timer_list *unused) { 2436 2436 unsigned long flags; 2437 2437 static u_char blinking[8] = {0, 0, 0, 0, 0, 0, 0, 0}; 2438 2438 u_char i;
+3 -5
drivers/atm/lanai.c
··· 1761 1761 } 1762 1762 #endif /* !DEBUG_RW */ 1763 1763 1764 - static void lanai_timed_poll(unsigned long arg) 1764 + static void lanai_timed_poll(struct timer_list *t) 1765 1765 { 1766 - struct lanai_dev *lanai = (struct lanai_dev *) arg; 1766 + struct lanai_dev *lanai = from_timer(lanai, t, timer); 1767 1767 #ifndef DEBUG_RW 1768 1768 unsigned long flags; 1769 1769 #ifdef USE_POWERDOWN ··· 1790 1790 1791 1791 static inline void lanai_timed_poll_start(struct lanai_dev *lanai) 1792 1792 { 1793 - init_timer(&lanai->timer); 1793 + timer_setup(&lanai->timer, lanai_timed_poll, 0); 1794 1794 lanai->timer.expires = jiffies + LANAI_POLL_PERIOD; 1795 - lanai->timer.data = (unsigned long) lanai; 1796 - lanai->timer.function = lanai_timed_poll; 1797 1795 add_timer(&lanai->timer); 1798 1796 } 1799 1797
+3 -5
drivers/atm/nicstar.c
··· 145 145 #ifdef EXTRA_DEBUG 146 146 static void which_list(ns_dev * card, struct sk_buff *skb); 147 147 #endif 148 - static void ns_poll(unsigned long arg); 148 + static void ns_poll(struct timer_list *unused); 149 149 static void ns_phy_put(struct atm_dev *dev, unsigned char value, 150 150 unsigned long addr); 151 151 static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr); ··· 284 284 XPRINTK("nicstar: nicstar_init() returned.\n"); 285 285 286 286 if (!error) { 287 - init_timer(&ns_timer); 287 + timer_setup(&ns_timer, ns_poll, 0); 288 288 ns_timer.expires = jiffies + NS_POLL_PERIOD; 289 - ns_timer.data = 0UL; 290 - ns_timer.function = ns_poll; 291 289 add_timer(&ns_timer); 292 290 } 293 291 ··· 2679 2681 } 2680 2682 #endif /* EXTRA_DEBUG */ 2681 2683 2682 - static void ns_poll(unsigned long arg) 2684 + static void ns_poll(struct timer_list *unused) 2683 2685 { 2684 2686 int i; 2685 2687 ns_dev *card;
+1 -1
drivers/base/power/wakeup.c
··· 481 481 * Use timer struct to check if the given source is initialized 482 482 * by wakeup_source_add. 483 483 */ 484 - return ws->timer.function != (TIMER_FUNC_TYPE)pm_wakeup_timer_fn; 484 + return ws->timer.function != pm_wakeup_timer_fn; 485 485 } 486 486 487 487 /*
+4 -5
drivers/block/DAC960.c
··· 3079 3079 /* 3080 3080 Initialize the Monitoring Timer. 3081 3081 */ 3082 - init_timer(&Controller->MonitoringTimer); 3082 + timer_setup(&Controller->MonitoringTimer, 3083 + DAC960_MonitoringTimerFunction, 0); 3083 3084 Controller->MonitoringTimer.expires = 3084 3085 jiffies + DAC960_MonitoringTimerInterval; 3085 - Controller->MonitoringTimer.data = (unsigned long) Controller; 3086 - Controller->MonitoringTimer.function = DAC960_MonitoringTimerFunction; 3087 3086 add_timer(&Controller->MonitoringTimer); 3088 3087 Controller->ControllerInitialized = true; 3089 3088 return true; ··· 5619 5620 the status of DAC960 Controllers. 5620 5621 */ 5621 5622 5622 - static void DAC960_MonitoringTimerFunction(unsigned long TimerData) 5623 + static void DAC960_MonitoringTimerFunction(struct timer_list *t) 5623 5624 { 5624 - DAC960_Controller_T *Controller = (DAC960_Controller_T *) TimerData; 5625 + DAC960_Controller_T *Controller = from_timer(Controller, t, MonitoringTimer); 5625 5626 DAC960_Command_T *Command; 5626 5627 unsigned long flags; 5627 5628
+1 -1
drivers/block/DAC960.h
··· 4406 4406 static irqreturn_t DAC960_P_InterruptHandler(int, void *); 4407 4407 static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *); 4408 4408 static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *); 4409 - static void DAC960_MonitoringTimerFunction(unsigned long); 4409 + static void DAC960_MonitoringTimerFunction(struct timer_list *); 4410 4410 static void DAC960_Message(DAC960_MessageLevel_T, unsigned char *, 4411 4411 DAC960_Controller_T *, ...); 4412 4412 static void DAC960_CreateProcEntries(DAC960_Controller_T *);
+1 -1
drivers/block/aoe/aoecmd.c
··· 1429 1429 1430 1430 d->rttavg = RTTAVG_INIT; 1431 1431 d->rttdev = RTTDEV_INIT; 1432 - d->timer.function = (TIMER_FUNC_TYPE)rexmit_timer; 1432 + d->timer.function = rexmit_timer; 1433 1433 1434 1434 skb = skb_clone(skb, GFP_ATOMIC); 1435 1435 if (skb) {
+8 -8
drivers/block/ataflop.c
··· 342 342 static void fd_select_side( int side ); 343 343 static void fd_select_drive( int drive ); 344 344 static void fd_deselect( void ); 345 - static void fd_motor_off_timer( unsigned long dummy ); 346 - static void check_change( unsigned long dummy ); 345 + static void fd_motor_off_timer(struct timer_list *unused); 346 + static void check_change(struct timer_list *unused); 347 347 static irqreturn_t floppy_irq (int irq, void *dummy); 348 348 static void fd_error( void ); 349 349 static int do_format(int drive, int type, struct atari_format_descr *desc); ··· 353 353 static void fd_seek( void ); 354 354 static void fd_seek_done( int status ); 355 355 static void fd_rwsec( void ); 356 - static void fd_readtrack_check( unsigned long dummy ); 356 + static void fd_readtrack_check(struct timer_list *unused); 357 357 static void fd_rwsec_done( int status ); 358 358 static void fd_rwsec_done1(int status); 359 359 static void fd_writetrack( void ); 360 360 static void fd_writetrack_done( int status ); 361 - static void fd_times_out( unsigned long dummy ); 361 + static void fd_times_out(struct timer_list *unused); 362 362 static void finish_fdc( void ); 363 363 static void finish_fdc_done( int dummy ); 364 364 static void setup_req_params( int drive ); ··· 479 479 * counts the index signals, which arrive only if one drive is selected. 480 480 */ 481 481 482 - static void fd_motor_off_timer( unsigned long dummy ) 482 + static void fd_motor_off_timer(struct timer_list *unused) 483 483 { 484 484 unsigned char status; 485 485 ··· 515 515 * as possible) and keep track of the current state of the write protection. 516 516 */ 517 517 518 - static void check_change( unsigned long dummy ) 518 + static void check_change(struct timer_list *unused) 519 519 { 520 520 static int drive = 0; 521 521 ··· 966 966 } 967 967 968 968 969 - static void fd_readtrack_check( unsigned long dummy ) 969 + static void fd_readtrack_check(struct timer_list *unused) 970 970 { 971 971 unsigned long flags, addr, addr2; 972 972 ··· 1237 1237 fd_error(); 1238 1238 } 1239 1239 1240 - static void fd_times_out( unsigned long dummy ) 1240 + static void fd_times_out(struct timer_list *unused) 1241 1241 { 1242 1242 atari_disable_irq( IRQ_MFP_FDC ); 1243 1243 if (!FloppyIRQHandler) goto end; /* int occurred after timer was fired, but
+3 -4
drivers/block/rsxx/cregs.c
··· 203 203 return 0; 204 204 } 205 205 206 - static void creg_cmd_timed_out(unsigned long data) 206 + static void creg_cmd_timed_out(struct timer_list *t) 207 207 { 208 - struct rsxx_cardinfo *card = (struct rsxx_cardinfo *) data; 208 + struct rsxx_cardinfo *card = from_timer(card, t, creg_ctrl.cmd_timer); 209 209 struct creg_cmd *cmd; 210 210 211 211 spin_lock(&card->creg_ctrl.lock); ··· 745 745 mutex_init(&card->creg_ctrl.reset_lock); 746 746 INIT_LIST_HEAD(&card->creg_ctrl.queue); 747 747 spin_lock_init(&card->creg_ctrl.lock); 748 - setup_timer(&card->creg_ctrl.cmd_timer, creg_cmd_timed_out, 749 - (unsigned long) card); 748 + timer_setup(&card->creg_ctrl.cmd_timer, creg_cmd_timed_out, 0); 750 749 751 750 return 0; 752 751 }
+3 -4
drivers/block/rsxx/dma.c
··· 354 354 rsxx_complete_dma(ctrl, dma, status); 355 355 } 356 356 357 - static void dma_engine_stalled(unsigned long data) 357 + static void dma_engine_stalled(struct timer_list *t) 358 358 { 359 - struct rsxx_dma_ctrl *ctrl = (struct rsxx_dma_ctrl *)data; 359 + struct rsxx_dma_ctrl *ctrl = from_timer(ctrl, t, activity_timer); 360 360 int cnt; 361 361 362 362 if (atomic_read(&ctrl->stats.hw_q_depth) == 0 || ··· 838 838 mutex_init(&ctrl->work_lock); 839 839 INIT_LIST_HEAD(&ctrl->queue); 840 840 841 - setup_timer(&ctrl->activity_timer, dma_engine_stalled, 842 - (unsigned long)ctrl); 841 + timer_setup(&ctrl->activity_timer, dma_engine_stalled, 0); 843 842 844 843 ctrl->issue_wq = alloc_ordered_workqueue(DRIVER_NAME"_issue", 0); 845 844 if (!ctrl->issue_wq)
+3 -3
drivers/block/skd_main.c
··· 707 707 blk_mq_start_hw_queues(skdev->queue); 708 708 } 709 709 710 - static void skd_timer_tick(ulong arg) 710 + static void skd_timer_tick(struct timer_list *t) 711 711 { 712 - struct skd_device *skdev = (struct skd_device *)arg; 712 + struct skd_device *skdev = from_timer(skdev, t, timer); 713 713 unsigned long reqflags; 714 714 u32 state; 715 715 ··· 857 857 { 858 858 int rc; 859 859 860 - setup_timer(&skdev->timer, skd_timer_tick, (ulong)skdev); 860 + timer_setup(&skdev->timer, skd_timer_tick, 0); 861 861 862 862 rc = mod_timer(&skdev->timer, (jiffies + HZ)); 863 863 if (rc)
+4 -5
drivers/block/sunvdc.c
··· 81 81 82 82 static void vdc_ldc_reset(struct vdc_port *port); 83 83 static void vdc_ldc_reset_work(struct work_struct *work); 84 - static void vdc_ldc_reset_timer(unsigned long _arg); 84 + static void vdc_ldc_reset_timer(struct timer_list *t); 85 85 86 86 static inline struct vdc_port *to_vdc_port(struct vio_driver_state *vio) 87 87 { ··· 974 974 */ 975 975 ldc_timeout = mdesc_get_property(hp, vdev->mp, "vdc-timeout", NULL); 976 976 port->ldc_timeout = ldc_timeout ? *ldc_timeout : 0; 977 - setup_timer(&port->ldc_reset_timer, vdc_ldc_reset_timer, 978 - (unsigned long)port); 977 + timer_setup(&port->ldc_reset_timer, vdc_ldc_reset_timer, 0); 979 978 INIT_WORK(&port->ldc_reset_work, vdc_ldc_reset_work); 980 979 981 980 err = vio_driver_init(&port->vio, vdev, VDEV_DISK, ··· 1086 1087 __blk_end_request_all(req, BLK_STS_IOERR); 1087 1088 } 1088 1089 1089 - static void vdc_ldc_reset_timer(unsigned long _arg) 1090 + static void vdc_ldc_reset_timer(struct timer_list *t) 1090 1091 { 1091 - struct vdc_port *port = (struct vdc_port *) _arg; 1092 + struct vdc_port *port = from_timer(port, t, ldc_reset_timer); 1092 1093 struct vio_driver_state *vio = &port->vio; 1093 1094 unsigned long flags; 1094 1095
+1 -1
drivers/block/swim3.c
··· 397 397 if (fs->timeout_pending) 398 398 del_timer(&fs->timeout); 399 399 fs->timeout.expires = jiffies + nticks; 400 - fs->timeout.function = (TIMER_FUNC_TYPE)proc; 400 + fs->timeout.function = proc; 401 401 add_timer(&fs->timeout); 402 402 fs->timeout_pending = 1; 403 403 }
+2 -3
drivers/block/umem.c
··· 718 718 set_fault_to_battery_status(card); 719 719 } 720 720 721 - static void check_all_batteries(unsigned long ptr) 721 + static void check_all_batteries(struct timer_list *unused) 722 722 { 723 723 int i; 724 724 ··· 738 738 739 739 static void init_battery_timer(void) 740 740 { 741 - init_timer(&battery_timer); 742 - battery_timer.function = check_all_batteries; 741 + timer_setup(&battery_timer, check_all_batteries, 0); 743 742 battery_timer.expires = jiffies + (HZ * 60); 744 743 add_timer(&battery_timer); 745 744 }
+3 -3
drivers/block/xsysace.c
··· 770 770 spin_unlock_irqrestore(&ace->lock, flags); 771 771 } 772 772 773 - static void ace_stall_timer(unsigned long data) 773 + static void ace_stall_timer(struct timer_list *t) 774 774 { 775 - struct ace_device *ace = (void *)data; 775 + struct ace_device *ace = from_timer(ace, t, stall_timer); 776 776 unsigned long flags; 777 777 778 778 dev_warn(ace->dev, ··· 984 984 * Initialize the state machine tasklet and stall timer 985 985 */ 986 986 tasklet_init(&ace->fsm_tasklet, ace_fsm_tasklet, (unsigned long)ace); 987 - setup_timer(&ace->stall_timer, ace_stall_timer, (unsigned long)ace); 987 + timer_setup(&ace->stall_timer, ace_stall_timer, 0); 988 988 989 989 /* 990 990 * Initialize the request queue
+2 -2
drivers/char/dtlk.c
··· 74 74 #endif /* TRACING */ 75 75 76 76 static DEFINE_MUTEX(dtlk_mutex); 77 - static void dtlk_timer_tick(unsigned long data); 77 + static void dtlk_timer_tick(struct timer_list *unused); 78 78 79 79 static int dtlk_major; 80 80 static int dtlk_port_lpc; ··· 259 259 return mask; 260 260 } 261 261 262 - static void dtlk_timer_tick(unsigned long data) 262 + static void dtlk_timer_tick(struct timer_list *unused) 263 263 { 264 264 TRACE_TEXT(" dtlk_timer_tick"); 265 265 wake_up_interruptible(&dtlk_process_list);
+2 -2
drivers/char/hangcheck-timer.c
··· 122 122 /* Last time scheduled */ 123 123 static unsigned long long hangcheck_tsc, hangcheck_tsc_margin; 124 124 125 - static void hangcheck_fire(unsigned long); 125 + static void hangcheck_fire(struct timer_list *); 126 126 127 127 static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire); 128 128 129 - static void hangcheck_fire(unsigned long data) 129 + static void hangcheck_fire(struct timer_list *unused) 130 130 { 131 131 unsigned long long cur_tsc, tsc_diff; 132 132
+3 -4
drivers/char/ipmi/bt-bmc.c
··· 367 367 .unlocked_ioctl = bt_bmc_ioctl, 368 368 }; 369 369 370 - static void poll_timer(unsigned long data) 370 + static void poll_timer(struct timer_list *t) 371 371 { 372 - struct bt_bmc *bt_bmc = (void *)data; 372 + struct bt_bmc *bt_bmc = from_timer(bt_bmc, t, poll_timer); 373 373 374 374 bt_bmc->poll_timer.expires += msecs_to_jiffies(500); 375 375 wake_up(&bt_bmc->queue); ··· 487 487 dev_info(dev, "Using IRQ %d\n", bt_bmc->irq); 488 488 } else { 489 489 dev_info(dev, "No IRQ; using timer\n"); 490 - setup_timer(&bt_bmc->poll_timer, poll_timer, 491 - (unsigned long)bt_bmc); 490 + timer_setup(&bt_bmc->poll_timer, poll_timer, 0); 492 491 bt_bmc->poll_timer.expires = jiffies + msecs_to_jiffies(10); 493 492 add_timer(&bt_bmc->poll_timer); 494 493 }
+2 -2
drivers/char/ipmi/ipmi_msghandler.c
··· 4766 4766 4767 4767 static atomic_t stop_operation; 4768 4768 4769 - static void ipmi_timeout(unsigned long data) 4769 + static void ipmi_timeout(struct timer_list *unused) 4770 4770 { 4771 4771 ipmi_smi_t intf; 4772 4772 int nt = 0; ··· 5172 5172 5173 5173 #endif /* CONFIG_IPMI_PROC_INTERFACE */ 5174 5174 5175 - setup_timer(&ipmi_timer, ipmi_timeout, 0); 5175 + timer_setup(&ipmi_timer, ipmi_timeout, 0); 5176 5176 mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES); 5177 5177 5178 5178 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
+3 -3
drivers/char/ipmi/ipmi_si_intf.c
··· 1091 1091 spin_unlock_irqrestore(&smi_info->si_lock, flags); 1092 1092 } 1093 1093 1094 - static void smi_timeout(unsigned long data) 1094 + static void smi_timeout(struct timer_list *t) 1095 1095 { 1096 - struct smi_info *smi_info = (struct smi_info *) data; 1096 + struct smi_info *smi_info = from_timer(smi_info, t, si_timer); 1097 1097 enum si_sm_result smi_result; 1098 1098 unsigned long flags; 1099 1099 unsigned long jiffies_now; ··· 1166 1166 new_smi->intf = intf; 1167 1167 1168 1168 /* Set up the timer that drives the interface. */ 1169 - setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi); 1169 + timer_setup(&new_smi->si_timer, smi_timeout, 0); 1170 1170 smi_mod_timer(new_smi, jiffies + SI_TIMEOUT_JIFFIES); 1171 1171 1172 1172 /* Try to claim any interrupts. */
+3 -4
drivers/char/ipmi/ipmi_ssif.c
··· 551 551 } 552 552 } 553 553 554 - static void retry_timeout(unsigned long data) 554 + static void retry_timeout(struct timer_list *t) 555 555 { 556 - struct ssif_info *ssif_info = (void *) data; 556 + struct ssif_info *ssif_info = from_timer(ssif_info, t, retry_timer); 557 557 unsigned long oflags, *flags; 558 558 bool waiting; 559 559 ··· 1691 1691 1692 1692 spin_lock_init(&ssif_info->lock); 1693 1693 ssif_info->ssif_state = SSIF_NORMAL; 1694 - setup_timer(&ssif_info->retry_timer, retry_timeout, 1695 - (unsigned long)ssif_info); 1694 + timer_setup(&ssif_info->retry_timer, retry_timeout, 0); 1696 1695 1697 1696 for (i = 0; i < SSIF_NUM_STATS; i++) 1698 1697 atomic_set(&ssif_info->stats[i], 0);
+2 -2
drivers/char/nwbutton.c
··· 23 23 #define __NWBUTTON_C /* Tell the header file who we are */ 24 24 #include "nwbutton.h" 25 25 26 - static void button_sequence_finished (unsigned long parameters); 26 + static void button_sequence_finished(struct timer_list *unused); 27 27 28 28 static int button_press_count; /* The count of button presses */ 29 29 /* Times for the end of a sequence */ ··· 127 127 * any matching registered function callbacks, initiate reboot, etc.). 128 128 */ 129 129 130 - static void button_sequence_finished (unsigned long parameters) 130 + static void button_sequence_finished(struct timer_list *unused) 131 131 { 132 132 if (IS_ENABLED(CONFIG_NWBUTTON_REBOOT) && 133 133 button_press_count == reboot_count)
+1 -1
drivers/char/nwbutton.h
··· 25 25 26 26 /* Function prototypes: */ 27 27 28 - static void button_sequence_finished (unsigned long parameters); 28 + static void button_sequence_finished(struct timer_list *unused); 29 29 static irqreturn_t button_handler (int irq, void *dev_id); 30 30 int button_init (void); 31 31 int button_add_callback (void (*callback) (void), int count);
+2 -2
drivers/char/rtc.c
··· 135 135 static DECLARE_WAIT_QUEUE_HEAD(rtc_wait); 136 136 137 137 #ifdef RTC_IRQ 138 - static void rtc_dropped_irq(unsigned long data); 138 + static void rtc_dropped_irq(struct timer_list *unused); 139 139 140 140 static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq); 141 141 #endif ··· 1171 1171 * for something that requires a steady > 1KHz signal anyways.) 1172 1172 */ 1173 1173 1174 - static void rtc_dropped_irq(unsigned long data) 1174 + static void rtc_dropped_irq(struct timer_list *unused) 1175 1175 { 1176 1176 unsigned long freq; 1177 1177
+3 -4
drivers/char/tpm/tpm-dev-common.c
··· 22 22 #include "tpm.h" 23 23 #include "tpm-dev.h" 24 24 25 - static void user_reader_timeout(unsigned long ptr) 25 + static void user_reader_timeout(struct timer_list *t) 26 26 { 27 - struct file_priv *priv = (struct file_priv *)ptr; 27 + struct file_priv *priv = from_timer(priv, t, user_read_timer); 28 28 29 29 pr_warn("TPM user space timeout is deprecated (pid=%d)\n", 30 30 task_tgid_nr(current)); ··· 48 48 priv->chip = chip; 49 49 atomic_set(&priv->data_pending, 0); 50 50 mutex_init(&priv->buffer_mutex); 51 - setup_timer(&priv->user_read_timer, user_reader_timeout, 52 - (unsigned long)priv); 51 + timer_setup(&priv->user_read_timer, user_reader_timeout, 0); 53 52 INIT_WORK(&priv->work, timeout_work); 54 53 55 54 file->private_data = priv;
+8 -1
drivers/clocksource/timer-of.c
··· 177 177 return ret; 178 178 } 179 179 180 - void timer_of_exit(struct timer_of *to) 180 + /** 181 + * timer_of_cleanup - release timer_of ressources 182 + * @to: timer_of structure 183 + * 184 + * Release the ressources that has been used in timer_of_init(). 185 + * This function should be called in init error cases 186 + */ 187 + void __init timer_of_cleanup(struct timer_of *to) 181 188 { 182 189 if (to->flags & TIMER_OF_IRQ) 183 190 timer_irq_exit(&to->of_irq);
+1 -1
drivers/clocksource/timer-of.h
··· 68 68 extern int __init timer_of_init(struct device_node *np, 69 69 struct timer_of *to); 70 70 71 - extern void timer_of_exit(struct timer_of *to); 71 + extern void __init timer_of_cleanup(struct timer_of *to); 72 72 73 73 #endif
+2 -2
drivers/firmware/psci_checker.c
··· 220 220 return err; 221 221 } 222 222 223 - static void dummy_callback(unsigned long ignored) {} 223 + static void dummy_callback(struct timer_list *unused) {} 224 224 225 225 static int suspend_cpu(int index, bool broadcast) 226 226 { ··· 287 287 pr_info("CPU %d entering suspend cycles, states 1 through %d\n", 288 288 cpu, drv->state_count - 1); 289 289 290 - setup_timer_on_stack(&wakeup_timer, dummy_callback, 0); 290 + timer_setup_on_stack(&wakeup_timer, dummy_callback, 0); 291 291 for (i = 0; i < NUM_SUSPEND_CYCLE; ++i) { 292 292 int index; 293 293 /*
+4 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
··· 268 268 * 269 269 * Checks for fence activity. 270 270 */ 271 - static void amdgpu_fence_fallback(unsigned long arg) 271 + static void amdgpu_fence_fallback(struct timer_list *t) 272 272 { 273 - struct amdgpu_ring *ring = (void *)arg; 273 + struct amdgpu_ring *ring = from_timer(ring, t, 274 + fence_drv.fallback_timer); 274 275 275 276 amdgpu_fence_process(ring); 276 277 } ··· 423 422 atomic_set(&ring->fence_drv.last_seq, 0); 424 423 ring->fence_drv.initialized = false; 425 424 426 - setup_timer(&ring->fence_drv.fallback_timer, amdgpu_fence_fallback, 427 - (unsigned long)ring); 425 + timer_setup(&ring->fence_drv.fallback_timer, amdgpu_fence_fallback, 0); 428 426 429 427 ring->fence_drv.num_fences_mask = num_hw_submission * 2 - 1; 430 428 spin_lock_init(&ring->fence_drv.lock);
+5 -6
drivers/gpu/drm/drm_vblank.c
··· 367 367 spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); 368 368 } 369 369 370 - static void vblank_disable_fn(unsigned long arg) 370 + static void vblank_disable_fn(struct timer_list *t) 371 371 { 372 - struct drm_vblank_crtc *vblank = (void *)arg; 372 + struct drm_vblank_crtc *vblank = from_timer(vblank, t, disable_timer); 373 373 struct drm_device *dev = vblank->dev; 374 374 unsigned int pipe = vblank->pipe; 375 375 unsigned long irqflags; ··· 436 436 vblank->dev = dev; 437 437 vblank->pipe = i; 438 438 init_waitqueue_head(&vblank->queue); 439 - setup_timer(&vblank->disable_timer, vblank_disable_fn, 440 - (unsigned long)vblank); 439 + timer_setup(&vblank->disable_timer, vblank_disable_fn, 0); 441 440 seqlock_init(&vblank->seqlock); 442 441 } 443 442 ··· 1018 1019 if (drm_vblank_offdelay == 0) 1019 1020 return; 1020 1021 else if (drm_vblank_offdelay < 0) 1021 - vblank_disable_fn((unsigned long)vblank); 1022 + vblank_disable_fn(&vblank->disable_timer); 1022 1023 else if (!dev->vblank_disable_immediate) 1023 1024 mod_timer(&vblank->disable_timer, 1024 1025 jiffies + ((drm_vblank_offdelay * HZ)/1000)); ··· 1649 1650 spin_unlock_irqrestore(&dev->event_lock, irqflags); 1650 1651 1651 1652 if (disable_irq) 1652 - vblank_disable_fn((unsigned long)vblank); 1653 + vblank_disable_fn(&vblank->disable_timer); 1653 1654 1654 1655 return true; 1655 1656 }
+3 -3
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 161 161 .atomic_flush = exynos_crtc_handle_event, 162 162 }; 163 163 164 - static void vidi_fake_vblank_timer(unsigned long arg) 164 + static void vidi_fake_vblank_timer(struct timer_list *t) 165 165 { 166 - struct vidi_context *ctx = (void *)arg; 166 + struct vidi_context *ctx = from_timer(ctx, t, timer); 167 167 168 168 if (drm_crtc_handle_vblank(&ctx->crtc->base)) 169 169 mod_timer(&ctx->timer, ··· 449 449 450 450 ctx->pdev = pdev; 451 451 452 - setup_timer(&ctx->timer, vidi_fake_vblank_timer, (unsigned long)ctx); 452 + timer_setup(&ctx->timer, vidi_fake_vblank_timer, 0); 453 453 454 454 mutex_init(&ctx->lock); 455 455
+3 -4
drivers/gpu/drm/i2c/tda998x_drv.c
··· 601 601 * we have seen a HPD inactive->active transition. This code implements 602 602 * that delay. 603 603 */ 604 - static void tda998x_edid_delay_done(unsigned long data) 604 + static void tda998x_edid_delay_done(struct timer_list *t) 605 605 { 606 - struct tda998x_priv *priv = (struct tda998x_priv *)data; 606 + struct tda998x_priv *priv = from_timer(priv, t, edid_delay_timer); 607 607 608 608 priv->edid_delay_active = false; 609 609 wake_up(&priv->edid_delay_waitq); ··· 1492 1492 1493 1493 mutex_init(&priv->mutex); /* protect the page access */ 1494 1494 init_waitqueue_head(&priv->edid_delay_waitq); 1495 - setup_timer(&priv->edid_delay_timer, tda998x_edid_delay_done, 1496 - (unsigned long)priv); 1495 + timer_setup(&priv->edid_delay_timer, tda998x_edid_delay_done, 0); 1497 1496 INIT_WORK(&priv->detect_work, tda998x_detect_work); 1498 1497 1499 1498 /* wake up the device: */
+3 -3
drivers/gpu/drm/i915/selftests/lib_sw_fence.c
··· 49 49 i915_sw_fence_fini(fence); 50 50 } 51 51 52 - static void timed_fence_wake(unsigned long data) 52 + static void timed_fence_wake(struct timer_list *t) 53 53 { 54 - struct timed_fence *tf = (struct timed_fence *)data; 54 + struct timed_fence *tf = from_timer(tf, t, timer); 55 55 56 56 i915_sw_fence_commit(&tf->fence); 57 57 } ··· 60 60 { 61 61 onstack_fence_init(&tf->fence); 62 62 63 - setup_timer_on_stack(&tf->timer, timed_fence_wake, (unsigned long)tf); 63 + timer_setup_on_stack(&tf->timer, timed_fence_wake, 0); 64 64 65 65 if (time_after(expires, jiffies)) 66 66 mod_timer(&tf->timer, expires);
+3 -4
drivers/gpu/drm/msm/adreno/a5xx_preempt.c
··· 82 82 return NULL; 83 83 } 84 84 85 - static void a5xx_preempt_timer(unsigned long data) 85 + static void a5xx_preempt_timer(struct timer_list *t) 86 86 { 87 - struct a5xx_gpu *a5xx_gpu = (struct a5xx_gpu *) data; 87 + struct a5xx_gpu *a5xx_gpu = from_timer(a5xx_gpu, t, preempt_timer); 88 88 struct msm_gpu *gpu = &a5xx_gpu->base.base; 89 89 struct drm_device *dev = gpu->dev; 90 90 struct msm_drm_private *priv = dev->dev_private; ··· 300 300 } 301 301 } 302 302 303 - setup_timer(&a5xx_gpu->preempt_timer, a5xx_preempt_timer, 304 - (unsigned long) a5xx_gpu); 303 + timer_setup(&a5xx_gpu->preempt_timer, a5xx_preempt_timer, 0); 305 304 }
+3 -4
drivers/gpu/drm/msm/msm_gpu.c
··· 353 353 round_jiffies_up(jiffies + DRM_MSM_HANGCHECK_JIFFIES)); 354 354 } 355 355 356 - static void hangcheck_handler(unsigned long data) 356 + static void hangcheck_handler(struct timer_list *t) 357 357 { 358 - struct msm_gpu *gpu = (struct msm_gpu *)data; 358 + struct msm_gpu *gpu = from_timer(gpu, t, hangcheck_timer); 359 359 struct drm_device *dev = gpu->dev; 360 360 struct msm_drm_private *priv = dev->dev_private; 361 361 struct msm_ringbuffer *ring = gpu->funcs->active_ring(gpu); ··· 703 703 INIT_WORK(&gpu->recover_work, recover_worker); 704 704 705 705 706 - setup_timer(&gpu->hangcheck_timer, hangcheck_handler, 707 - (unsigned long)gpu); 706 + timer_setup(&gpu->hangcheck_timer, hangcheck_handler, 0); 708 707 709 708 spin_lock_init(&gpu->perf_lock); 710 709
+2 -4
drivers/gpu/drm/omapdrm/dss/dsi.c
··· 4095 4095 } 4096 4096 4097 4097 #ifdef DSI_CATCH_MISSING_TE 4098 - static void dsi_te_timeout(unsigned long arg) 4098 + static void dsi_te_timeout(struct timer_list *unused) 4099 4099 { 4100 4100 DSSERR("TE not received for 250ms!\n"); 4101 4101 } ··· 5449 5449 dsi_framedone_timeout_work_callback); 5450 5450 5451 5451 #ifdef DSI_CATCH_MISSING_TE 5452 - init_timer(&dsi->te_timer); 5453 - dsi->te_timer.function = dsi_te_timeout; 5454 - dsi->te_timer.data = 0; 5452 + timer_setup(&dsi->te_timer, dsi_te_timeout, 0); 5455 5453 #endif 5456 5454 5457 5455 dsi_mem = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto");
+3 -3
drivers/gpu/drm/rockchip/rockchip_drm_psr.c
··· 101 101 spin_unlock_irqrestore(&psr->lock, flags); 102 102 } 103 103 104 - static void psr_flush_handler(unsigned long data) 104 + static void psr_flush_handler(struct timer_list *t) 105 105 { 106 - struct psr_drv *psr = (struct psr_drv *)data; 106 + struct psr_drv *psr = from_timer(psr, t, flush_timer); 107 107 unsigned long flags; 108 108 109 109 /* If the state has changed since we initiated the flush, do nothing */ ··· 232 232 if (!psr) 233 233 return -ENOMEM; 234 234 235 - setup_timer(&psr->flush_timer, psr_flush_handler, (unsigned long)psr); 235 + timer_setup(&psr->flush_timer, psr_flush_handler, 0); 236 236 spin_lock_init(&psr->lock); 237 237 238 238 psr->active = true;
+3 -6
drivers/gpu/drm/vc4/vc4_bo.c
··· 674 674 mutex_unlock(&bo->madv_lock); 675 675 } 676 676 677 - static void vc4_bo_cache_time_timer(unsigned long data) 677 + static void vc4_bo_cache_time_timer(struct timer_list *t) 678 678 { 679 - struct drm_device *dev = (struct drm_device *)data; 680 - struct vc4_dev *vc4 = to_vc4_dev(dev); 679 + struct vc4_dev *vc4 = from_timer(vc4, t, bo_cache.time_timer); 681 680 682 681 schedule_work(&vc4->bo_cache.time_work); 683 682 } ··· 1038 1039 INIT_LIST_HEAD(&vc4->bo_cache.time_list); 1039 1040 1040 1041 INIT_WORK(&vc4->bo_cache.time_work, vc4_bo_cache_time_work); 1041 - setup_timer(&vc4->bo_cache.time_timer, 1042 - vc4_bo_cache_time_timer, 1043 - (unsigned long)dev); 1042 + timer_setup(&vc4->bo_cache.time_timer, vc4_bo_cache_time_timer, 0); 1044 1043 1045 1044 return 0; 1046 1045 }
+4 -6
drivers/gpu/drm/vc4/vc4_gem.c
··· 312 312 } 313 313 314 314 static void 315 - vc4_hangcheck_elapsed(unsigned long data) 315 + vc4_hangcheck_elapsed(struct timer_list *t) 316 316 { 317 - struct drm_device *dev = (struct drm_device *)data; 318 - struct vc4_dev *vc4 = to_vc4_dev(dev); 317 + struct vc4_dev *vc4 = from_timer(vc4, t, hangcheck.timer); 318 + struct drm_device *dev = vc4->dev; 319 319 uint32_t ct0ca, ct1ca; 320 320 unsigned long irqflags; 321 321 struct vc4_exec_info *bin_exec, *render_exec; ··· 1154 1154 spin_lock_init(&vc4->job_lock); 1155 1155 1156 1156 INIT_WORK(&vc4->hangcheck.reset_work, vc4_reset_work); 1157 - setup_timer(&vc4->hangcheck.timer, 1158 - vc4_hangcheck_elapsed, 1159 - (unsigned long)dev); 1157 + timer_setup(&vc4->hangcheck.timer, vc4_hangcheck_elapsed, 0); 1160 1158 1161 1159 INIT_WORK(&vc4->job_done_work, vc4_job_done_work); 1162 1160
+3 -3
drivers/gpu/drm/vgem/vgem_fence.c
··· 85 85 .timeline_value_str = vgem_fence_timeline_value_str, 86 86 }; 87 87 88 - static void vgem_fence_timeout(unsigned long data) 88 + static void vgem_fence_timeout(struct timer_list *t) 89 89 { 90 - struct vgem_fence *fence = (struct vgem_fence *)data; 90 + struct vgem_fence *fence = from_timer(fence, t, timer); 91 91 92 92 dma_fence_signal(&fence->base); 93 93 } ··· 105 105 dma_fence_init(&fence->base, &vgem_fence_ops, &fence->lock, 106 106 dma_fence_context_alloc(1), 1); 107 107 108 - setup_timer(&fence->timer, vgem_fence_timeout, (unsigned long)fence); 108 + timer_setup(&fence->timer, vgem_fence_timeout, 0); 109 109 110 110 /* We force the fence to expire within 10s to prevent driver hangs */ 111 111 mod_timer(&fence->timer, jiffies + VGEM_FENCE_TIMEOUT);
+3 -4
drivers/gpu/drm/via/via_dmablit.c
··· 452 452 453 453 454 454 static void 455 - via_dmablit_timer(unsigned long data) 455 + via_dmablit_timer(struct timer_list *t) 456 456 { 457 - drm_via_blitq_t *blitq = (drm_via_blitq_t *) data; 457 + drm_via_blitq_t *blitq = from_timer(blitq, t, poll_timer); 458 458 struct drm_device *dev = blitq->dev; 459 459 int engine = (int) 460 460 (blitq - ((drm_via_private_t *)dev->dev_private)->blit_queues); ··· 559 559 init_waitqueue_head(blitq->blit_queue + j); 560 560 init_waitqueue_head(&blitq->busy_queue); 561 561 INIT_WORK(&blitq->wq, via_dmablit_workqueue); 562 - setup_timer(&blitq->poll_timer, via_dmablit_timer, 563 - (unsigned long)blitq); 562 + timer_setup(&blitq->poll_timer, via_dmablit_timer, 0); 564 563 } 565 564 } 566 565
+3 -4
drivers/hid/hid-appleir.c
··· 173 173 dev_err(&appleir->input_dev->dev, "possible flat battery?\n"); 174 174 } 175 175 176 - static void key_up_tick(unsigned long data) 176 + static void key_up_tick(struct timer_list *t) 177 177 { 178 - struct appleir *appleir = (struct appleir *)data; 178 + struct appleir *appleir = from_timer(appleir, t, key_up_timer); 179 179 struct hid_device *hid = appleir->hid; 180 180 unsigned long flags; 181 181 ··· 303 303 hid->quirks |= HID_QUIRK_HIDINPUT_FORCE; 304 304 305 305 spin_lock_init(&appleir->lock); 306 - setup_timer(&appleir->key_up_timer, 307 - key_up_tick, (unsigned long) appleir); 306 + timer_setup(&appleir->key_up_timer, key_up_tick, 0); 308 307 309 308 hid_set_drvdata(hid, appleir); 310 309
+3 -4
drivers/hid/hid-prodikeys.c
··· 239 239 return; 240 240 } 241 241 242 - static void pcmidi_sustained_note_release(unsigned long data) 242 + static void pcmidi_sustained_note_release(struct timer_list *t) 243 243 { 244 - struct pcmidi_sustain *pms = (struct pcmidi_sustain *)data; 244 + struct pcmidi_sustain *pms = from_timer(pms, t, timer); 245 245 246 246 pcmidi_send_note(pms->pm, pms->status, pms->note, pms->velocity); 247 247 pms->in_use = 0; ··· 256 256 pms = &pm->sustained_notes[i]; 257 257 pms->in_use = 0; 258 258 pms->pm = pm; 259 - setup_timer(&pms->timer, pcmidi_sustained_note_release, 260 - (unsigned long)pms); 259 + timer_setup(&pms->timer, pcmidi_sustained_note_release, 0); 261 260 } 262 261 } 263 262
+3 -3
drivers/hid/hid-wiimote-core.c
··· 1226 1226 spin_unlock_irqrestore(&wdata->state.lock, flags); 1227 1227 } 1228 1228 1229 - static void wiimote_init_timeout(unsigned long arg) 1229 + static void wiimote_init_timeout(struct timer_list *t) 1230 1230 { 1231 - struct wiimote_data *wdata = (void*)arg; 1231 + struct wiimote_data *wdata = from_timer(wdata, t, timer); 1232 1232 1233 1233 wiimote_schedule(wdata); 1234 1234 } ··· 1740 1740 wdata->state.cmd_battery = 0xff; 1741 1741 1742 1742 INIT_WORK(&wdata->init_worker, wiimote_init_worker); 1743 - setup_timer(&wdata->timer, wiimote_init_timeout, (long)wdata); 1743 + timer_setup(&wdata->timer, wiimote_init_timeout, 0); 1744 1744 1745 1745 return wdata; 1746 1746 }
+3 -3
drivers/iio/common/ssp_sensors/ssp_dev.c
··· 175 175 data->timeout_cnt = 0; 176 176 } 177 177 178 - static void ssp_wdt_timer_func(unsigned long ptr) 178 + static void ssp_wdt_timer_func(struct timer_list *t) 179 179 { 180 - struct ssp_data *data = (struct ssp_data *)ptr; 180 + struct ssp_data *data = from_timer(data, t, wdt_timer); 181 181 182 182 switch (data->fw_dl_state) { 183 183 case SSP_FW_DL_STATE_FAIL: ··· 571 571 INIT_WORK(&data->work_wdt, ssp_wdt_work_func); 572 572 INIT_DELAYED_WORK(&data->work_refresh, ssp_refresh_task); 573 573 574 - setup_timer(&data->wdt_timer, ssp_wdt_timer_func, (unsigned long)data); 574 + timer_setup(&data->wdt_timer, ssp_wdt_timer_func, 0); 575 575 576 576 ret = request_threaded_irq(data->spi->irq, NULL, 577 577 ssp_irq_thread_fn,
+3 -3
drivers/infiniband/hw/mlx5/mr.c
··· 642 642 return -ENOMEM; 643 643 } 644 644 645 - static void delay_time_func(unsigned long ctx) 645 + static void delay_time_func(struct timer_list *t) 646 646 { 647 - struct mlx5_ib_dev *dev = (struct mlx5_ib_dev *)ctx; 647 + struct mlx5_ib_dev *dev = from_timer(dev, t, delay_timer); 648 648 649 649 dev->fill_delay = 0; 650 650 } ··· 663 663 return -ENOMEM; 664 664 } 665 665 666 - setup_timer(&dev->delay_timer, delay_time_func, (unsigned long)dev); 666 + timer_setup(&dev->delay_timer, delay_time_func, 0); 667 667 for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++) { 668 668 ent = &cache->ent[i]; 669 669 INIT_LIST_HEAD(&ent->head);
+3 -5
drivers/infiniband/hw/mthca/mthca_catas.c
··· 130 130 spin_unlock_irqrestore(&catas_lock, flags); 131 131 } 132 132 133 - static void poll_catas(unsigned long dev_ptr) 133 + static void poll_catas(struct timer_list *t) 134 134 { 135 - struct mthca_dev *dev = (struct mthca_dev *) dev_ptr; 135 + struct mthca_dev *dev = from_timer(dev, t, catas_err.timer); 136 136 int i; 137 137 138 138 for (i = 0; i < dev->catas_err.size; ++i) ··· 149 149 { 150 150 phys_addr_t addr; 151 151 152 - init_timer(&dev->catas_err.timer); 152 + timer_setup(&dev->catas_err.timer, poll_catas, 0); 153 153 dev->catas_err.map = NULL; 154 154 155 155 addr = pci_resource_start(dev->pdev, 0) + ··· 164 164 return; 165 165 } 166 166 167 - dev->catas_err.timer.data = (unsigned long) dev; 168 - dev->catas_err.timer.function = poll_catas; 169 167 dev->catas_err.timer.expires = jiffies + MTHCA_CATAS_POLL_INTERVAL; 170 168 INIT_LIST_HEAD(&dev->catas_err.list); 171 169 add_timer(&dev->catas_err.timer);
+1 -1
drivers/infiniband/hw/nes/nes_verbs.c
··· 3819 3819 if (!nesvnic->event_timer.function) { 3820 3820 ib_dispatch_event(&event); 3821 3821 nesvnic->last_dispatched_event = event.event; 3822 - nesvnic->event_timer.function = (TIMER_FUNC_TYPE)nes_handle_delayed_event; 3822 + nesvnic->event_timer.function = nes_handle_delayed_event; 3823 3823 nesvnic->event_timer.expires = jiffies + NES_EVENT_DELAY; 3824 3824 add_timer(&nesvnic->event_timer); 3825 3825 } else {
+3 -4
drivers/input/gameport/gameport.c
··· 202 202 } 203 203 EXPORT_SYMBOL(gameport_stop_polling); 204 204 205 - static void gameport_run_poll_handler(unsigned long d) 205 + static void gameport_run_poll_handler(struct timer_list *t) 206 206 { 207 - struct gameport *gameport = (struct gameport *)d; 207 + struct gameport *gameport = from_timer(gameport, t, poll_timer); 208 208 209 209 gameport->poll_handler(gameport); 210 210 if (gameport->poll_cnt) ··· 542 542 543 543 INIT_LIST_HEAD(&gameport->node); 544 544 spin_lock_init(&gameport->timer_lock); 545 - setup_timer(&gameport->poll_timer, gameport_run_poll_handler, 546 - (unsigned long)gameport); 545 + timer_setup(&gameport->poll_timer, gameport_run_poll_handler, 0); 547 546 } 548 547 549 548 /*
+1 -1
drivers/input/input.c
··· 2047 2047 */ 2048 2048 void input_enable_softrepeat(struct input_dev *dev, int delay, int period) 2049 2049 { 2050 - dev->timer.function = (TIMER_FUNC_TYPE)input_repeat_key; 2050 + dev->timer.function = input_repeat_key; 2051 2051 dev->rep[REP_DELAY] = delay; 2052 2052 dev->rep[REP_PERIOD] = period; 2053 2053 }
+3 -3
drivers/input/joystick/db9.c
··· 364 364 return 0; 365 365 } 366 366 367 - static void db9_timer(unsigned long private) 367 + static void db9_timer(struct timer_list *t) 368 368 { 369 - struct db9 *db9 = (void *) private; 369 + struct db9 *db9 = from_timer(db9, t, timer); 370 370 struct parport *port = db9->pd->port; 371 371 struct input_dev *dev = db9->dev[0]; 372 372 struct input_dev *dev2 = db9->dev[1]; ··· 609 609 db9->pd = pd; 610 610 db9->mode = mode; 611 611 db9->parportno = pp->number; 612 - setup_timer(&db9->timer, db9_timer, (long)db9); 612 + timer_setup(&db9->timer, db9_timer, 0); 613 613 614 614 for (i = 0; i < (min(db9_mode->n_pads, DB9_MAX_DEVICES)); i++) { 615 615
+3 -3
drivers/input/joystick/gamecon.c
··· 743 743 * gc_timer() initiates reads of console pads data. 744 744 */ 745 745 746 - static void gc_timer(unsigned long private) 746 + static void gc_timer(struct timer_list *t) 747 747 { 748 - struct gc *gc = (void *) private; 748 + struct gc *gc = from_timer(gc, t, timer); 749 749 750 750 /* 751 751 * N64 pads - must be read first, any read confuses them for 200 us ··· 974 974 mutex_init(&gc->mutex); 975 975 gc->pd = pd; 976 976 gc->parportno = pp->number; 977 - setup_timer(&gc->timer, gc_timer, (long) gc); 977 + timer_setup(&gc->timer, gc_timer, 0); 978 978 979 979 for (i = 0; i < n_pads && i < GC_MAX_DEVICES; i++) { 980 980 if (!pads[i])
+3 -3
drivers/input/joystick/turbografx.c
··· 89 89 * tgfx_timer() reads and analyzes TurboGraFX joystick data. 90 90 */ 91 91 92 - static void tgfx_timer(unsigned long private) 92 + static void tgfx_timer(struct timer_list *t) 93 93 { 94 - struct tgfx *tgfx = (void *) private; 94 + struct tgfx *tgfx = from_timer(tgfx, t, timer); 95 95 struct input_dev *dev; 96 96 int data1, data2, i; 97 97 ··· 200 200 mutex_init(&tgfx->sem); 201 201 tgfx->pd = pd; 202 202 tgfx->parportno = pp->number; 203 - setup_timer(&tgfx->timer, tgfx_timer, (long)tgfx); 203 + timer_setup(&tgfx->timer, tgfx_timer, 0); 204 204 205 205 for (i = 0; i < n_devs; i++) { 206 206 if (n_buttons[i] < 1)
+1 -1
drivers/input/touchscreen/s3c2410_ts.c
··· 102 102 !(data1 & S3C2410_ADCDAT0_UPDOWN)); 103 103 } 104 104 105 - static void touch_timer_fire(unsigned long data) 105 + static void touch_timer_fire(struct timer_list *unused) 106 106 { 107 107 unsigned long data0; 108 108 unsigned long data1;
+4 -4
drivers/iommu/iova.c
··· 36 36 static void init_iova_rcaches(struct iova_domain *iovad); 37 37 static void free_iova_rcaches(struct iova_domain *iovad); 38 38 static void fq_destroy_all_entries(struct iova_domain *iovad); 39 - static void fq_flush_timeout(unsigned long data); 39 + static void fq_flush_timeout(struct timer_list *t); 40 40 41 41 void 42 42 init_iova_domain(struct iova_domain *iovad, unsigned long granule, ··· 107 107 spin_lock_init(&fq->lock); 108 108 } 109 109 110 - setup_timer(&iovad->fq_timer, fq_flush_timeout, (unsigned long)iovad); 110 + timer_setup(&iovad->fq_timer, fq_flush_timeout, 0); 111 111 atomic_set(&iovad->fq_timer_on, 0); 112 112 113 113 return 0; ··· 519 519 } 520 520 } 521 521 522 - static void fq_flush_timeout(unsigned long data) 522 + static void fq_flush_timeout(struct timer_list *t) 523 523 { 524 - struct iova_domain *iovad = (struct iova_domain *)data; 524 + struct iova_domain *iovad = from_timer(iovad, t, fq_timer); 525 525 int cpu; 526 526 527 527 atomic_set(&iovad->fq_timer_on, 0);
+3 -3
drivers/isdn/capi/capidrv.c
··· 2235 2235 send_message(card, &cmdcmsg); 2236 2236 } 2237 2237 2238 - static void listentimerfunc(unsigned long x) 2238 + static void listentimerfunc(struct timer_list *t) 2239 2239 { 2240 - capidrv_contr *card = (capidrv_contr *)x; 2240 + capidrv_contr *card = from_timer(card, t, listentimer); 2241 2241 if (card->state != ST_LISTEN_NONE && card->state != ST_LISTEN_ACTIVE) 2242 2242 printk(KERN_ERR "%s: controller dead ??\n", card->name); 2243 2243 send_listen(card); ··· 2264 2264 return -1; 2265 2265 } 2266 2266 card->owner = THIS_MODULE; 2267 - setup_timer(&card->listentimer, listentimerfunc, (unsigned long)card); 2267 + timer_setup(&card->listentimer, listentimerfunc, 0); 2268 2268 strcpy(card->name, id); 2269 2269 card->contrnr = contr; 2270 2270 card->nbchan = profp->nbchannel;
+4 -5
drivers/isdn/divert/isdn_divert.c
··· 55 55 /***************************/ 56 56 /* timer callback function */ 57 57 /***************************/ 58 - static void deflect_timer_expire(ulong arg) 58 + static void deflect_timer_expire(struct timer_list *t) 59 59 { 60 60 unsigned long flags; 61 - struct call_struc *cs = (struct call_struc *) arg; 61 + struct call_struc *cs = from_timer(cs, t, timer); 62 62 63 63 spin_lock_irqsave(&divert_lock, flags); 64 64 del_timer(&cs->timer); /* delete active timer */ ··· 157 157 /* allocate mem for information struct */ 158 158 if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) 159 159 return (-ENOMEM); /* no memory */ 160 - setup_timer(&cs->timer, deflect_timer_expire, (ulong)cs); 160 + timer_setup(&cs->timer, deflect_timer_expire, 0); 161 161 cs->info[0] = '\0'; 162 162 cs->ics.driver = drvid; 163 163 cs->ics.command = ISDN_CMD_PROT_IO; /* protocol specific io */ ··· 450 450 return (0); /* no external deflection needed */ 451 451 if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) 452 452 return (0); /* no memory */ 453 - setup_timer(&cs->timer, deflect_timer_expire, 454 - (ulong)cs); 453 + timer_setup(&cs->timer, deflect_timer_expire, 0); 455 454 cs->info[0] = '\0'; 456 455 457 456 cs->ics = *ic; /* copy incoming data */
+4 -5
drivers/isdn/hardware/eicon/divasi.c
··· 78 78 static int um_idi_open(struct inode *inode, struct file *file); 79 79 static int um_idi_release(struct inode *inode, struct file *file); 80 80 static int remove_entity(void *entity); 81 - static void diva_um_timer_function(unsigned long data); 81 + static void diva_um_timer_function(struct timer_list *t); 82 82 83 83 /* 84 84 * proc entry ··· 300 300 p_os = (diva_um_idi_os_context_t *) diva_um_id_get_os_context(e); 301 301 init_waitqueue_head(&p_os->read_wait); 302 302 init_waitqueue_head(&p_os->close_wait); 303 - setup_timer(&p_os->diva_timer_id, (void *)diva_um_timer_function, 304 - (unsigned long)p_os); 303 + timer_setup(&p_os->diva_timer_id, diva_um_timer_function, 0); 305 304 p_os->aborted = 0; 306 305 p_os->adapter_nr = adapter_nr; 307 306 return (1); ··· 456 457 } 457 458 458 459 static 459 - void diva_um_timer_function(unsigned long data) 460 + void diva_um_timer_function(struct timer_list *t) 460 461 { 461 - diva_um_idi_os_context_t *p_os = (diva_um_idi_os_context_t *) data; 462 + diva_um_idi_os_context_t *p_os = from_timer(p_os, t, diva_timer_id); 462 463 463 464 p_os->aborted = 1; 464 465 wake_up_interruptible(&p_os->read_wait);
+3 -5
drivers/isdn/hardware/mISDN/hfcmulti.c
··· 2855 2855 */ 2856 2856 2857 2857 static void 2858 - hfcmulti_dbusy_timer(struct hfc_multi *hc) 2858 + hfcmulti_dbusy_timer(struct timer_list *t) 2859 2859 { 2860 2860 } 2861 2861 ··· 3877 3877 if (hc->dnum[pt]) { 3878 3878 mode_hfcmulti(hc, dch->slot, dch->dev.D.protocol, 3879 3879 -1, 0, -1, 0); 3880 - setup_timer(&dch->timer, (void *)hfcmulti_dbusy_timer, 3881 - (long)dch); 3880 + timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0); 3882 3881 } 3883 3882 for (i = 1; i <= 31; i++) { 3884 3883 if (!((1 << i) & hc->bmask[pt])) /* skip unused chan */ ··· 3983 3984 hc->chan[i].slot_rx = -1; 3984 3985 hc->chan[i].conf = -1; 3985 3986 mode_hfcmulti(hc, i, dch->dev.D.protocol, -1, 0, -1, 0); 3986 - setup_timer(&dch->timer, (void *)hfcmulti_dbusy_timer, 3987 - (long)dch); 3987 + timer_setup(&dch->timer, hfcmulti_dbusy_timer, 0); 3988 3988 hc->chan[i - 2].slot_tx = -1; 3989 3989 hc->chan[i - 2].slot_rx = -1; 3990 3990 hc->chan[i - 2].conf = -1;
+5 -5
drivers/isdn/hardware/mISDN/hfcpci.c
··· 301 301 * Timer function called when kernel timer expires 302 302 */ 303 303 static void 304 - hfcpci_Timer(struct hfc_pci *hc) 304 + hfcpci_Timer(struct timer_list *t) 305 305 { 306 + struct hfc_pci *hc = from_timer(hc, t, hw.timer); 306 307 hc->hw.timer.expires = jiffies + 75; 307 308 /* WD RESET */ 308 309 /* ··· 1242 1241 * timer callback for D-chan busy resolution. Currently no function 1243 1242 */ 1244 1243 static void 1245 - hfcpci_dbusy_timer(struct hfc_pci *hc) 1244 + hfcpci_dbusy_timer(struct timer_list *t) 1246 1245 { 1247 1246 } 1248 1247 ··· 1718 1717 inithfcpci(struct hfc_pci *hc) 1719 1718 { 1720 1719 printk(KERN_DEBUG "inithfcpci: entered\n"); 1721 - setup_timer(&hc->dch.timer, (void *)hfcpci_dbusy_timer, 1722 - (long)&hc->dch); 1720 + timer_setup(&hc->dch.timer, hfcpci_dbusy_timer, 0); 1723 1721 hc->chanlimit = 2; 1724 1722 mode_hfcpci(&hc->bch[0], 1, -1); 1725 1723 mode_hfcpci(&hc->bch[1], 2, -1); ··· 2043 2043 Write_hfc(hc, HFCPCI_INT_M1, hc->hw.int_m1); 2044 2044 /* At this point the needed PCI config is done */ 2045 2045 /* fifos are still not enabled */ 2046 - setup_timer(&hc->hw.timer, (void *)hfcpci_Timer, (long)hc); 2046 + timer_setup(&hc->hw.timer, hfcpci_Timer, 0); 2047 2047 /* default PCM master */ 2048 2048 test_and_set_bit(HFC_CFG_MASTER, &hc->cfg); 2049 2049 return 0;
+4 -6
drivers/isdn/hardware/mISDN/mISDNisar.c
··· 1146 1146 EXPORT_SYMBOL(mISDNisar_irq); 1147 1147 1148 1148 static void 1149 - ftimer_handler(unsigned long data) 1149 + ftimer_handler(struct timer_list *t) 1150 1150 { 1151 - struct isar_ch *ch = (struct isar_ch *)data; 1151 + struct isar_ch *ch = from_timer(ch, t, ftimer); 1152 1152 1153 1153 pr_debug("%s: ftimer flags %lx\n", ch->is->name, ch->bch.Flags); 1154 1154 test_and_clear_bit(FLG_FTI_RUN, &ch->bch.Flags); ··· 1635 1635 } 1636 1636 if (isar->version != 1) 1637 1637 return -EINVAL; 1638 - setup_timer(&isar->ch[0].ftimer, &ftimer_handler, 1639 - (long)&isar->ch[0]); 1638 + timer_setup(&isar->ch[0].ftimer, ftimer_handler, 0); 1640 1639 test_and_set_bit(FLG_INITIALIZED, &isar->ch[0].bch.Flags); 1641 - setup_timer(&isar->ch[1].ftimer, &ftimer_handler, 1642 - (long)&isar->ch[1]); 1640 + timer_setup(&isar->ch[1].ftimer, ftimer_handler, 0); 1643 1641 test_and_set_bit(FLG_INITIALIZED, &isar->ch[1].bch.Flags); 1644 1642 return 0; 1645 1643 }
+2 -3
drivers/isdn/i4l/isdn_common.c
··· 231 231 static int isdn_timer_cnt3 = 0; 232 232 233 233 static void 234 - isdn_timer_funct(ulong dummy) 234 + isdn_timer_funct(struct timer_list *unused) 235 235 { 236 236 int tf = dev->tflags; 237 237 if (tf & ISDN_TIMER_FAST) { ··· 2294 2294 printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); 2295 2295 return -EIO; 2296 2296 } 2297 - init_timer(&dev->timer); 2298 - dev->timer.function = isdn_timer_funct; 2297 + timer_setup(&dev->timer, isdn_timer_funct, 0); 2299 2298 spin_lock_init(&dev->lock); 2300 2299 spin_lock_init(&dev->timerlock); 2301 2300 #ifdef MODULE
+4 -5
drivers/isdn/i4l/isdn_net.c
··· 1509 1509 1510 1510 /* called via cisco_timer.function */ 1511 1511 static void 1512 - isdn_net_ciscohdlck_slarp_send_keepalive(unsigned long data) 1512 + isdn_net_ciscohdlck_slarp_send_keepalive(struct timer_list *t) 1513 1513 { 1514 - isdn_net_local *lp = (isdn_net_local *) data; 1514 + isdn_net_local *lp = from_timer(lp, t, cisco_timer); 1515 1515 struct sk_buff *skb; 1516 1516 unsigned char *p; 1517 1517 unsigned long last_cisco_myseq = lp->cisco_myseq; ··· 1615 1615 /* send slarp request because interface/seq.no.s reset */ 1616 1616 isdn_net_ciscohdlck_slarp_send_request(lp); 1617 1617 1618 - init_timer(&lp->cisco_timer); 1619 - lp->cisco_timer.data = (unsigned long) lp; 1620 - lp->cisco_timer.function = isdn_net_ciscohdlck_slarp_send_keepalive; 1618 + timer_setup(&lp->cisco_timer, 1619 + isdn_net_ciscohdlck_slarp_send_keepalive, 0); 1621 1620 lp->cisco_timer.expires = jiffies + lp->cisco_keepalive_period * HZ; 1622 1621 add_timer(&lp->cisco_timer); 1623 1622 }
+4 -5
drivers/isdn/i4l/isdn_ppp.c
··· 50 50 static void isdn_ppp_ccp_reset_free(struct ippp_struct *is); 51 51 static void isdn_ppp_ccp_reset_free_state(struct ippp_struct *is, 52 52 unsigned char id); 53 - static void isdn_ppp_ccp_timer_callback(unsigned long closure); 53 + static void isdn_ppp_ccp_timer_callback(struct timer_list *t); 54 54 static struct ippp_ccp_reset_state *isdn_ppp_ccp_reset_alloc_state(struct ippp_struct *is, 55 55 unsigned char id); 56 56 static void isdn_ppp_ccp_reset_trans(struct ippp_struct *is, ··· 2327 2327 2328 2328 /* The timer callback function which is called when a ResetReq has timed out, 2329 2329 aka has never been answered by a ResetAck */ 2330 - static void isdn_ppp_ccp_timer_callback(unsigned long closure) 2330 + static void isdn_ppp_ccp_timer_callback(struct timer_list *t) 2331 2331 { 2332 2332 struct ippp_ccp_reset_state *rs = 2333 - (struct ippp_ccp_reset_state *)closure; 2333 + from_timer(rs, t, timer); 2334 2334 2335 2335 if (!rs) { 2336 2336 printk(KERN_ERR "ippp_ccp: timer cb with zero closure.\n"); ··· 2376 2376 rs->state = CCPResetIdle; 2377 2377 rs->is = is; 2378 2378 rs->id = id; 2379 - setup_timer(&rs->timer, isdn_ppp_ccp_timer_callback, 2380 - (unsigned long)rs); 2379 + timer_setup(&rs->timer, isdn_ppp_ccp_timer_callback, 0); 2381 2380 is->reset->rs[id] = rs; 2382 2381 } 2383 2382 return rs;
+3 -4
drivers/isdn/i4l/isdn_tty.c
··· 541 541 * into the tty's buffer. 542 542 */ 543 543 static void 544 - isdn_tty_modem_do_ncarrier(unsigned long data) 544 + isdn_tty_modem_do_ncarrier(struct timer_list *t) 545 545 { 546 - modem_info *info = (modem_info *) data; 546 + modem_info *info = from_timer(info, t, nc_timer); 547 547 isdn_tty_modem_result(RESULT_NO_CARRIER, info); 548 548 } 549 549 ··· 1812 1812 info->isdn_channel = -1; 1813 1813 info->drv_index = -1; 1814 1814 info->xmit_size = ISDN_SERIAL_XMIT_SIZE; 1815 - setup_timer(&info->nc_timer, isdn_tty_modem_do_ncarrier, 1816 - (unsigned long)info); 1815 + timer_setup(&info->nc_timer, isdn_tty_modem_do_ncarrier, 0); 1817 1816 skb_queue_head_init(&info->xmit_queue); 1818 1817 #ifdef CONFIG_ISDN_AUDIO 1819 1818 skb_queue_head_init(&info->dtmf_queue);
+2 -2
drivers/lightnvm/pblk-core.c
··· 270 270 mod_timer(&pblk->wtimer, jiffies + msecs_to_jiffies(1000)); 271 271 } 272 272 273 - void pblk_write_timer_fn(unsigned long data) 273 + void pblk_write_timer_fn(struct timer_list *t) 274 274 { 275 - struct pblk *pblk = (struct pblk *)data; 275 + struct pblk *pblk = from_timer(pblk, t, wtimer); 276 276 277 277 /* kick the write thread every tick to flush outstanding data */ 278 278 pblk_write_kick(pblk);
+3 -3
drivers/lightnvm/pblk-gc.c
··· 442 442 goto next_gc_group; 443 443 } 444 444 445 - static void pblk_gc_timer(unsigned long data) 445 + static void pblk_gc_timer(struct timer_list *t) 446 446 { 447 - struct pblk *pblk = (struct pblk *)data; 447 + struct pblk *pblk = from_timer(pblk, t, gc.gc_timer); 448 448 449 449 pblk_gc_kick(pblk); 450 450 } ··· 601 601 goto fail_free_writer_kthread; 602 602 } 603 603 604 - setup_timer(&gc->gc_timer, pblk_gc_timer, (unsigned long)pblk); 604 + timer_setup(&gc->gc_timer, pblk_gc_timer, 0); 605 605 mod_timer(&gc->gc_timer, jiffies + msecs_to_jiffies(GC_TIME_MSECS)); 606 606 607 607 gc->gc_active = 0;
+1 -1
drivers/lightnvm/pblk-init.c
··· 866 866 867 867 static int pblk_writer_init(struct pblk *pblk) 868 868 { 869 - setup_timer(&pblk->wtimer, pblk_write_timer_fn, (unsigned long)pblk); 869 + timer_setup(&pblk->wtimer, pblk_write_timer_fn, 0); 870 870 mod_timer(&pblk->wtimer, jiffies + msecs_to_jiffies(100)); 871 871 872 872 pblk->writer_ts = kthread_create(pblk_write_ts, pblk, "pblk-writer-t");
+3 -3
drivers/lightnvm/pblk-rl.c
··· 158 158 return rl->rb_max_io; 159 159 } 160 160 161 - static void pblk_rl_u_timer(unsigned long data) 161 + static void pblk_rl_u_timer(struct timer_list *t) 162 162 { 163 - struct pblk_rl *rl = (struct pblk_rl *)data; 163 + struct pblk_rl *rl = from_timer(rl, t, u_timer); 164 164 165 165 /* Release user I/O state. Protect from GC */ 166 166 smp_store_release(&rl->rb_user_active, 0); ··· 202 202 atomic_set(&rl->rb_gc_cnt, 0); 203 203 atomic_set(&rl->rb_space, -1); 204 204 205 - setup_timer(&rl->u_timer, pblk_rl_u_timer, (unsigned long)rl); 205 + timer_setup(&rl->u_timer, pblk_rl_u_timer, 0); 206 206 207 207 rl->rb_user_active = 0; 208 208 rl->rb_gc_active = 0;
+1 -1
drivers/lightnvm/pblk.h
··· 797 797 * pblk write thread 798 798 */ 799 799 int pblk_write_ts(void *data); 800 - void pblk_write_timer_fn(unsigned long data); 800 + void pblk_write_timer_fn(struct timer_list *t); 801 801 void pblk_write_should_kick(struct pblk *pblk); 802 802 803 803 /*
+3 -3
drivers/lightnvm/rrpc.c
··· 267 267 /* 268 268 * timed GC every interval. 269 269 */ 270 - static void rrpc_gc_timer(unsigned long data) 270 + static void rrpc_gc_timer(struct timer_list *t) 271 271 { 272 - struct rrpc *rrpc = (struct rrpc *)data; 272 + struct rrpc *rrpc = from_timer(rrpc, t, gc_timer); 273 273 274 274 rrpc_gc_kick(rrpc); 275 275 mod_timer(&rrpc->gc_timer, jiffies + msecs_to_jiffies(10)); ··· 1063 1063 if (!rrpc->kgc_wq) 1064 1064 return -ENOMEM; 1065 1065 1066 - setup_timer(&rrpc->gc_timer, rrpc_gc_timer, (unsigned long)rrpc); 1066 + timer_setup(&rrpc->gc_timer, rrpc_gc_timer, 0); 1067 1067 1068 1068 return 0; 1069 1069 }
+1 -1
drivers/media/common/saa7146/saa7146_vbi.c
··· 402 402 sizeof(struct saa7146_buf), 403 403 file, &dev->v4l2_lock); 404 404 405 - vv->vbi_read_timeout.function = (TIMER_FUNC_TYPE)vbi_read_timeout; 405 + vv->vbi_read_timeout.function = vbi_read_timeout; 406 406 vv->vbi_read_timeout_file = file; 407 407 408 408 /* initialize the brs */
+3 -4
drivers/media/platform/fsl-viu.c
··· 339 339 } 340 340 } 341 341 342 - static void viu_vid_timeout(unsigned long data) 342 + static void viu_vid_timeout(struct timer_list *t) 343 343 { 344 - struct viu_dev *dev = (struct viu_dev *)data; 344 + struct viu_dev *dev = from_timer(dev, t, vidq.timeout); 345 345 struct viu_buf *buf; 346 346 struct viu_dmaqueue *vidq = &dev->vidq; 347 347 ··· 1466 1466 viu_dev->decoder = v4l2_i2c_new_subdev(&viu_dev->v4l2_dev, ad, 1467 1467 "saa7113", VIU_VIDEO_DECODER_ADDR, NULL); 1468 1468 1469 - setup_timer(&viu_dev->vidq.timeout, viu_vid_timeout, 1470 - (unsigned long)viu_dev); 1469 + timer_setup(&viu_dev->vidq.timeout, viu_vid_timeout, 0); 1471 1470 viu_dev->std = V4L2_STD_NTSC_M; 1472 1471 viu_dev->first = 1; 1473 1472
+3 -5
drivers/media/platform/s5p-mfc/s5p_mfc.c
··· 145 145 } 146 146 } 147 147 148 - static void s5p_mfc_watchdog(unsigned long arg) 148 + static void s5p_mfc_watchdog(struct timer_list *t) 149 149 { 150 - struct s5p_mfc_dev *dev = (struct s5p_mfc_dev *)arg; 150 + struct s5p_mfc_dev *dev = from_timer(dev, t, watchdog_timer); 151 151 152 152 if (test_bit(0, &dev->hw_lock)) 153 153 atomic_inc(&dev->watchdog_cnt); ··· 1314 1314 dev->hw_lock = 0; 1315 1315 INIT_WORK(&dev->watchdog_work, s5p_mfc_watchdog_worker); 1316 1316 atomic_set(&dev->watchdog_cnt, 0); 1317 - init_timer(&dev->watchdog_timer); 1318 - dev->watchdog_timer.data = (unsigned long)dev; 1319 - dev->watchdog_timer.function = s5p_mfc_watchdog; 1317 + timer_setup(&dev->watchdog_timer, s5p_mfc_watchdog, 0); 1320 1318 1321 1319 ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev); 1322 1320 if (ret)
+3 -4
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
··· 61 61 62 62 #define FIFO_LEN 1024 63 63 64 - static void c8sectpfe_timer_interrupt(unsigned long ac8sectpfei) 64 + static void c8sectpfe_timer_interrupt(struct timer_list *t) 65 65 { 66 - struct c8sectpfei *fei = (struct c8sectpfei *)ac8sectpfei; 66 + struct c8sectpfei *fei = from_timer(fei, t, timer); 67 67 struct channel_info *channel; 68 68 int chan_num; 69 69 ··· 865 865 } 866 866 867 867 /* Setup timer interrupt */ 868 - setup_timer(&fei->timer, c8sectpfe_timer_interrupt, 869 - (unsigned long)fei); 868 + timer_setup(&fei->timer, c8sectpfe_timer_interrupt, 0); 870 869 871 870 mutex_init(&fei->lock); 872 871
+3 -3
drivers/media/platform/vim2m.c
··· 388 388 schedule_irq(dev, ctx->transtime); 389 389 } 390 390 391 - static void device_isr(unsigned long priv) 391 + static void device_isr(struct timer_list *t) 392 392 { 393 - struct vim2m_dev *vim2m_dev = (struct vim2m_dev *)priv; 393 + struct vim2m_dev *vim2m_dev = from_timer(vim2m_dev, t, timer); 394 394 struct vim2m_ctx *curr_ctx; 395 395 struct vb2_v4l2_buffer *src_vb, *dst_vb; 396 396 unsigned long flags; ··· 1024 1024 v4l2_info(&dev->v4l2_dev, 1025 1025 "Device registered as /dev/video%d\n", vfd->num); 1026 1026 1027 - setup_timer(&dev->timer, device_isr, (long)dev); 1027 + timer_setup(&dev->timer, device_isr, 0); 1028 1028 platform_set_drvdata(pdev, dev); 1029 1029 1030 1030 dev->m2m_dev = v4l2_m2m_init(&m2m_ops);
+3 -5
drivers/media/usb/au0828/au0828-dvb.c
··· 105 105 106 106 static void au0828_restart_dvb_streaming(struct work_struct *work); 107 107 108 - static void au0828_bulk_timeout(unsigned long data) 108 + static void au0828_bulk_timeout(struct timer_list *t) 109 109 { 110 - struct au0828_dev *dev = (struct au0828_dev *) data; 110 + struct au0828_dev *dev = from_timer(dev, t, bulk_timeout); 111 111 112 112 dprintk(1, "%s called\n", __func__); 113 113 dev->bulk_timeout_running = 0; ··· 648 648 return ret; 649 649 } 650 650 651 - dev->bulk_timeout.function = au0828_bulk_timeout; 652 - dev->bulk_timeout.data = (unsigned long) dev; 653 - init_timer(&dev->bulk_timeout); 651 + timer_setup(&dev->bulk_timeout, au0828_bulk_timeout, 0); 654 652 655 653 return 0; 656 654 }
+6 -8
drivers/media/usb/au0828/au0828-video.c
··· 954 954 /* This function ensures that video frames continue to be delivered even if 955 955 the ITU-656 input isn't receiving any data (thereby preventing applications 956 956 such as tvtime from hanging) */ 957 - static void au0828_vid_buffer_timeout(unsigned long data) 957 + static void au0828_vid_buffer_timeout(struct timer_list *t) 958 958 { 959 - struct au0828_dev *dev = (struct au0828_dev *) data; 959 + struct au0828_dev *dev = from_timer(dev, t, vid_timeout); 960 960 struct au0828_dmaqueue *dma_q = &dev->vidq; 961 961 struct au0828_buffer *buf; 962 962 unsigned char *vid_data; ··· 978 978 spin_unlock_irqrestore(&dev->slock, flags); 979 979 } 980 980 981 - static void au0828_vbi_buffer_timeout(unsigned long data) 981 + static void au0828_vbi_buffer_timeout(struct timer_list *t) 982 982 { 983 - struct au0828_dev *dev = (struct au0828_dev *) data; 983 + struct au0828_dev *dev = from_timer(dev, t, vbi_timeout); 984 984 struct au0828_dmaqueue *dma_q = &dev->vbiq; 985 985 struct au0828_buffer *buf; 986 986 unsigned char *vbi_data; ··· 1953 1953 INIT_LIST_HEAD(&dev->vidq.active); 1954 1954 INIT_LIST_HEAD(&dev->vbiq.active); 1955 1955 1956 - setup_timer(&dev->vid_timeout, au0828_vid_buffer_timeout, 1957 - (unsigned long)dev); 1958 - setup_timer(&dev->vbi_timeout, au0828_vbi_buffer_timeout, 1959 - (unsigned long)dev); 1956 + timer_setup(&dev->vid_timeout, au0828_vid_buffer_timeout, 0); 1957 + timer_setup(&dev->vbi_timeout, au0828_vbi_buffer_timeout, 0); 1960 1958 1961 1959 dev->width = NTSC_STD_W; 1962 1960 dev->height = NTSC_STD_H;
+3 -4
drivers/memstick/core/ms_block.c
··· 1492 1492 return 0; 1493 1493 } 1494 1494 1495 - static void msb_cache_flush_timer(unsigned long data) 1495 + static void msb_cache_flush_timer(struct timer_list *t) 1496 1496 { 1497 - struct msb_data *msb = (struct msb_data *)data; 1497 + struct msb_data *msb = from_timer(msb, t, cache_flush_timer); 1498 1498 msb->need_flush_cache = true; 1499 1499 queue_work(msb->io_queue, &msb->io_work); 1500 1500 } ··· 1514 1514 1515 1515 static int msb_cache_init(struct msb_data *msb) 1516 1516 { 1517 - setup_timer(&msb->cache_flush_timer, msb_cache_flush_timer, 1518 - (unsigned long)msb); 1517 + timer_setup(&msb->cache_flush_timer, msb_cache_flush_timer, 0); 1519 1518 1520 1519 if (!msb->cache) 1521 1520 msb->cache = kzalloc(msb->block_size, GFP_KERNEL);
+3 -3
drivers/mfd/rtsx_usb.c
··· 40 40 }, 41 41 }; 42 42 43 - static void rtsx_usb_sg_timed_out(unsigned long data) 43 + static void rtsx_usb_sg_timed_out(struct timer_list *t) 44 44 { 45 - struct rtsx_ucr *ucr = (struct rtsx_ucr *)data; 45 + struct rtsx_ucr *ucr = from_timer(ucr, t, sg_timer); 46 46 47 47 dev_dbg(&ucr->pusb_intf->dev, "%s: sg transfer timed out", __func__); 48 48 usb_sg_cancel(&ucr->current_sg); ··· 663 663 goto out_init_fail; 664 664 665 665 /* initialize USB SG transfer timer */ 666 - setup_timer(&ucr->sg_timer, rtsx_usb_sg_timed_out, (unsigned long) ucr); 666 + timer_setup(&ucr->sg_timer, rtsx_usb_sg_timed_out, 0); 667 667 668 668 ret = mfd_add_hotplug_devices(&intf->dev, rtsx_usb_cells, 669 669 ARRAY_SIZE(rtsx_usb_cells));
+3 -3
drivers/mmc/core/host.c
··· 160 160 return err; 161 161 } 162 162 163 - static void mmc_retune_timer(unsigned long data) 163 + static void mmc_retune_timer(struct timer_list *t) 164 164 { 165 - struct mmc_host *host = (struct mmc_host *)data; 165 + struct mmc_host *host = from_timer(host, t, retune_timer); 166 166 167 167 mmc_retune_needed(host); 168 168 } ··· 389 389 init_waitqueue_head(&host->wq); 390 390 INIT_DELAYED_WORK(&host->detect, mmc_rescan); 391 391 INIT_DELAYED_WORK(&host->sdio_irq_work, sdio_irq_work); 392 - setup_timer(&host->retune_timer, mmc_retune_timer, (unsigned long)host); 392 + timer_setup(&host->retune_timer, mmc_retune_timer, 0); 393 393 394 394 /* 395 395 * By default, hosts do not support SGIO or large requests.
+3 -3
drivers/mtd/sm_ftl.c
··· 989 989 990 990 991 991 /* flush timer, runs a second after last write */ 992 - static void sm_cache_flush_timer(unsigned long data) 992 + static void sm_cache_flush_timer(struct timer_list *t) 993 993 { 994 - struct sm_ftl *ftl = (struct sm_ftl *)data; 994 + struct sm_ftl *ftl = from_timer(ftl, t, timer); 995 995 queue_work(cache_flush_workqueue, &ftl->flush_work); 996 996 } 997 997 ··· 1139 1139 1140 1140 1141 1141 mutex_init(&ftl->mutex); 1142 - setup_timer(&ftl->timer, sm_cache_flush_timer, (unsigned long)ftl); 1142 + timer_setup(&ftl->timer, sm_cache_flush_timer, 0); 1143 1143 INIT_WORK(&ftl->flush_work, sm_cache_flush_work); 1144 1144 init_completion(&ftl->erase_completion); 1145 1145
+9 -12
drivers/net/caif/caif_hsi.c
··· 66 66 67 67 static LIST_HEAD(cfhsi_list); 68 68 69 - static void cfhsi_inactivity_tout(unsigned long arg) 69 + static void cfhsi_inactivity_tout(struct timer_list *t) 70 70 { 71 - struct cfhsi *cfhsi = (struct cfhsi *)arg; 71 + struct cfhsi *cfhsi = from_timer(cfhsi, t, inactivity_timer); 72 72 73 73 netdev_dbg(cfhsi->ndev, "%s.\n", 74 74 __func__); ··· 737 737 schedule_work(&cfhsi->out_of_sync_work); 738 738 } 739 739 740 - static void cfhsi_rx_slowpath(unsigned long arg) 740 + static void cfhsi_rx_slowpath(struct timer_list *t) 741 741 { 742 - struct cfhsi *cfhsi = (struct cfhsi *)arg; 742 + struct cfhsi *cfhsi = from_timer(cfhsi, t, rx_slowpath_timer); 743 743 744 744 netdev_dbg(cfhsi->ndev, "%s.\n", 745 745 __func__); ··· 997 997 wake_up_interruptible(&cfhsi->wake_down_wait); 998 998 } 999 999 1000 - static void cfhsi_aggregation_tout(unsigned long arg) 1000 + static void cfhsi_aggregation_tout(struct timer_list *t) 1001 1001 { 1002 - struct cfhsi *cfhsi = (struct cfhsi *)arg; 1002 + struct cfhsi *cfhsi = from_timer(cfhsi, t, aggregation_timer); 1003 1003 1004 1004 netdev_dbg(cfhsi->ndev, "%s.\n", 1005 1005 __func__); ··· 1211 1211 init_waitqueue_head(&cfhsi->flush_fifo_wait); 1212 1212 1213 1213 /* Setup the inactivity timer. */ 1214 - setup_timer(&cfhsi->inactivity_timer, cfhsi_inactivity_tout, 1215 - (unsigned long)cfhsi); 1214 + timer_setup(&cfhsi->inactivity_timer, cfhsi_inactivity_tout, 0); 1216 1215 /* Setup the slowpath RX timer. */ 1217 - setup_timer(&cfhsi->rx_slowpath_timer, cfhsi_rx_slowpath, 1218 - (unsigned long)cfhsi); 1216 + timer_setup(&cfhsi->rx_slowpath_timer, cfhsi_rx_slowpath, 0); 1219 1217 /* Setup the aggregation timer. */ 1220 - setup_timer(&cfhsi->aggregation_timer, cfhsi_aggregation_tout, 1221 - (unsigned long)cfhsi); 1218 + timer_setup(&cfhsi->aggregation_timer, cfhsi_aggregation_tout, 0); 1222 1219 1223 1220 /* Activate HSI interface. */ 1224 1221 res = cfhsi->ops->cfhsi_up(cfhsi->ops);
+17 -19
drivers/net/cris/eth_v10.c
··· 165 165 166 166 static unsigned int network_tr_ctrl_shadow = 0; 167 167 168 + /* Timers */ 169 + static void e100_check_speed(struct timer_list *unused); 170 + static void e100_clear_network_leds(struct timer_list *unused); 171 + static void e100_check_duplex(struct timer_list *unused); 172 + static DEFINE_TIMER(speed_timer, e100_check_speed); 173 + static DEFINE_TIMER(clear_led_timer, e100_clear_network_leds); 174 + static DEFINE_TIMER(duplex_timer, e100_check_duplex); 175 + static struct net_device *timer_dev; 176 + 168 177 /* Network speed indication. */ 169 - static DEFINE_TIMER(speed_timer, NULL); 170 - static DEFINE_TIMER(clear_led_timer, NULL); 171 178 static int current_speed; /* Speed read from transceiver */ 172 179 static int current_speed_selection; /* Speed selected by user */ 173 180 static unsigned long led_next_time; ··· 182 175 static int rx_queue_len; 183 176 184 177 /* Duplex */ 185 - static DEFINE_TIMER(duplex_timer, NULL); 186 178 static int full_duplex; 187 179 static enum duplex current_duplex; 188 180 ··· 206 200 static void update_tx_stats(struct net_device_stats *); 207 201 static int e100_probe_transceiver(struct net_device* dev); 208 202 209 - static void e100_check_speed(unsigned long priv); 210 203 static void e100_set_speed(struct net_device* dev, unsigned long speed); 211 - static void e100_check_duplex(unsigned long priv); 212 204 static void e100_set_duplex(struct net_device* dev, enum duplex); 213 205 static void e100_negotiate(struct net_device* dev); 214 206 ··· 218 214 static unsigned char e100_receive_mdio_bit(void); 219 215 static void e100_reset_transceiver(struct net_device* net); 220 216 221 - static void e100_clear_network_leds(unsigned long dummy); 222 217 static void e100_set_network_leds(int active); 223 218 224 219 static const struct ethtool_ops e100_ethtool_ops; ··· 384 381 current_speed = 10; 385 382 current_speed_selection = 0; /* Auto */ 386 383 speed_timer.expires = jiffies + NET_LINK_UP_CHECK_INTERVAL; 387 - speed_timer.data = (unsigned long)dev; 388 - speed_timer.function = e100_check_speed; 389 - 390 - clear_led_timer.function = e100_clear_network_leds; 391 - clear_led_timer.data = (unsigned long)dev; 392 384 393 385 full_duplex = 0; 394 386 current_duplex = autoneg; 395 387 duplex_timer.expires = jiffies + NET_DUPLEX_CHECK_INTERVAL; 396 - duplex_timer.data = (unsigned long)dev; 397 - duplex_timer.function = e100_check_duplex; 388 + 389 + timer_dev = dev; 398 390 399 391 /* Initialize mii interface */ 400 392 np->mii_if.phy_id_mask = 0x1f; ··· 678 680 } 679 681 #endif 680 682 static void 681 - e100_check_speed(unsigned long priv) 683 + e100_check_speed(struct timer_list *unused) 682 684 { 683 - struct net_device* dev = (struct net_device*)priv; 685 + struct net_device* dev = timer_dev; 684 686 struct net_local *np = netdev_priv(dev); 685 687 static int led_initiated = 0; 686 688 unsigned long data; ··· 797 799 } 798 800 799 801 static void 800 - e100_check_duplex(unsigned long priv) 802 + e100_check_duplex(struct timer_list *unused) 801 803 { 802 - struct net_device *dev = (struct net_device *)priv; 804 + struct net_device *dev = timer_dev; 803 805 struct net_local *np = netdev_priv(dev); 804 806 int old_duplex; 805 807 ··· 1667 1669 } 1668 1670 1669 1671 static void 1670 - e100_clear_network_leds(unsigned long dummy) 1672 + e100_clear_network_leds(struct timer_list *unused) 1671 1673 { 1672 - struct net_device *dev = (struct net_device *)dummy; 1674 + struct net_device *dev = timer_dev; 1673 1675 struct net_local *np = netdev_priv(dev); 1674 1676 1675 1677 spin_lock(&np->led_lock);
+3 -4
drivers/net/dsa/mv88e6xxx/phy.c
··· 149 149 mutex_unlock(&chip->reg_lock); 150 150 } 151 151 152 - static void mv88e6xxx_phy_ppu_reenable_timer(unsigned long _ps) 152 + static void mv88e6xxx_phy_ppu_reenable_timer(struct timer_list *t) 153 153 { 154 - struct mv88e6xxx_chip *chip = (void *)_ps; 154 + struct mv88e6xxx_chip *chip = from_timer(chip, t, ppu_timer); 155 155 156 156 schedule_work(&chip->ppu_work); 157 157 } ··· 193 193 { 194 194 mutex_init(&chip->ppu_mutex); 195 195 INIT_WORK(&chip->ppu_work, mv88e6xxx_phy_ppu_reenable_work); 196 - setup_timer(&chip->ppu_timer, mv88e6xxx_phy_ppu_reenable_timer, 197 - (unsigned long)chip); 196 + timer_setup(&chip->ppu_timer, mv88e6xxx_phy_ppu_reenable_timer, 0); 198 197 } 199 198 200 199 static void mv88e6xxx_phy_ppu_state_destroy(struct mv88e6xxx_chip *chip)
+3 -3
drivers/net/eql.c
··· 139 139 140 140 static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave); 141 141 142 - static void eql_timer(unsigned long param) 142 + static void eql_timer(struct timer_list *t) 143 143 { 144 - equalizer_t *eql = (equalizer_t *) param; 144 + equalizer_t *eql = from_timer(eql, t, timer); 145 145 struct list_head *this, *tmp, *head; 146 146 147 147 spin_lock(&eql->queue.lock); ··· 178 178 { 179 179 equalizer_t *eql = netdev_priv(dev); 180 180 181 - setup_timer(&eql->timer, eql_timer, (unsigned long)eql); 181 + timer_setup(&eql->timer, eql_timer, 0); 182 182 eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL; 183 183 184 184 spin_lock_init(&eql->queue.lock);
+5 -4
drivers/net/ethernet/adi/bfin_mac.c
··· 1092 1092 return; 1093 1093 } 1094 1094 1095 - static void tx_reclaim_skb_timeout(unsigned long lp) 1095 + static void tx_reclaim_skb_timeout(struct timer_list *t) 1096 1096 { 1097 - tx_reclaim_skb((struct bfin_mac_local *)lp); 1097 + struct bfin_mac_local *lp = from_timer(lp, t, tx_reclaim_timer); 1098 + 1099 + tx_reclaim_skb(lp); 1098 1100 } 1099 1101 1100 1102 static int bfin_mac_hard_start_xmit(struct sk_buff *skb, ··· 1652 1650 ndev->netdev_ops = &bfin_mac_netdev_ops; 1653 1651 ndev->ethtool_ops = &bfin_mac_ethtool_ops; 1654 1652 1655 - setup_timer(&lp->tx_reclaim_timer, tx_reclaim_skb_timeout, 1656 - (unsigned long)lp); 1653 + timer_setup(&lp->tx_reclaim_timer, tx_reclaim_skb_timeout, 0); 1657 1654 1658 1655 lp->flags = 0; 1659 1656 netif_napi_add(ndev, &lp->napi, bfin_mac_poll, CONFIG_BFIN_RX_DESC_NUM);
+3 -4
drivers/net/ethernet/agere/et131x.c
··· 3080 3080 * The routine called when the error timer expires, to track the number of 3081 3081 * recurring errors. 3082 3082 */ 3083 - static void et131x_error_timer_handler(unsigned long data) 3083 + static void et131x_error_timer_handler(struct timer_list *t) 3084 3084 { 3085 - struct et131x_adapter *adapter = (struct et131x_adapter *)data; 3085 + struct et131x_adapter *adapter = from_timer(adapter, t, error_timer); 3086 3086 struct phy_device *phydev = adapter->netdev->phydev; 3087 3087 3088 3088 if (et1310_in_phy_coma(adapter)) { ··· 3624 3624 int result; 3625 3625 3626 3626 /* Start the timer to track NIC errors */ 3627 - setup_timer(&adapter->error_timer, et131x_error_timer_handler, 3628 - (unsigned long)adapter); 3627 + timer_setup(&adapter->error_timer, et131x_error_timer_handler, 0); 3629 3628 adapter->error_timer.expires = jiffies + 3630 3629 msecs_to_jiffies(TX_ERROR_PERIOD); 3631 3630 add_timer(&adapter->error_timer);
+3 -4
drivers/net/ethernet/amazon/ena/ena_netdev.c
··· 2859 2859 (netdev->features & GENMASK_ULL(63, 32)) >> 32; 2860 2860 } 2861 2861 2862 - static void ena_timer_service(unsigned long data) 2862 + static void ena_timer_service(struct timer_list *t) 2863 2863 { 2864 - struct ena_adapter *adapter = (struct ena_adapter *)data; 2864 + struct ena_adapter *adapter = from_timer(adapter, t, timer_service); 2865 2865 u8 *debug_area = adapter->ena_dev->host_attr.debug_area_virt_addr; 2866 2866 struct ena_admin_host_info *host_info = 2867 2867 adapter->ena_dev->host_attr.host_info; ··· 3278 3278 3279 3279 ena_update_hints(adapter, &get_feat_ctx.hw_hints); 3280 3280 3281 - setup_timer(&adapter->timer_service, ena_timer_service, 3282 - (unsigned long)adapter); 3281 + timer_setup(&adapter->timer_service, ena_timer_service, 0); 3283 3282 mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); 3284 3283 3285 3284 dev_info(&pdev->dev, "%s found at mem %lx, mac addr %pM Queues %d\n",
+6 -8
drivers/net/ethernet/aquantia/atlantic/aq_nic.c
··· 163 163 return 0; 164 164 } 165 165 166 - static void aq_nic_service_timer_cb(unsigned long param) 166 + static void aq_nic_service_timer_cb(struct timer_list *t) 167 167 { 168 - struct aq_nic_s *self = (struct aq_nic_s *)param; 168 + struct aq_nic_s *self = from_timer(self, t, service_timer); 169 169 struct net_device *ndev = aq_nic_get_ndev(self); 170 170 int err = 0; 171 171 unsigned int i = 0U; ··· 201 201 jiffies + AQ_CFG_SERVICE_TIMER_INTERVAL); 202 202 } 203 203 204 - static void aq_nic_polling_timer_cb(unsigned long param) 204 + static void aq_nic_polling_timer_cb(struct timer_list *t) 205 205 { 206 - struct aq_nic_s *self = (struct aq_nic_s *)param; 206 + struct aq_nic_s *self = from_timer(self, t, polling_timer); 207 207 struct aq_vec_s *aq_vec = NULL; 208 208 unsigned int i = 0U; 209 209 ··· 440 440 err = aq_nic_update_interrupt_moderation_settings(self); 441 441 if (err) 442 442 goto err_exit; 443 - setup_timer(&self->service_timer, &aq_nic_service_timer_cb, 444 - (unsigned long)self); 443 + timer_setup(&self->service_timer, aq_nic_service_timer_cb, 0); 445 444 mod_timer(&self->service_timer, jiffies + 446 445 AQ_CFG_SERVICE_TIMER_INTERVAL); 447 446 448 447 if (self->aq_nic_cfg.is_polling) { 449 - setup_timer(&self->polling_timer, &aq_nic_polling_timer_cb, 450 - (unsigned long)self); 448 + timer_setup(&self->polling_timer, aq_nic_polling_timer_cb, 0); 451 449 mod_timer(&self->polling_timer, jiffies + 452 450 AQ_CFG_POLLING_TIMER_INTERVAL); 453 451 } else {
+4 -4
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
··· 222 222 * atl1c_phy_config - Timer Call-back 223 223 * @data: pointer to netdev cast into an unsigned long 224 224 */ 225 - static void atl1c_phy_config(unsigned long data) 225 + static void atl1c_phy_config(struct timer_list *t) 226 226 { 227 - struct atl1c_adapter *adapter = (struct atl1c_adapter *) data; 227 + struct atl1c_adapter *adapter = from_timer(adapter, t, 228 + phy_config_timer); 228 229 struct atl1c_hw *hw = &adapter->hw; 229 230 unsigned long flags; 230 231 ··· 2614 2613 adapter->mii.phy_id_mask = 0x1f; 2615 2614 adapter->mii.reg_num_mask = MDIO_CTRL_REG_MASK; 2616 2615 netif_napi_add(netdev, &adapter->napi, atl1c_clean, 64); 2617 - setup_timer(&adapter->phy_config_timer, atl1c_phy_config, 2618 - (unsigned long)adapter); 2616 + timer_setup(&adapter->phy_config_timer, atl1c_phy_config, 0); 2619 2617 /* setup the private structure */ 2620 2618 err = atl1c_sw_init(adapter); 2621 2619 if (err) {
+4 -4
drivers/net/ethernet/atheros/atl1e/atl1e_main.c
··· 130 130 * atl1e_phy_config - Timer Call-back 131 131 * @data: pointer to netdev cast into an unsigned long 132 132 */ 133 - static void atl1e_phy_config(unsigned long data) 133 + static void atl1e_phy_config(struct timer_list *t) 134 134 { 135 - struct atl1e_adapter *adapter = (struct atl1e_adapter *) data; 135 + struct atl1e_adapter *adapter = from_timer(adapter, t, 136 + phy_config_timer); 136 137 struct atl1e_hw *hw = &adapter->hw; 137 138 unsigned long flags; 138 139 ··· 2362 2361 2363 2362 netif_napi_add(netdev, &adapter->napi, atl1e_clean, 64); 2364 2363 2365 - setup_timer(&adapter->phy_config_timer, atl1e_phy_config, 2366 - (unsigned long)adapter); 2364 + timer_setup(&adapter->phy_config_timer, atl1e_phy_config, 0); 2367 2365 2368 2366 /* get user settings */ 2369 2367 atl1e_check_options(adapter);
+4 -4
drivers/net/ethernet/atheros/atlx/atl1.c
··· 2575 2575 * atl1_phy_config - Timer Call-back 2576 2576 * @data: pointer to netdev cast into an unsigned long 2577 2577 */ 2578 - static void atl1_phy_config(unsigned long data) 2578 + static void atl1_phy_config(struct timer_list *t) 2579 2579 { 2580 - struct atl1_adapter *adapter = (struct atl1_adapter *)data; 2580 + struct atl1_adapter *adapter = from_timer(adapter, t, 2581 + phy_config_timer); 2581 2582 struct atl1_hw *hw = &adapter->hw; 2582 2583 unsigned long flags; 2583 2584 ··· 3072 3071 /* assume we have no link for now */ 3073 3072 netif_carrier_off(netdev); 3074 3073 3075 - setup_timer(&adapter->phy_config_timer, atl1_phy_config, 3076 - (unsigned long)adapter); 3074 + timer_setup(&adapter->phy_config_timer, atl1_phy_config, 0); 3077 3075 adapter->phy_timer_pending = false; 3078 3076 3079 3077 INIT_WORK(&adapter->reset_dev_task, atl1_reset_dev_task);
+7 -8
drivers/net/ethernet/atheros/atlx/atl2.c
··· 1028 1028 * atl2_watchdog - Timer Call-back 1029 1029 * @data: pointer to netdev cast into an unsigned long 1030 1030 */ 1031 - static void atl2_watchdog(unsigned long data) 1031 + static void atl2_watchdog(struct timer_list *t) 1032 1032 { 1033 - struct atl2_adapter *adapter = (struct atl2_adapter *) data; 1033 + struct atl2_adapter *adapter = from_timer(adapter, t, watchdog_timer); 1034 1034 1035 1035 if (!test_bit(__ATL2_DOWN, &adapter->flags)) { 1036 1036 u32 drop_rxd, drop_rxs; ··· 1053 1053 * atl2_phy_config - Timer Call-back 1054 1054 * @data: pointer to netdev cast into an unsigned long 1055 1055 */ 1056 - static void atl2_phy_config(unsigned long data) 1056 + static void atl2_phy_config(struct timer_list *t) 1057 1057 { 1058 - struct atl2_adapter *adapter = (struct atl2_adapter *) data; 1058 + struct atl2_adapter *adapter = from_timer(adapter, t, 1059 + phy_config_timer); 1059 1060 struct atl2_hw *hw = &adapter->hw; 1060 1061 unsigned long flags; 1061 1062 ··· 1435 1434 1436 1435 atl2_check_options(adapter); 1437 1436 1438 - setup_timer(&adapter->watchdog_timer, atl2_watchdog, 1439 - (unsigned long)adapter); 1437 + timer_setup(&adapter->watchdog_timer, atl2_watchdog, 0); 1440 1438 1441 - setup_timer(&adapter->phy_config_timer, atl2_phy_config, 1442 - (unsigned long)adapter); 1439 + timer_setup(&adapter->phy_config_timer, atl2_phy_config, 0); 1443 1440 1444 1441 INIT_WORK(&adapter->reset_task, atl2_reset_task); 1445 1442 INIT_WORK(&adapter->link_chg_task, atl2_link_chg_task);
+3 -3
drivers/net/ethernet/broadcom/b44.c
··· 599 599 } 600 600 } 601 601 602 - static void b44_timer(unsigned long __opaque) 602 + static void b44_timer(struct timer_list *t) 603 603 { 604 - struct b44 *bp = (struct b44 *) __opaque; 604 + struct b44 *bp = from_timer(bp, t, timer); 605 605 606 606 spin_lock_irq(&bp->lock); 607 607 ··· 1474 1474 goto out; 1475 1475 } 1476 1476 1477 - setup_timer(&bp->timer, b44_timer, (unsigned long)bp); 1477 + timer_setup(&bp->timer, b44_timer, 0); 1478 1478 bp->timer.expires = jiffies + HZ; 1479 1479 add_timer(&bp->timer); 1480 1480
+3 -3
drivers/net/ethernet/broadcom/bnx2.c
··· 6183 6183 } 6184 6184 6185 6185 static void 6186 - bnx2_timer(unsigned long data) 6186 + bnx2_timer(struct timer_list *t) 6187 6187 { 6188 - struct bnx2 *bp = (struct bnx2 *) data; 6188 + struct bnx2 *bp = from_timer(bp, t, timer); 6189 6189 6190 6190 if (!netif_running(bp->dev)) 6191 6191 return; ··· 8462 8462 bnx2_set_default_link(bp); 8463 8463 bp->req_flow_ctrl = FLOW_CTRL_RX | FLOW_CTRL_TX; 8464 8464 8465 - setup_timer(&bp->timer, bnx2_timer, (unsigned long)bp); 8465 + timer_setup(&bp->timer, bnx2_timer, 0); 8466 8466 bp->timer.expires = RUN_AT(BNX2_TIMER_INTERVAL); 8467 8467 8468 8468 #ifdef BCM_CNIC
+3 -3
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 5761 5761 bp->fw_drv_pulse_wr_seq); 5762 5762 } 5763 5763 5764 - static void bnx2x_timer(unsigned long data) 5764 + static void bnx2x_timer(struct timer_list *t) 5765 5765 { 5766 - struct bnx2x *bp = (struct bnx2x *) data; 5766 + struct bnx2x *bp = from_timer(bp, t, timer); 5767 5767 5768 5768 if (!netif_running(bp->dev)) 5769 5769 return; ··· 12421 12421 12422 12422 bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ; 12423 12423 12424 - setup_timer(&bp->timer, bnx2x_timer, (unsigned long)bp); 12424 + timer_setup(&bp->timer, bnx2x_timer, 0); 12425 12425 bp->timer.expires = jiffies + bp->current_interval; 12426 12426 12427 12427 if (SHMEM2_HAS(bp, dcbx_lldp_params_offset) &&
+3 -3
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 6962 6962 } 6963 6963 #endif 6964 6964 6965 - static void bnxt_timer(unsigned long data) 6965 + static void bnxt_timer(struct timer_list *t) 6966 6966 { 6967 - struct bnxt *bp = (struct bnxt *)data; 6967 + struct bnxt *bp = from_timer(bp, t, timer); 6968 6968 struct net_device *dev = bp->dev; 6969 6969 6970 6970 if (!netif_running(dev)) ··· 7236 7236 7237 7237 bnxt_init_dflt_coal(bp); 7238 7238 7239 - setup_timer(&bp->timer, bnxt_timer, (unsigned long)bp); 7239 + timer_setup(&bp->timer, bnxt_timer, 0); 7240 7240 bp->current_interval = BNXT_TIMER_INTERVAL; 7241 7241 7242 7242 clear_bit(BNXT_STATE_OPEN, &bp->state);
+3 -3
drivers/net/ethernet/broadcom/tg3.c
··· 10931 10931 } 10932 10932 } 10933 10933 10934 - static void tg3_timer(unsigned long __opaque) 10934 + static void tg3_timer(struct timer_list *t) 10935 10935 { 10936 - struct tg3 *tp = (struct tg3 *) __opaque; 10936 + struct tg3 *tp = from_timer(tp, t, timer); 10937 10937 10938 10938 spin_lock(&tp->lock); 10939 10939 ··· 11087 11087 tp->asf_multiplier = (HZ / tp->timer_offset) * 11088 11088 TG3_FW_UPDATE_FREQ_SEC; 11089 11089 11090 - setup_timer(&tp->timer, tg3_timer, (unsigned long)tp); 11090 + timer_setup(&tp->timer, tg3_timer, 0); 11091 11091 } 11092 11092 11093 11093 static void tg3_timer_start(struct tg3 *tp)
+2 -2
drivers/net/ethernet/cisco/enic/enic_clsf.c
··· 123 123 } 124 124 125 125 #ifdef CONFIG_RFS_ACCEL 126 - void enic_flow_may_expire(unsigned long data) 126 + void enic_flow_may_expire(struct timer_list *t) 127 127 { 128 - struct enic *enic = (struct enic *)data; 128 + struct enic *enic = from_timer(enic, t, rfs_h.rfs_may_expire); 129 129 bool res; 130 130 int j; 131 131
+2 -3
drivers/net/ethernet/cisco/enic/enic_clsf.h
··· 16 16 #ifdef CONFIG_RFS_ACCEL 17 17 int enic_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, 18 18 u16 rxq_index, u32 flow_id); 19 - void enic_flow_may_expire(unsigned long data); 19 + void enic_flow_may_expire(struct timer_list *t); 20 20 21 21 static inline void enic_rfs_timer_start(struct enic *enic) 22 22 { 23 - setup_timer(&enic->rfs_h.rfs_may_expire, enic_flow_may_expire, 24 - (unsigned long)enic); 23 + timer_setup(&enic->rfs_h.rfs_may_expire, enic_flow_may_expire, 0); 25 24 mod_timer(&enic->rfs_h.rfs_may_expire, jiffies + HZ/4); 26 25 } 27 26
+3 -4
drivers/net/ethernet/cisco/enic/enic_main.c
··· 1676 1676 return work_done; 1677 1677 } 1678 1678 1679 - static void enic_notify_timer(unsigned long data) 1679 + static void enic_notify_timer(struct timer_list *t) 1680 1680 { 1681 - struct enic *enic = (struct enic *)data; 1681 + struct enic *enic = from_timer(enic, t, notify_timer); 1682 1682 1683 1683 enic_notify_check(enic); 1684 1684 ··· 2846 2846 /* Setup notification timer, HW reset task, and wq locks 2847 2847 */ 2848 2848 2849 - setup_timer(&enic->notify_timer, enic_notify_timer, 2850 - (unsigned long)enic); 2849 + timer_setup(&enic->notify_timer, enic_notify_timer, 0); 2851 2850 2852 2851 enic_set_rx_coal_setting(enic); 2853 2852 INIT_WORK(&enic->reset, enic_reset);
+6 -7
drivers/net/ethernet/marvell/mv643xx_eth.c
··· 1346 1346 spin_unlock_bh(&mp->mib_counters_lock); 1347 1347 } 1348 1348 1349 - static void mib_counters_timer_wrapper(unsigned long _mp) 1349 + static void mib_counters_timer_wrapper(struct timer_list *t) 1350 1350 { 1351 - struct mv643xx_eth_private *mp = (void *)_mp; 1351 + struct mv643xx_eth_private *mp = from_timer(mp, t, mib_counters_timer); 1352 1352 mib_counters_update(mp); 1353 1353 mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); 1354 1354 } ··· 2321 2321 return work_done; 2322 2322 } 2323 2323 2324 - static inline void oom_timer_wrapper(unsigned long data) 2324 + static inline void oom_timer_wrapper(struct timer_list *t) 2325 2325 { 2326 - struct mv643xx_eth_private *mp = (void *)data; 2326 + struct mv643xx_eth_private *mp = from_timer(mp, t, rx_oom); 2327 2327 2328 2328 napi_schedule(&mp->napi); 2329 2329 } ··· 3178 3178 3179 3179 mib_counters_clear(mp); 3180 3180 3181 - setup_timer(&mp->mib_counters_timer, mib_counters_timer_wrapper, 3182 - (unsigned long)mp); 3181 + timer_setup(&mp->mib_counters_timer, mib_counters_timer_wrapper, 0); 3183 3182 mp->mib_counters_timer.expires = jiffies + 30 * HZ; 3184 3183 3185 3184 spin_lock_init(&mp->mib_counters_lock); ··· 3187 3188 3188 3189 netif_napi_add(dev, &mp->napi, mv643xx_eth_poll, NAPI_POLL_WEIGHT); 3189 3190 3190 - setup_timer(&mp->rx_oom, oom_timer_wrapper, (unsigned long)mp); 3191 + timer_setup(&mp->rx_oom, oom_timer_wrapper, 0); 3191 3192 3192 3193 3193 3194 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+3 -4
drivers/net/ethernet/marvell/pxa168_eth.c
··· 362 362 } 363 363 } 364 364 365 - static inline void rxq_refill_timer_wrapper(unsigned long data) 365 + static inline void rxq_refill_timer_wrapper(struct timer_list *t) 366 366 { 367 - struct pxa168_eth_private *pep = (void *)data; 367 + struct pxa168_eth_private *pep = from_timer(pep, t, timeout); 368 368 napi_schedule(&pep->napi); 369 369 } 370 370 ··· 1496 1496 netif_napi_add(dev, &pep->napi, pxa168_rx_poll, pep->rx_ring_size); 1497 1497 1498 1498 memset(&pep->timeout, 0, sizeof(struct timer_list)); 1499 - setup_timer(&pep->timeout, rxq_refill_timer_wrapper, 1500 - (unsigned long)pep); 1499 + timer_setup(&pep->timeout, rxq_refill_timer_wrapper, 0); 1501 1500 1502 1501 pep->smi_bus = mdiobus_alloc(); 1503 1502 if (!pep->smi_bus) {
+3 -3
drivers/net/ethernet/marvell/skge.c
··· 1495 1495 * get an interrupt when carrier is detected, need to poll for 1496 1496 * link coming up. 1497 1497 */ 1498 - static void xm_link_timer(unsigned long arg) 1498 + static void xm_link_timer(struct timer_list *t) 1499 1499 { 1500 - struct skge_port *skge = (struct skge_port *) arg; 1500 + struct skge_port *skge = from_timer(skge, t, link_timer); 1501 1501 struct net_device *dev = skge->netdev; 1502 1502 struct skge_hw *hw = skge->hw; 1503 1503 int port = skge->port; ··· 3897 3897 3898 3898 /* Only used for Genesis XMAC */ 3899 3899 if (is_genesis(hw)) 3900 - setup_timer(&skge->link_timer, xm_link_timer, (unsigned long) skge); 3900 + timer_setup(&skge->link_timer, xm_link_timer, 0); 3901 3901 else { 3902 3902 dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG | 3903 3903 NETIF_F_RXCSUM;
+3 -3
drivers/net/ethernet/marvell/sky2.c
··· 2974 2974 } 2975 2975 } 2976 2976 2977 - static void sky2_watchdog(unsigned long arg) 2977 + static void sky2_watchdog(struct timer_list *t) 2978 2978 { 2979 - struct sky2_hw *hw = (struct sky2_hw *) arg; 2979 + struct sky2_hw *hw = from_timer(hw, t, watchdog_timer); 2980 2980 2981 2981 /* Check for lost IRQ once a second */ 2982 2982 if (sky2_read32(hw, B0_ISRC)) { ··· 5083 5083 sky2_show_addr(dev1); 5084 5084 } 5085 5085 5086 - setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw); 5086 + timer_setup(&hw->watchdog_timer, sky2_watchdog, 0); 5087 5087 INIT_WORK(&hw->restart_work, sky2_restart); 5088 5088 5089 5089 pci_set_drvdata(pdev, hw);
+3 -4
drivers/net/ethernet/myricom/myri10ge/myri10ge.c
··· 3501 3501 * cannot detect a NIC with a parity error in a timely fashion if the 3502 3502 * NIC is lightly loaded. 3503 3503 */ 3504 - static void myri10ge_watchdog_timer(unsigned long arg) 3504 + static void myri10ge_watchdog_timer(struct timer_list *t) 3505 3505 { 3506 3506 struct myri10ge_priv *mgp; 3507 3507 struct myri10ge_slice_state *ss; ··· 3509 3509 u32 rx_pause_cnt; 3510 3510 u16 cmd; 3511 3511 3512 - mgp = (struct myri10ge_priv *)arg; 3512 + mgp = from_timer(mgp, t, watchdog_timer); 3513 3513 3514 3514 rx_pause_cnt = ntohl(mgp->ss[0].fw_stats->dropped_pause); 3515 3515 busy_slice_cnt = 0; ··· 3930 3930 pci_save_state(pdev); 3931 3931 3932 3932 /* Setup the watchdog timer */ 3933 - setup_timer(&mgp->watchdog_timer, myri10ge_watchdog_timer, 3934 - (unsigned long)mgp); 3933 + timer_setup(&mgp->watchdog_timer, myri10ge_watchdog_timer, 0); 3935 3934 3936 3935 netdev->ethtool_ops = &myri10ge_ethtool_ops; 3937 3936 INIT_WORK(&mgp->watchdog_work, myri10ge_watchdog);
+4 -4
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
··· 1089 1089 * pch_gbe_watchdog - Watchdog process 1090 1090 * @data: Board private structure 1091 1091 */ 1092 - static void pch_gbe_watchdog(unsigned long data) 1092 + static void pch_gbe_watchdog(struct timer_list *t) 1093 1093 { 1094 - struct pch_gbe_adapter *adapter = (struct pch_gbe_adapter *)data; 1094 + struct pch_gbe_adapter *adapter = from_timer(adapter, t, 1095 + watchdog_timer); 1095 1096 struct net_device *netdev = adapter->netdev; 1096 1097 struct pch_gbe_hw *hw = &adapter->hw; 1097 1098 ··· 2645 2644 dev_err(&pdev->dev, "Invalid MAC address, " 2646 2645 "interface disabled.\n"); 2647 2646 } 2648 - setup_timer(&adapter->watchdog_timer, pch_gbe_watchdog, 2649 - (unsigned long)adapter); 2647 + timer_setup(&adapter->watchdog_timer, pch_gbe_watchdog, 0); 2650 2648 2651 2649 INIT_WORK(&adapter->reset_task, pch_gbe_reset_task); 2652 2650
+3 -4
drivers/net/ethernet/pasemi/pasemi_mac.c
··· 943 943 944 944 #define TX_CLEAN_INTERVAL HZ 945 945 946 - static void pasemi_mac_tx_timer(unsigned long data) 946 + static void pasemi_mac_tx_timer(struct timer_list *t) 947 947 { 948 - struct pasemi_mac_txring *txring = (struct pasemi_mac_txring *)data; 948 + struct pasemi_mac_txring *txring = from_timer(txring, t, clean_timer); 949 949 struct pasemi_mac *mac = txring->mac; 950 950 951 951 pasemi_mac_clean_tx(txring); ··· 1199 1199 if (dev->phydev) 1200 1200 phy_start(dev->phydev); 1201 1201 1202 - setup_timer(&mac->tx->clean_timer, pasemi_mac_tx_timer, 1203 - (unsigned long)mac->tx); 1202 + timer_setup(&mac->tx->clean_timer, pasemi_mac_tx_timer, 0); 1204 1203 mod_timer(&mac->tx->clean_timer, jiffies + HZ); 1205 1204 1206 1205 return 0;
+3 -3
drivers/net/ethernet/qlogic/qla3xxx.c
··· 3749 3749 qdev->pci_slot = (u8) PCI_SLOT(qdev->pdev->devfn); 3750 3750 } 3751 3751 3752 - static void ql3xxx_timer(unsigned long ptr) 3752 + static void ql3xxx_timer(struct timer_list *t) 3753 3753 { 3754 - struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; 3754 + struct ql3_adapter *qdev = from_timer(qdev, t, adapter_timer); 3755 3755 queue_delayed_work(qdev->workqueue, &qdev->link_state_work, 0); 3756 3756 } 3757 3757 ··· 3891 3891 INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); 3892 3892 INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work); 3893 3893 3894 - setup_timer(&qdev->adapter_timer, ql3xxx_timer, (unsigned long)qdev); 3894 + timer_setup(&qdev->adapter_timer, ql3xxx_timer, 0); 3895 3895 qdev->adapter_timer.expires = jiffies + HZ * 2; /* two second delay */ 3896 3896 3897 3897 if (!cards_found) {
+3 -4
drivers/net/ethernet/rocker/rocker_ofdpa.c
··· 1983 1983 return err; 1984 1984 } 1985 1985 1986 - static void ofdpa_fdb_cleanup(unsigned long data) 1986 + static void ofdpa_fdb_cleanup(struct timer_list *t) 1987 1987 { 1988 - struct ofdpa *ofdpa = (struct ofdpa *)data; 1988 + struct ofdpa *ofdpa = from_timer(ofdpa, t, fdb_cleanup_timer); 1989 1989 struct ofdpa_port *ofdpa_port; 1990 1990 struct ofdpa_fdb_tbl_entry *entry; 1991 1991 struct hlist_node *tmp; ··· 2368 2368 hash_init(ofdpa->neigh_tbl); 2369 2369 spin_lock_init(&ofdpa->neigh_tbl_lock); 2370 2370 2371 - setup_timer(&ofdpa->fdb_cleanup_timer, ofdpa_fdb_cleanup, 2372 - (unsigned long) ofdpa); 2371 + timer_setup(&ofdpa->fdb_cleanup_timer, ofdpa_fdb_cleanup, 0); 2373 2372 mod_timer(&ofdpa->fdb_cleanup_timer, jiffies); 2374 2373 2375 2374 ofdpa->ageing_time = BR_DEFAULT_AGEING_TIME;
+7 -8
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 345 345 * if there is no data transfer and if we are not in LPI state, 346 346 * then MAC Transmitter can be moved to LPI state. 347 347 */ 348 - static void stmmac_eee_ctrl_timer(unsigned long arg) 348 + static void stmmac_eee_ctrl_timer(struct timer_list *t) 349 349 { 350 - struct stmmac_priv *priv = (struct stmmac_priv *)arg; 350 + struct stmmac_priv *priv = from_timer(priv, t, eee_ctrl_timer); 351 351 352 352 stmmac_enable_eee_mode(priv); 353 353 mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(eee_timer)); ··· 401 401 spin_lock_irqsave(&priv->lock, flags); 402 402 if (!priv->eee_active) { 403 403 priv->eee_active = 1; 404 - setup_timer(&priv->eee_ctrl_timer, 405 - stmmac_eee_ctrl_timer, 406 - (unsigned long)priv); 404 + timer_setup(&priv->eee_ctrl_timer, 405 + stmmac_eee_ctrl_timer, 0); 407 406 mod_timer(&priv->eee_ctrl_timer, 408 407 STMMAC_LPI_T(eee_timer)); 409 408 ··· 2220 2221 * Description: 2221 2222 * This is the timer handler to directly invoke the stmmac_tx_clean. 2222 2223 */ 2223 - static void stmmac_tx_timer(unsigned long data) 2224 + static void stmmac_tx_timer(struct timer_list *t) 2224 2225 { 2225 - struct stmmac_priv *priv = (struct stmmac_priv *)data; 2226 + struct stmmac_priv *priv = from_timer(priv, t, txtimer); 2226 2227 u32 tx_queues_count = priv->plat->tx_queues_to_use; 2227 2228 u32 queue; 2228 2229 ··· 2243 2244 { 2244 2245 priv->tx_coal_frames = STMMAC_TX_FRAMES; 2245 2246 priv->tx_coal_timer = STMMAC_COAL_TX_TIMER; 2246 - setup_timer(&priv->txtimer, stmmac_tx_timer, (unsigned long)priv); 2247 + timer_setup(&priv->txtimer, stmmac_tx_timer, 0); 2247 2248 priv->txtimer.expires = STMMAC_COAL_TIMER(priv->tx_coal_timer); 2248 2249 add_timer(&priv->txtimer); 2249 2250 }
+3 -4
drivers/net/ethernet/synopsys/dwc-xlgmac-net.c
··· 358 358 return IRQ_HANDLED; 359 359 } 360 360 361 - static void xlgmac_tx_timer(unsigned long data) 361 + static void xlgmac_tx_timer(struct timer_list *t) 362 362 { 363 - struct xlgmac_channel *channel = (struct xlgmac_channel *)data; 363 + struct xlgmac_channel *channel = from_timer(channel, t, tx_timer); 364 364 struct xlgmac_pdata *pdata = channel->pdata; 365 365 struct napi_struct *napi; 366 366 ··· 391 391 if (!channel->tx_ring) 392 392 break; 393 393 394 - setup_timer(&channel->tx_timer, xlgmac_tx_timer, 395 - (unsigned long)channel); 394 + timer_setup(&channel->tx_timer, xlgmac_tx_timer, 0); 396 395 } 397 396 } 398 397
+3 -3
drivers/net/ethernet/ti/cpsw_ale.c
··· 765 765 } 766 766 EXPORT_SYMBOL_GPL(cpsw_ale_control_get); 767 767 768 - static void cpsw_ale_timer(unsigned long arg) 768 + static void cpsw_ale_timer(struct timer_list *t) 769 769 { 770 - struct cpsw_ale *ale = (struct cpsw_ale *)arg; 770 + struct cpsw_ale *ale = from_timer(ale, t, timer); 771 771 772 772 cpsw_ale_control_set(ale, 0, ALE_AGEOUT, 1); 773 773 ··· 859 859 cpsw_ale_control_set(ale, 0, ALE_ENABLE, 1); 860 860 cpsw_ale_control_set(ale, 0, ALE_CLEAR, 1); 861 861 862 - setup_timer(&ale->timer, cpsw_ale_timer, (unsigned long)ale); 862 + timer_setup(&ale->timer, cpsw_ale_timer, 0); 863 863 if (ale->ageout) { 864 864 ale->timer.expires = jiffies + ale->ageout; 865 865 add_timer(&ale->timer);
+3 -4
drivers/net/ethernet/ti/netcp_ethss.c
··· 2745 2745 return -EOPNOTSUPP; 2746 2746 } 2747 2747 2748 - static void netcp_ethss_timer(unsigned long arg) 2748 + static void netcp_ethss_timer(struct timer_list *t) 2749 2749 { 2750 - struct gbe_priv *gbe_dev = (struct gbe_priv *)arg; 2750 + struct gbe_priv *gbe_dev = from_timer(gbe_dev, t, timer); 2751 2751 struct gbe_intf *gbe_intf; 2752 2752 struct gbe_slave *slave; 2753 2753 ··· 3616 3616 } 3617 3617 spin_unlock_bh(&gbe_dev->hw_stats_lock); 3618 3618 3619 - setup_timer(&gbe_dev->timer, netcp_ethss_timer, 3620 - (unsigned long)gbe_dev); 3619 + timer_setup(&gbe_dev->timer, netcp_ethss_timer, 0); 3621 3620 gbe_dev->timer.expires = jiffies + GBE_TIMER_INTERVAL; 3622 3621 add_timer(&gbe_dev->timer); 3623 3622 *inst_priv = gbe_dev;
+3 -3
drivers/net/ethernet/ti/tlan.c
··· 254 254 spin_unlock_irqrestore(&priv->lock, flags); 255 255 return; 256 256 } 257 - priv->timer.function = (TIMER_FUNC_TYPE)tlan_timer; 257 + priv->timer.function = tlan_timer; 258 258 if (!in_irq()) 259 259 spin_unlock_irqrestore(&priv->lock, flags); 260 260 ··· 1425 1425 tlan_dio_write8(dev->base_addr, 1426 1426 TLAN_LED_REG, TLAN_LED_LINK | TLAN_LED_ACT); 1427 1427 if (priv->timer.function == NULL) { 1428 - priv->timer.function = (TIMER_FUNC_TYPE)tlan_timer; 1428 + priv->timer.function = tlan_timer; 1429 1429 priv->timer.expires = jiffies + TLAN_TIMER_ACT_DELAY; 1430 1430 priv->timer_set_at = jiffies; 1431 1431 priv->timer_type = TLAN_TIMER_ACTIVITY; ··· 1576 1576 tlan_dio_write8(dev->base_addr, 1577 1577 TLAN_LED_REG, TLAN_LED_LINK | TLAN_LED_ACT); 1578 1578 if (priv->timer.function == NULL) { 1579 - priv->timer.function = (TIMER_FUNC_TYPE)tlan_timer; 1579 + priv->timer.function = tlan_timer; 1580 1580 priv->timer.expires = jiffies + TLAN_TIMER_ACT_DELAY; 1581 1581 priv->timer_set_at = jiffies; 1582 1582 priv->timer_type = TLAN_TIMER_ACTIVITY;
+7 -9
drivers/net/ethernet/toshiba/spider_net.c
··· 912 912 * packets, including updating the queue tail pointer. 913 913 */ 914 914 static void 915 - spider_net_cleanup_tx_ring(struct spider_net_card *card) 915 + spider_net_cleanup_tx_ring(struct timer_list *t) 916 916 { 917 + struct spider_net_card *card = from_timer(card, t, tx_timer); 917 918 if ((spider_net_release_tx_chain(card, 0) != 0) && 918 919 (card->netdev->flags & IFF_UP)) { 919 920 spider_net_kick_tx_dma(card); ··· 1266 1265 spider_net_refill_rx_chain(card); 1267 1266 spider_net_enable_rxdmac(card); 1268 1267 1269 - spider_net_cleanup_tx_ring(card); 1268 + spider_net_cleanup_tx_ring(&card->tx_timer); 1270 1269 1271 1270 /* if all packets are in the stack, enable interrupts and return 0 */ 1272 1271 /* if not, return 1 */ ··· 1978 1977 * @data: used for pointer to card structure 1979 1978 * 1980 1979 */ 1981 - static void spider_net_link_phy(unsigned long data) 1980 + static void spider_net_link_phy(struct timer_list *t) 1982 1981 { 1983 - struct spider_net_card *card = (struct spider_net_card *)data; 1982 + struct spider_net_card *card = from_timer(card, t, aneg_timer); 1984 1983 struct mii_phy *phy = &card->phy; 1985 1984 1986 1985 /* if link didn't come up after SPIDER_NET_ANEG_TIMEOUT tries, setup phy again */ ··· 2257 2256 2258 2257 pci_set_drvdata(card->pdev, netdev); 2259 2258 2260 - setup_timer(&card->tx_timer, 2261 - (void(*)(unsigned long))spider_net_cleanup_tx_ring, 2262 - (unsigned long)card); 2259 + timer_setup(&card->tx_timer, spider_net_cleanup_tx_ring, 0); 2263 2260 netdev->irq = card->pdev->irq; 2264 2261 2265 2262 card->aneg_count = 0; 2266 - setup_timer(&card->aneg_timer, spider_net_link_phy, 2267 - (unsigned long)card); 2263 + timer_setup(&card->aneg_timer, spider_net_link_phy, 0); 2268 2264 2269 2265 netif_napi_add(netdev, &card->napi, 2270 2266 spider_net_poll, SPIDER_NET_NAPI_WEIGHT);
+4 -4
drivers/net/hamradio/scc.c
··· 1005 1005 } else 1006 1006 if (when != TIMER_OFF) 1007 1007 { 1008 - scc->tx_t.function = (TIMER_FUNC_TYPE)handler; 1008 + scc->tx_t.function = handler; 1009 1009 scc->tx_t.expires = jiffies + (when*HZ)/100; 1010 1010 add_timer(&scc->tx_t); 1011 1011 } ··· 1031 1031 1032 1032 if (scc->kiss.maxdefer != 0 && scc->kiss.maxdefer != TIMER_OFF) 1033 1033 { 1034 - scc->tx_wdog.function = (TIMER_FUNC_TYPE)t_busy; 1034 + scc->tx_wdog.function = t_busy; 1035 1035 scc->tx_wdog.expires = jiffies + HZ*scc->kiss.maxdefer; 1036 1036 add_timer(&scc->tx_wdog); 1037 1037 } ··· 1047 1047 1048 1048 if (scc->kiss.maxkeyup != 0 && scc->kiss.maxkeyup != TIMER_OFF) 1049 1049 { 1050 - scc->tx_wdog.function = (TIMER_FUNC_TYPE)t_maxkeyup; 1050 + scc->tx_wdog.function = t_maxkeyup; 1051 1051 scc->tx_wdog.expires = jiffies + HZ*scc->kiss.maxkeyup; 1052 1052 add_timer(&scc->tx_wdog); 1053 1053 } ··· 1428 1428 1429 1429 del_timer(&scc->tx_wdog); 1430 1430 1431 - scc->tx_wdog.function = (TIMER_FUNC_TYPE)scc_stop_calibrate; 1431 + scc->tx_wdog.function = scc_stop_calibrate; 1432 1432 scc->tx_wdog.expires = jiffies + HZ*duration; 1433 1433 add_timer(&scc->tx_wdog); 1434 1434
+8 -8
drivers/net/slip/slip.c
··· 106 106 static void slip_unesc6(struct slip *sl, unsigned char c); 107 107 #endif 108 108 #ifdef CONFIG_SLIP_SMART 109 - static void sl_keepalive(unsigned long sls); 110 - static void sl_outfill(unsigned long sls); 109 + static void sl_keepalive(struct timer_list *t); 110 + static void sl_outfill(struct timer_list *t); 111 111 static int sl_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 112 112 #endif 113 113 ··· 763 763 sl->mode = SL_MODE_DEFAULT; 764 764 #ifdef CONFIG_SLIP_SMART 765 765 /* initialize timer_list struct */ 766 - setup_timer(&sl->keepalive_timer, sl_keepalive, (unsigned long)sl); 767 - setup_timer(&sl->outfill_timer, sl_outfill, (unsigned long)sl); 766 + timer_setup(&sl->keepalive_timer, sl_keepalive, 0); 767 + timer_setup(&sl->outfill_timer, sl_outfill, 0); 768 768 #endif 769 769 slip_devs[i] = dev; 770 770 return sl; ··· 1388 1388 * added by Stanislav Voronyi. All changes before marked VSV 1389 1389 */ 1390 1390 1391 - static void sl_outfill(unsigned long sls) 1391 + static void sl_outfill(struct timer_list *t) 1392 1392 { 1393 - struct slip *sl = (struct slip *)sls; 1393 + struct slip *sl = from_timer(sl, t, outfill_timer); 1394 1394 1395 1395 spin_lock(&sl->lock); 1396 1396 ··· 1419 1419 spin_unlock(&sl->lock); 1420 1420 } 1421 1421 1422 - static void sl_keepalive(unsigned long sls) 1422 + static void sl_keepalive(struct timer_list *t) 1423 1423 { 1424 - struct slip *sl = (struct slip *)sls; 1424 + struct slip *sl = from_timer(sl, t, keepalive_timer); 1425 1425 1426 1426 spin_lock(&sl->lock); 1427 1427
+5 -3
drivers/net/tun.c
··· 444 444 spin_unlock_bh(&tun->lock); 445 445 } 446 446 447 - static void tun_flow_cleanup(unsigned long data) 447 + static void tun_flow_cleanup(struct timer_list *t) 448 448 { 449 - struct tun_struct *tun = (struct tun_struct *)data; 449 + struct tun_struct *tun = from_timer(tun, t, flow_gc_timer); 450 450 unsigned long delay = tun->ageing_time; 451 451 unsigned long next_timer = jiffies + delay; 452 452 unsigned long count = 0; ··· 1196 1196 INIT_HLIST_HEAD(&tun->flows[i]); 1197 1197 1198 1198 tun->ageing_time = TUN_FLOW_EXPIRE; 1199 - setup_timer(&tun->flow_gc_timer, tun_flow_cleanup, (unsigned long)tun); 1199 + timer_setup(&tun->flow_gc_timer, tun_flow_cleanup, 0); 1200 + mod_timer(&tun->flow_gc_timer, 1201 + round_jiffies_up(jiffies + tun->ageing_time)); 1200 1202 } 1201 1203 1202 1204 static void tun_flow_uninit(struct tun_struct *tun)
+3 -3
drivers/net/wan/hdlc_ppp.c
··· 558 558 return NET_RX_DROP; 559 559 } 560 560 561 - static void ppp_timer(unsigned long arg) 561 + static void ppp_timer(struct timer_list *t) 562 562 { 563 - struct proto *proto = (struct proto *)arg; 563 + struct proto *proto = from_timer(proto, t, timer); 564 564 struct ppp *ppp = get_ppp(proto->dev); 565 565 unsigned long flags; 566 566 ··· 610 610 for (i = 0; i < IDX_COUNT; i++) { 611 611 struct proto *proto = &ppp->protos[i]; 612 612 proto->dev = dev; 613 - setup_timer(&proto->timer, ppp_timer, (unsigned long)proto); 613 + timer_setup(&proto->timer, ppp_timer, 0); 614 614 proto->state = CLOSED; 615 615 } 616 616 ppp->protos[IDX_LCP].pid = PID_LCP;
+2 -2
drivers/net/wireless/atmel/at76c50x-usb.c
··· 518 518 519 519 /* LED trigger */ 520 520 static int tx_activity; 521 - static void at76_ledtrig_tx_timerfunc(unsigned long data); 521 + static void at76_ledtrig_tx_timerfunc(struct timer_list *unused); 522 522 static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc); 523 523 DEFINE_LED_TRIGGER(ledtrig_tx); 524 524 525 - static void at76_ledtrig_tx_timerfunc(unsigned long data) 525 + static void at76_ledtrig_tx_timerfunc(struct timer_list *unused) 526 526 { 527 527 static int tx_lastactivity; 528 528
+3 -3
drivers/net/wireless/broadcom/brcm80211/brcmfmac/btcoex.c
··· 280 280 /** 281 281 * brcmf_btcoex_timerfunc() - BT coex timer callback 282 282 */ 283 - static void brcmf_btcoex_timerfunc(ulong data) 283 + static void brcmf_btcoex_timerfunc(struct timer_list *t) 284 284 { 285 - struct brcmf_btcoex_info *bt_local = (struct brcmf_btcoex_info *)data; 285 + struct brcmf_btcoex_info *bt_local = from_timer(bt_local, t, timer); 286 286 brcmf_dbg(TRACE, "enter\n"); 287 287 288 288 bt_local->timer_on = false; ··· 380 380 /* Set up timer for BT */ 381 381 btci->timer_on = false; 382 382 btci->timeout = BRCMF_BTCOEX_OPPR_WIN_TIME; 383 - setup_timer(&btci->timer, brcmf_btcoex_timerfunc, (ulong)btci); 383 + timer_setup(&btci->timer, brcmf_btcoex_timerfunc, 0); 384 384 btci->cfg = cfg; 385 385 btci->saved_regs_part1 = false; 386 386 btci->saved_regs_part2 = false;
+3 -4
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
··· 2983 2983 brcmf_notify_escan_complete(cfg, cfg->escan_info.ifp, true, true); 2984 2984 } 2985 2985 2986 - static void brcmf_escan_timeout(unsigned long data) 2986 + static void brcmf_escan_timeout(struct timer_list *t) 2987 2987 { 2988 2988 struct brcmf_cfg80211_info *cfg = 2989 - (struct brcmf_cfg80211_info *)data; 2989 + from_timer(cfg, t, escan_timeout); 2990 2990 2991 2991 if (cfg->int_escan_map || cfg->scan_request) { 2992 2992 brcmf_err("timer expired\n"); ··· 3150 3150 brcmf_cfg80211_escan_handler); 3151 3151 cfg->escan_info.escan_state = WL_ESCAN_STATE_IDLE; 3152 3152 /* Init scan_timeout timer */ 3153 - setup_timer(&cfg->escan_timeout, brcmf_escan_timeout, 3154 - (unsigned long)cfg); 3153 + timer_setup(&cfg->escan_timeout, brcmf_escan_timeout, 0); 3155 3154 INIT_WORK(&cfg->escan_timeout_work, 3156 3155 brcmf_cfg80211_escan_timeout_worker); 3157 3156 }
+3 -4
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
··· 3972 3972 } 3973 3973 3974 3974 static void 3975 - brcmf_sdio_watchdog(unsigned long data) 3975 + brcmf_sdio_watchdog(struct timer_list *t) 3976 3976 { 3977 - struct brcmf_sdio *bus = (struct brcmf_sdio *)data; 3977 + struct brcmf_sdio *bus = from_timer(bus, t, timer); 3978 3978 3979 3979 if (bus->watchdog_tsk) { 3980 3980 complete(&bus->watchdog_wait); ··· 4169 4169 init_waitqueue_head(&bus->dcmd_resp_wait); 4170 4170 4171 4171 /* Set up the watchdog timer */ 4172 - setup_timer(&bus->timer, brcmf_sdio_watchdog, 4173 - (unsigned long)bus); 4172 + timer_setup(&bus->timer, brcmf_sdio_watchdog, 0); 4174 4173 /* Initialize watchdog thread */ 4175 4174 init_completion(&bus->watchdog_wait); 4176 4175 bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread,
+6 -8
drivers/net/wireless/intel/iwlwifi/dvm/main.c
··· 399 399 * was received. We need to ensure we receive the statistics in order 400 400 * to update the temperature used for calibrating the TXPOWER. 401 401 */ 402 - static void iwl_bg_statistics_periodic(unsigned long data) 402 + static void iwl_bg_statistics_periodic(struct timer_list *t) 403 403 { 404 - struct iwl_priv *priv = (struct iwl_priv *)data; 404 + struct iwl_priv *priv = from_timer(priv, t, statistics_periodic); 405 405 406 406 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 407 407 return; ··· 556 556 * this function is to perform continuous uCode event logging operation 557 557 * if enabled 558 558 */ 559 - static void iwl_bg_ucode_trace(unsigned long data) 559 + static void iwl_bg_ucode_trace(struct timer_list *t) 560 560 { 561 - struct iwl_priv *priv = (struct iwl_priv *)data; 561 + struct iwl_priv *priv = from_timer(priv, t, ucode_trace); 562 562 563 563 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 564 564 return; ··· 1085 1085 if (priv->lib->bt_params) 1086 1086 iwlagn_bt_setup_deferred_work(priv); 1087 1087 1088 - setup_timer(&priv->statistics_periodic, iwl_bg_statistics_periodic, 1089 - (unsigned long)priv); 1088 + timer_setup(&priv->statistics_periodic, iwl_bg_statistics_periodic, 0); 1090 1089 1091 - setup_timer(&priv->ucode_trace, iwl_bg_ucode_trace, 1092 - (unsigned long)priv); 1090 + timer_setup(&priv->ucode_trace, iwl_bg_ucode_trace, 0); 1093 1091 } 1094 1092 1095 1093 void iwl_cancel_deferred_work(struct iwl_priv *priv)
+10 -8
drivers/net/wireless/intel/iwlwifi/dvm/tt.c
··· 164 164 * without doing anything, driver should continue the 5 seconds timer 165 165 * to wake up uCode for temperature check until temperature drop below CT 166 166 */ 167 - static void iwl_tt_check_exit_ct_kill(unsigned long data) 167 + static void iwl_tt_check_exit_ct_kill(struct timer_list *t) 168 168 { 169 - struct iwl_priv *priv = (struct iwl_priv *)data; 169 + struct iwl_priv *priv = from_timer(priv, t, 170 + thermal_throttle.ct_kill_exit_tm); 170 171 struct iwl_tt_mgmt *tt = &priv->thermal_throttle; 171 172 unsigned long flags; 172 173 ··· 215 214 } 216 215 } 217 216 218 - static void iwl_tt_ready_for_ct_kill(unsigned long data) 217 + static void iwl_tt_ready_for_ct_kill(struct timer_list *t) 219 218 { 220 - struct iwl_priv *priv = (struct iwl_priv *)data; 219 + struct iwl_priv *priv = from_timer(priv, t, 220 + thermal_throttle.ct_kill_waiting_tm); 221 221 struct iwl_tt_mgmt *tt = &priv->thermal_throttle; 222 222 223 223 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) ··· 614 612 memset(tt, 0, sizeof(struct iwl_tt_mgmt)); 615 613 616 614 tt->state = IWL_TI_0; 617 - setup_timer(&priv->thermal_throttle.ct_kill_exit_tm, 618 - iwl_tt_check_exit_ct_kill, (unsigned long)priv); 619 - setup_timer(&priv->thermal_throttle.ct_kill_waiting_tm, 620 - iwl_tt_ready_for_ct_kill, (unsigned long)priv); 615 + timer_setup(&priv->thermal_throttle.ct_kill_exit_tm, 616 + iwl_tt_check_exit_ct_kill, 0); 617 + timer_setup(&priv->thermal_throttle.ct_kill_waiting_tm, 618 + iwl_tt_ready_for_ct_kill, 0); 621 619 /* setup deferred ct kill work */ 622 620 INIT_WORK(&priv->tt_work, iwl_bg_tt_work); 623 621 INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter);
+3 -4
drivers/net/wireless/intel/iwlwifi/pcie/tx.c
··· 147 147 memset(ptr, 0, sizeof(*ptr)); 148 148 } 149 149 150 - static void iwl_pcie_txq_stuck_timer(unsigned long data) 150 + static void iwl_pcie_txq_stuck_timer(struct timer_list *t) 151 151 { 152 - struct iwl_txq *txq = (void *)data; 152 + struct iwl_txq *txq = from_timer(txq, t, stuck_timer); 153 153 struct iwl_trans_pcie *trans_pcie = txq->trans_pcie; 154 154 struct iwl_trans *trans = iwl_trans_pcie_get_trans(trans_pcie); 155 155 ··· 495 495 if (WARN_ON(txq->entries || txq->tfds)) 496 496 return -EINVAL; 497 497 498 - setup_timer(&txq->stuck_timer, iwl_pcie_txq_stuck_timer, 499 - (unsigned long)txq); 498 + timer_setup(&txq->stuck_timer, iwl_pcie_txq_stuck_timer, 0); 500 499 txq->trans_pcie = trans_pcie; 501 500 502 501 txq->n_window = slots_num;
+3 -5
drivers/net/wireless/intersil/hostap/hostap_ap.c
··· 185 185 186 186 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 187 187 188 - static void ap_handle_timer(unsigned long data) 188 + static void ap_handle_timer(struct timer_list *t) 189 189 { 190 - struct sta_info *sta = (struct sta_info *) data; 190 + struct sta_info *sta = from_timer(sta, t, timer); 191 191 local_info_t *local; 192 192 struct ap_data *ap; 193 193 unsigned long next_time = 0; ··· 1189 1189 } 1190 1190 1191 1191 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 1192 - init_timer(&sta->timer); 1192 + timer_setup(&sta->timer, ap_handle_timer, 0); 1193 1193 sta->timer.expires = jiffies + ap->max_inactivity; 1194 - sta->timer.data = (unsigned long) sta; 1195 - sta->timer.function = ap_handle_timer; 1196 1194 if (!ap->local->hostapd) 1197 1195 add_timer(&sta->timer); 1198 1196 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
+6 -11
drivers/net/wireless/intersil/hostap/hostap_hw.c
··· 2794 2794 } 2795 2795 2796 2796 2797 - static void hostap_passive_scan(unsigned long data) 2797 + static void hostap_passive_scan(struct timer_list *t) 2798 2798 { 2799 - local_info_t *local = (local_info_t *) data; 2799 + local_info_t *local = from_timer(local, t, passive_scan_timer); 2800 2800 struct net_device *dev = local->dev; 2801 2801 u16 chan; 2802 2802 ··· 2869 2869 * used to monitor that local->last_tick_timer is being updated. If not, 2870 2870 * interrupt busy-loop is assumed and driver tries to recover by masking out 2871 2871 * some events. */ 2872 - static void hostap_tick_timer(unsigned long data) 2872 + static void hostap_tick_timer(struct timer_list *t) 2873 2873 { 2874 2874 static unsigned long last_inquire = 0; 2875 - local_info_t *local = (local_info_t *) data; 2875 + local_info_t *local = from_timer(local, t, tick_timer); 2876 2876 local->last_tick_timer = jiffies; 2877 2877 2878 2878 /* Inquire CommTallies every 10 seconds to keep the statistics updated ··· 3225 3225 3226 3226 lib80211_crypt_info_init(&local->crypt_info, dev->name, &local->lock); 3227 3227 3228 - init_timer(&local->passive_scan_timer); 3229 - local->passive_scan_timer.data = (unsigned long) local; 3230 - local->passive_scan_timer.function = hostap_passive_scan; 3231 - 3232 - init_timer(&local->tick_timer); 3233 - local->tick_timer.data = (unsigned long) local; 3234 - local->tick_timer.function = hostap_tick_timer; 3228 + timer_setup(&local->passive_scan_timer, hostap_passive_scan, 0); 3229 + timer_setup(&local->tick_timer, hostap_tick_timer, 0); 3235 3230 local->tick_timer.expires = jiffies + 2 * HZ; 3236 3231 add_timer(&local->tick_timer); 3237 3232
+3 -3
drivers/net/wireless/intersil/orinoco/orinoco_usb.c
··· 319 319 mod_timer(timer, expire); 320 320 } 321 321 322 - static void ezusb_request_timerfn(u_long _ctx) 322 + static void ezusb_request_timerfn(struct timer_list *t) 323 323 { 324 - struct request_context *ctx = (void *) _ctx; 324 + struct request_context *ctx = from_timer(ctx, t, timer); 325 325 326 326 ctx->outurb->transfer_flags |= URB_ASYNC_UNLINK; 327 327 if (usb_unlink_urb(ctx->outurb) == -EINPROGRESS) { ··· 365 365 refcount_set(&ctx->refcount, 1); 366 366 init_completion(&ctx->done); 367 367 368 - setup_timer(&ctx->timer, ezusb_request_timerfn, (u_long)ctx); 368 + timer_setup(&ctx->timer, ezusb_request_timerfn, 0); 369 369 return ctx; 370 370 } 371 371
+1 -1
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
··· 554 554 return -EFAULT; 555 555 } 556 556 557 - mac->scan_timeout.function = (TIMER_FUNC_TYPE)qtnf_scan_timeout; 557 + mac->scan_timeout.function = qtnf_scan_timeout; 558 558 mod_timer(&mac->scan_timeout, 559 559 jiffies + QTNF_SCAN_TIMEOUT_SEC * HZ); 560 560
+1 -1
drivers/net/wireless/quantenna/qtnfmac/core.c
··· 288 288 mac->iflist[i].vifid = i; 289 289 qtnf_sta_list_init(&mac->iflist[i].sta_list); 290 290 mutex_init(&mac->mac_lock); 291 - setup_timer(&mac->scan_timeout, NULL, 0); 291 + timer_setup(&mac->scan_timeout, NULL, 0); 292 292 } 293 293 294 294 qtnf_mac_init_primary_intf(mac);
+6 -6
drivers/net/wireless/ray_cs.c
··· 569 569 local->card_status = CARD_DL_PARAM; 570 570 /* Start kernel timer to wait for dl startup to complete. */ 571 571 local->timer.expires = jiffies + HZ / 2; 572 - local->timer.function = (TIMER_FUNC_TYPE)verify_dl_startup; 572 + local->timer.function = verify_dl_startup; 573 573 add_timer(&local->timer); 574 574 dev_dbg(&link->dev, 575 575 "ray_cs dl_startup_params started timer for verify_dl_startup\n"); ··· 1947 1947 dev_dbg(&link->dev, 1948 1948 "ray_cs interrupt network \"%s\" start failed\n", 1949 1949 memtmp); 1950 - local->timer.function = (TIMER_FUNC_TYPE)start_net; 1950 + local->timer.function = start_net; 1951 1951 } else { 1952 1952 dev_dbg(&link->dev, 1953 1953 "ray_cs interrupt network \"%s\" join failed\n", 1954 1954 memtmp); 1955 - local->timer.function = (TIMER_FUNC_TYPE)join_net; 1955 + local->timer.function = join_net; 1956 1956 } 1957 1957 add_timer(&local->timer); 1958 1958 } ··· 2417 2417 2418 2418 del_timer(&local->timer); 2419 2419 if (build_auth_frame(local, local->bss_id, OPEN_AUTH_REQUEST)) { 2420 - local->timer.function = (TIMER_FUNC_TYPE)join_net; 2420 + local->timer.function = join_net; 2421 2421 } else { 2422 - local->timer.function = (TIMER_FUNC_TYPE)authenticate_timeout; 2422 + local->timer.function = authenticate_timeout; 2423 2423 } 2424 2424 local->timer.expires = jiffies + HZ * 2; 2425 2425 add_timer(&local->timer); ··· 2502 2502 2503 2503 del_timer(&local->timer); 2504 2504 local->timer.expires = jiffies + HZ * 2; 2505 - local->timer.function = (TIMER_FUNC_TYPE)join_net; 2505 + local->timer.function = join_net; 2506 2506 add_timer(&local->timer); 2507 2507 local->card_status = CARD_ASSOC_FAILED; 2508 2508 return;
+3 -4
drivers/net/wireless/ti/wlcore/main.c
··· 196 196 mutex_unlock(&wl->mutex); 197 197 } 198 198 199 - static void wl1271_rx_streaming_timer(unsigned long data) 199 + static void wl1271_rx_streaming_timer(struct timer_list *t) 200 200 { 201 - struct wl12xx_vif *wlvif = (struct wl12xx_vif *)data; 201 + struct wl12xx_vif *wlvif = from_timer(wlvif, t, rx_streaming_timer); 202 202 struct wl1271 *wl = wlvif->wl; 203 203 ieee80211_queue_work(wl->hw, &wlvif->rx_streaming_disable_work); 204 204 } ··· 2279 2279 wlcore_pending_auth_complete_work); 2280 2280 INIT_LIST_HEAD(&wlvif->list); 2281 2281 2282 - setup_timer(&wlvif->rx_streaming_timer, wl1271_rx_streaming_timer, 2283 - (unsigned long) wlvif); 2282 + timer_setup(&wlvif->rx_streaming_timer, wl1271_rx_streaming_timer, 0); 2284 2283 return 0; 2285 2284 } 2286 2285
+3 -4
drivers/net/xen-netfront.c
··· 228 228 } 229 229 230 230 231 - static void rx_refill_timeout(unsigned long data) 231 + static void rx_refill_timeout(struct timer_list *t) 232 232 { 233 - struct netfront_queue *queue = (struct netfront_queue *)data; 233 + struct netfront_queue *queue = from_timer(queue, t, rx_refill_timer); 234 234 napi_schedule(&queue->napi); 235 235 } 236 236 ··· 1605 1605 spin_lock_init(&queue->tx_lock); 1606 1606 spin_lock_init(&queue->rx_lock); 1607 1607 1608 - setup_timer(&queue->rx_refill_timer, rx_refill_timeout, 1609 - (unsigned long)queue); 1608 + timer_setup(&queue->rx_refill_timer, rx_refill_timeout, 0); 1610 1609 1611 1610 snprintf(queue->name, sizeof(queue->name), "%s-q%u", 1612 1611 queue->info->netdev->name, queue->id);
+3 -4
drivers/nfc/nfcmrvl/fw_dnld.c
··· 130 130 nfc_fw_download_done(priv->ndev->nfc_dev, priv->fw_dnld.name, error); 131 131 } 132 132 133 - static void fw_dnld_timeout(unsigned long arg) 133 + static void fw_dnld_timeout(struct timer_list *t) 134 134 { 135 - struct nfcmrvl_private *priv = (struct nfcmrvl_private *) arg; 135 + struct nfcmrvl_private *priv = from_timer(priv, t, fw_dnld.timer); 136 136 137 137 nfc_err(priv->dev, "FW loading timeout"); 138 138 priv->fw_dnld.state = STATE_RESET; ··· 538 538 } 539 539 540 540 /* Configure a timer for timeout */ 541 - setup_timer(&priv->fw_dnld.timer, fw_dnld_timeout, 542 - (unsigned long) priv); 541 + timer_setup(&priv->fw_dnld.timer, fw_dnld_timeout, 0); 543 542 mod_timer(&priv->fw_dnld.timer, 544 543 jiffies + msecs_to_jiffies(FW_DNLD_TIMEOUT)); 545 544
+3 -5
drivers/nfc/pn533/pn533.c
··· 1232 1232 return 0; 1233 1233 } 1234 1234 1235 - static void pn533_listen_mode_timer(unsigned long data) 1235 + static void pn533_listen_mode_timer(struct timer_list *t) 1236 1236 { 1237 - struct pn533 *dev = (struct pn533 *)data; 1237 + struct pn533 *dev = from_timer(dev, t, listen_timer); 1238 1238 1239 1239 dev_dbg(dev->dev, "Listen mode timeout\n"); 1240 1240 ··· 2632 2632 if (priv->wq == NULL) 2633 2633 goto error; 2634 2634 2635 - init_timer(&priv->listen_timer); 2636 - priv->listen_timer.data = (unsigned long) priv; 2637 - priv->listen_timer.function = pn533_listen_mode_timer; 2635 + timer_setup(&priv->listen_timer, pn533_listen_mode_timer, 0); 2638 2636 2639 2637 skb_queue_head_init(&priv->resp_q); 2640 2638 skb_queue_head_init(&priv->fragment_skb);
+6 -11
drivers/nfc/st-nci/ndlc.c
··· 246 246 } 247 247 EXPORT_SYMBOL(ndlc_recv); 248 248 249 - static void ndlc_t1_timeout(unsigned long data) 249 + static void ndlc_t1_timeout(struct timer_list *t) 250 250 { 251 - struct llt_ndlc *ndlc = (struct llt_ndlc *)data; 251 + struct llt_ndlc *ndlc = from_timer(ndlc, t, t1_timer); 252 252 253 253 pr_debug("\n"); 254 254 255 255 schedule_work(&ndlc->sm_work); 256 256 } 257 257 258 - static void ndlc_t2_timeout(unsigned long data) 258 + static void ndlc_t2_timeout(struct timer_list *t) 259 259 { 260 - struct llt_ndlc *ndlc = (struct llt_ndlc *)data; 260 + struct llt_ndlc *ndlc = from_timer(ndlc, t, t2_timer); 261 261 262 262 pr_debug("\n"); 263 263 ··· 282 282 *ndlc_id = ndlc; 283 283 284 284 /* initialize timers */ 285 - init_timer(&ndlc->t1_timer); 286 - ndlc->t1_timer.data = (unsigned long)ndlc; 287 - ndlc->t1_timer.function = ndlc_t1_timeout; 288 - 289 - init_timer(&ndlc->t2_timer); 290 - ndlc->t2_timer.data = (unsigned long)ndlc; 291 - ndlc->t2_timer.function = ndlc_t2_timeout; 285 + timer_setup(&ndlc->t1_timer, ndlc_t1_timeout, 0); 286 + timer_setup(&ndlc->t2_timer, ndlc_t2_timeout, 0); 292 287 293 288 skb_queue_head_init(&ndlc->rcv_q); 294 289 skb_queue_head_init(&ndlc->send_q);
+8 -11
drivers/nfc/st-nci/se.c
··· 677 677 } 678 678 EXPORT_SYMBOL(st_nci_se_io); 679 679 680 - static void st_nci_se_wt_timeout(unsigned long data) 680 + static void st_nci_se_wt_timeout(struct timer_list *t) 681 681 { 682 682 /* 683 683 * No answer from the secure element ··· 690 690 */ 691 691 /* hardware reset managed through VCC_UICC_OUT power supply */ 692 692 u8 param = 0x01; 693 - struct st_nci_info *info = (struct st_nci_info *) data; 693 + struct st_nci_info *info = from_timer(info, t, se_info.bwi_timer); 694 694 695 695 pr_debug("\n"); 696 696 ··· 708 708 info->se_info.cb(info->se_info.cb_context, NULL, 0, -ETIME); 709 709 } 710 710 711 - static void st_nci_se_activation_timeout(unsigned long data) 711 + static void st_nci_se_activation_timeout(struct timer_list *t) 712 712 { 713 - struct st_nci_info *info = (struct st_nci_info *) data; 713 + struct st_nci_info *info = from_timer(info, t, 714 + se_info.se_active_timer); 714 715 715 716 pr_debug("\n"); 716 717 ··· 726 725 727 726 init_completion(&info->se_info.req_completion); 728 727 /* initialize timers */ 729 - init_timer(&info->se_info.bwi_timer); 730 - info->se_info.bwi_timer.data = (unsigned long)info; 731 - info->se_info.bwi_timer.function = st_nci_se_wt_timeout; 728 + timer_setup(&info->se_info.bwi_timer, st_nci_se_wt_timeout, 0); 732 729 info->se_info.bwi_active = false; 733 730 734 - init_timer(&info->se_info.se_active_timer); 735 - info->se_info.se_active_timer.data = (unsigned long)info; 736 - info->se_info.se_active_timer.function = 737 - st_nci_se_activation_timeout; 731 + timer_setup(&info->se_info.se_active_timer, 732 + st_nci_se_activation_timeout, 0); 738 733 info->se_info.se_active = false; 739 734 740 735 info->se_info.xch_error = false;
+9 -10
drivers/nfc/st21nfca/se.c
··· 252 252 } 253 253 EXPORT_SYMBOL(st21nfca_hci_se_io); 254 254 255 - static void st21nfca_se_wt_timeout(unsigned long data) 255 + static void st21nfca_se_wt_timeout(struct timer_list *t) 256 256 { 257 257 /* 258 258 * No answer from the secure element ··· 265 265 */ 266 266 /* hardware reset managed through VCC_UICC_OUT power supply */ 267 267 u8 param = 0x01; 268 - struct st21nfca_hci_info *info = (struct st21nfca_hci_info *) data; 268 + struct st21nfca_hci_info *info = from_timer(info, t, 269 + se_info.bwi_timer); 269 270 270 271 pr_debug("\n"); 271 272 ··· 284 283 info->se_info.cb(info->se_info.cb_context, NULL, 0, -ETIME); 285 284 } 286 285 287 - static void st21nfca_se_activation_timeout(unsigned long data) 286 + static void st21nfca_se_activation_timeout(struct timer_list *t) 288 287 { 289 - struct st21nfca_hci_info *info = (struct st21nfca_hci_info *) data; 288 + struct st21nfca_hci_info *info = from_timer(info, t, 289 + se_info.se_active_timer); 290 290 291 291 pr_debug("\n"); 292 292 ··· 394 392 395 393 init_completion(&info->se_info.req_completion); 396 394 /* initialize timers */ 397 - init_timer(&info->se_info.bwi_timer); 398 - info->se_info.bwi_timer.data = (unsigned long)info; 399 - info->se_info.bwi_timer.function = st21nfca_se_wt_timeout; 395 + timer_setup(&info->se_info.bwi_timer, st21nfca_se_wt_timeout, 0); 400 396 info->se_info.bwi_active = false; 401 397 402 - init_timer(&info->se_info.se_active_timer); 403 - info->se_info.se_active_timer.data = (unsigned long)info; 404 - info->se_info.se_active_timer.function = st21nfca_se_activation_timeout; 398 + timer_setup(&info->se_info.se_active_timer, 399 + st21nfca_se_activation_timeout, 0); 405 400 info->se_info.se_active = false; 406 401 407 402 info->se_info.count_pipes = 0;
+4 -4
drivers/ntb/test/ntb_pingpong.c
··· 107 107 108 108 static struct dentry *pp_debugfs_dir; 109 109 110 - static void pp_ping(unsigned long ctx) 110 + static void pp_ping(struct timer_list *t) 111 111 { 112 - struct pp_ctx *pp = (void *)ctx; 112 + struct pp_ctx *pp = from_timer(pp, t, db_timer); 113 113 unsigned long irqflags; 114 114 u64 db_bits, db_mask; 115 115 u32 spad_rd, spad_wr; ··· 153 153 154 154 if (ntb_link_is_up(pp->ntb, NULL, NULL) == 1) { 155 155 dev_dbg(&pp->ntb->dev, "link is up\n"); 156 - pp_ping((unsigned long)pp); 156 + pp_ping(&pp->db_timer); 157 157 } else { 158 158 dev_dbg(&pp->ntb->dev, "link is down\n"); 159 159 del_timer(&pp->db_timer); ··· 252 252 pp->db_bits = 0; 253 253 atomic_set(&pp->count, 0); 254 254 spin_lock_init(&pp->db_lock); 255 - setup_timer(&pp->db_timer, pp_ping, (unsigned long)pp); 255 + timer_setup(&pp->db_timer, pp_ping, 0); 256 256 pp->db_delay = msecs_to_jiffies(delay_ms); 257 257 258 258 rc = ntb_set_ctx(ntb, pp, &pp_ops);
+2 -2
drivers/platform/x86/sony-laptop.c
··· 363 363 }; 364 364 365 365 /* release buttons after a short delay if pressed */ 366 - static void do_sony_laptop_release_key(unsigned long unused) 366 + static void do_sony_laptop_release_key(struct timer_list *unused) 367 367 { 368 368 struct sony_laptop_keypress kp; 369 369 unsigned long flags; ··· 470 470 goto err_dec_users; 471 471 } 472 472 473 - setup_timer(&sony_laptop_input.release_key_timer, 473 + timer_setup(&sony_laptop_input.release_key_timer, 474 474 do_sony_laptop_release_key, 0); 475 475 476 476 /* input keys */
+2 -2
drivers/pps/clients/pps-ktimer.c
··· 39 39 * The kernel timer 40 40 */ 41 41 42 - static void pps_ktimer_event(unsigned long ptr) 42 + static void pps_ktimer_event(struct timer_list *unused) 43 43 { 44 44 struct pps_event_time ts; 45 45 ··· 85 85 return -ENOMEM; 86 86 } 87 87 88 - setup_timer(&ktimer, pps_ktimer_event, 0); 88 + timer_setup(&ktimer, pps_ktimer_event, 0); 89 89 mod_timer(&ktimer, jiffies + HZ); 90 90 91 91 dev_info(pps->dev, "ktimer PPS source registered\n");
+3 -3
drivers/rtc/rtc-dev.c
··· 71 71 if (num) 72 72 rtc_handle_legacy_irq(rtc, num, RTC_UF); 73 73 } 74 - static void rtc_uie_timer(unsigned long data) 74 + static void rtc_uie_timer(struct timer_list *t) 75 75 { 76 - struct rtc_device *rtc = (struct rtc_device *)data; 76 + struct rtc_device *rtc = from_timer(rtc, t, uie_timer); 77 77 unsigned long flags; 78 78 79 79 spin_lock_irqsave(&rtc->irq_lock, flags); ··· 460 460 461 461 #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL 462 462 INIT_WORK(&rtc->uie_task, rtc_uie_task); 463 - setup_timer(&rtc->uie_timer, rtc_uie_timer, (unsigned long)rtc); 463 + timer_setup(&rtc->uie_timer, rtc_uie_timer, 0); 464 464 #endif 465 465 466 466 cdev_init(&rtc->char_dev, &rtc_dev_fops);
+8 -12
drivers/s390/block/dasd.c
··· 70 70 static void do_reload_device(struct work_struct *); 71 71 static void do_requeue_requests(struct work_struct *); 72 72 static void dasd_return_cqr_cb(struct dasd_ccw_req *, void *); 73 - static void dasd_device_timeout(unsigned long); 74 - static void dasd_block_timeout(unsigned long); 73 + static void dasd_device_timeout(struct timer_list *); 74 + static void dasd_block_timeout(struct timer_list *); 75 75 static void __dasd_process_erp(struct dasd_device *, struct dasd_ccw_req *); 76 76 static void dasd_profile_init(struct dasd_profile *, struct dentry *); 77 77 static void dasd_profile_exit(struct dasd_profile *); ··· 119 119 (void (*)(unsigned long)) dasd_device_tasklet, 120 120 (unsigned long) device); 121 121 INIT_LIST_HEAD(&device->ccw_queue); 122 - init_timer(&device->timer); 123 - device->timer.function = dasd_device_timeout; 124 - device->timer.data = (unsigned long) device; 122 + timer_setup(&device->timer, dasd_device_timeout, 0); 125 123 INIT_WORK(&device->kick_work, do_kick_device); 126 124 INIT_WORK(&device->restore_device, do_restore_device); 127 125 INIT_WORK(&device->reload_device, do_reload_device); ··· 161 163 (unsigned long) block); 162 164 INIT_LIST_HEAD(&block->ccw_queue); 163 165 spin_lock_init(&block->queue_lock); 164 - init_timer(&block->timer); 165 - block->timer.function = dasd_block_timeout; 166 - block->timer.data = (unsigned long) block; 166 + timer_setup(&block->timer, dasd_block_timeout, 0); 167 167 spin_lock_init(&block->profile.lock); 168 168 169 169 return block; ··· 1556 1560 * The head of the ccw queue will have status DASD_CQR_IN_IO for 1), 1557 1561 * DASD_CQR_QUEUED for 2) and 3). 1558 1562 */ 1559 - static void dasd_device_timeout(unsigned long ptr) 1563 + static void dasd_device_timeout(struct timer_list *t) 1560 1564 { 1561 1565 unsigned long flags; 1562 1566 struct dasd_device *device; 1563 1567 1564 - device = (struct dasd_device *) ptr; 1568 + device = from_timer(device, t, timer); 1565 1569 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); 1566 1570 /* re-activate request queue */ 1567 1571 dasd_device_remove_stop_bits(device, DASD_STOPPED_PENDING); ··· 2624 2628 * is waiting for something that may not come reliably, (e.g. a state 2625 2629 * change interrupt) 2626 2630 */ 2627 - static void dasd_block_timeout(unsigned long ptr) 2631 + static void dasd_block_timeout(struct timer_list *t) 2628 2632 { 2629 2633 unsigned long flags; 2630 2634 struct dasd_block *block; 2631 2635 2632 - block = (struct dasd_block *) ptr; 2636 + block = from_timer(block, t, timer); 2633 2637 spin_lock_irqsave(get_ccwdev_lock(block->base->cdev), flags); 2634 2638 /* re-activate request queue */ 2635 2639 dasd_device_remove_stop_bits(block->base, DASD_STOPPED_PENDING);
+2 -2
drivers/s390/char/sclp.c
··· 158 158 __sclp_set_request_timer(unsigned long time, void (*cb)(struct timer_list *)) 159 159 { 160 160 del_timer(&sclp_request_timer); 161 - sclp_request_timer.function = (TIMER_FUNC_TYPE)cb; 161 + sclp_request_timer.function = cb; 162 162 sclp_request_timer.expires = jiffies + time; 163 163 add_timer(&sclp_request_timer); 164 164 } ··· 566 566 if (timer_pending(&sclp_request_timer) && 567 567 get_tod_clock_fast() > timeout && 568 568 del_timer(&sclp_request_timer)) 569 - sclp_request_timer.function((TIMER_DATA_TYPE)&sclp_request_timer); 569 + sclp_request_timer.function(&sclp_request_timer); 570 570 cpu_relax(); 571 571 } 572 572 local_irq_disable();
+5 -6
drivers/s390/net/fsm.c
··· 129 129 } 130 130 131 131 static void 132 - fsm_expire_timer(fsm_timer *this) 132 + fsm_expire_timer(struct timer_list *t) 133 133 { 134 + fsm_timer *this = from_timer(this, t, tl); 134 135 #if FSM_TIMER_DEBUG 135 136 printk(KERN_DEBUG "fsm(%s): Timer %p expired\n", 136 137 this->fi->name, this); ··· 143 142 fsm_settimer(fsm_instance *fi, fsm_timer *this) 144 143 { 145 144 this->fi = fi; 146 - this->tl.function = (void *)fsm_expire_timer; 147 - this->tl.data = (long)this; 148 145 #if FSM_TIMER_DEBUG 149 146 printk(KERN_DEBUG "fsm(%s): Create timer %p\n", fi->name, 150 147 this); 151 148 #endif 152 - init_timer(&this->tl); 149 + timer_setup(&this->tl, fsm_expire_timer, 0); 153 150 } 154 151 155 152 void ··· 169 170 this->fi->name, this, millisec); 170 171 #endif 171 172 172 - setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this); 173 + timer_setup(&this->tl, fsm_expire_timer, 0); 173 174 this->expire_event = event; 174 175 this->event_arg = arg; 175 176 this->tl.expires = jiffies + (millisec * HZ) / 1000; ··· 188 189 #endif 189 190 190 191 del_timer(&this->tl); 191 - setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this); 192 + timer_setup(&this->tl, fsm_expire_timer, 0); 192 193 this->expire_event = event; 193 194 this->event_arg = arg; 194 195 this->tl.expires = jiffies + (millisec * HZ) / 1000;
+2 -2
drivers/s390/scsi/zfcp_fsf.c
··· 34 34 static void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, 35 35 unsigned long timeout) 36 36 { 37 - fsf_req->timer.function = (TIMER_FUNC_TYPE)zfcp_fsf_request_timeout_handler; 37 + fsf_req->timer.function = zfcp_fsf_request_timeout_handler; 38 38 fsf_req->timer.expires = jiffies + timeout; 39 39 add_timer(&fsf_req->timer); 40 40 } ··· 42 42 static void zfcp_fsf_start_erp_timer(struct zfcp_fsf_req *fsf_req) 43 43 { 44 44 BUG_ON(!fsf_req->erp_action); 45 - fsf_req->timer.function = (TIMER_FUNC_TYPE)zfcp_erp_timeout_handler; 45 + fsf_req->timer.function = zfcp_erp_timeout_handler; 46 46 fsf_req->timer.expires = jiffies + 30 * HZ; 47 47 add_timer(&fsf_req->timer); 48 48 }
+1 -1
drivers/scsi/aic94xx/aic94xx_hwi.c
··· 1175 1175 struct asd_ascb *ascb; 1176 1176 list_for_each_entry(ascb, list, list) { 1177 1177 if (!ascb->uldd_timer) { 1178 - ascb->timer.function = (TIMER_FUNC_TYPE)asd_ascb_timedout; 1178 + ascb->timer.function = asd_ascb_timedout; 1179 1179 ascb->timer.expires = jiffies + AIC94XX_SCB_TIMEOUT; 1180 1180 add_timer(&ascb->timer); 1181 1181 }
+1 -1
drivers/scsi/aic94xx/aic94xx_tmf.c
··· 42 42 ascb->tasklet_complete = tasklet_complete; 43 43 ascb->uldd_timer = 1; 44 44 45 - ascb->timer.function = (TIMER_FUNC_TYPE)timed_out; 45 + ascb->timer.function = timed_out; 46 46 ascb->timer.expires = jiffies + AIC94XX_SCB_TIMEOUT; 47 47 48 48 add_timer(&ascb->timer);
+5 -9
drivers/scsi/arcmsr/arcmsr_hba.c
··· 101 101 static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb); 102 102 static void arcmsr_hbaA_flush_cache(struct AdapterControlBlock *acb); 103 103 static void arcmsr_hbaB_flush_cache(struct AdapterControlBlock *acb); 104 - static void arcmsr_request_device_map(unsigned long pacb); 104 + static void arcmsr_request_device_map(struct timer_list *t); 105 105 static void arcmsr_hbaA_request_device_map(struct AdapterControlBlock *acb); 106 106 static void arcmsr_hbaB_request_device_map(struct AdapterControlBlock *acb); 107 107 static void arcmsr_hbaC_request_device_map(struct AdapterControlBlock *acb); ··· 837 837 atomic_set(&acb->rq_map_token, 16); 838 838 atomic_set(&acb->ante_token_value, 16); 839 839 acb->fw_flag = FW_NORMAL; 840 - init_timer(&acb->eternal_timer); 840 + timer_setup(&acb->eternal_timer, arcmsr_request_device_map, 0); 841 841 acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); 842 - acb->eternal_timer.data = (unsigned long) acb; 843 - acb->eternal_timer.function = &arcmsr_request_device_map; 844 842 add_timer(&acb->eternal_timer); 845 843 if(arcmsr_alloc_sysfs_attr(acb)) 846 844 goto out_free_sysfs; ··· 928 930 atomic_set(&acb->rq_map_token, 16); 929 931 atomic_set(&acb->ante_token_value, 16); 930 932 acb->fw_flag = FW_NORMAL; 931 - init_timer(&acb->eternal_timer); 933 + timer_setup(&acb->eternal_timer, arcmsr_request_device_map, 0); 932 934 acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); 933 - acb->eternal_timer.data = (unsigned long) acb; 934 - acb->eternal_timer.function = &arcmsr_request_device_map; 935 935 add_timer(&acb->eternal_timer); 936 936 return 0; 937 937 controller_stop: ··· 3455 3459 } 3456 3460 } 3457 3461 3458 - static void arcmsr_request_device_map(unsigned long pacb) 3462 + static void arcmsr_request_device_map(struct timer_list *t) 3459 3463 { 3460 - struct AdapterControlBlock *acb = (struct AdapterControlBlock *)pacb; 3464 + struct AdapterControlBlock *acb = from_timer(acb, t, eternal_timer); 3461 3465 switch (acb->adapter_type) { 3462 3466 case ACB_ADAPTER_TYPE_A: { 3463 3467 arcmsr_hbaA_request_device_map(acb);
+3 -5
drivers/scsi/arm/fas216.c
··· 2318 2318 * Error handler timeout function. Indicate that we timed out, 2319 2319 * and wake up any error handler process so it can continue. 2320 2320 */ 2321 - static void fas216_eh_timer(unsigned long data) 2321 + static void fas216_eh_timer(struct timer_list *t) 2322 2322 { 2323 - FAS216_Info *info = (FAS216_Info *)data; 2323 + FAS216_Info *info = from_timer(info, t, eh_timer); 2324 2324 2325 2325 fas216_log(info, LOG_ERROR, "error handling timed out\n"); 2326 2326 ··· 2849 2849 info->rst_dev_status = -1; 2850 2850 info->rst_bus_status = -1; 2851 2851 init_waitqueue_head(&info->eh_wait); 2852 - init_timer(&info->eh_timer); 2853 - info->eh_timer.data = (unsigned long)info; 2854 - info->eh_timer.function = fas216_eh_timer; 2852 + timer_setup(&info->eh_timer, fas216_eh_timer, 0); 2855 2853 2856 2854 spin_lock_init(&info->host_lock); 2857 2855
+2 -2
drivers/scsi/be2iscsi/be_main.c
··· 5279 5279 if (!test_bit(BEISCSI_HBA_UER_SUPP, &phba->state)) 5280 5280 return; 5281 5281 /* modify this timer to check TPE */ 5282 - phba->hw_check.function = (TIMER_FUNC_TYPE)beiscsi_hw_tpe_check; 5282 + phba->hw_check.function = beiscsi_hw_tpe_check; 5283 5283 } 5284 5284 5285 5285 mod_timer(&phba->hw_check, ··· 5367 5367 * Timer function gets modified for TPE detection. 5368 5368 * Always reinit to do health check first. 5369 5369 */ 5370 - phba->hw_check.function = (TIMER_FUNC_TYPE)beiscsi_hw_health_check; 5370 + phba->hw_check.function = beiscsi_hw_health_check; 5371 5371 mod_timer(&phba->hw_check, 5372 5372 jiffies + msecs_to_jiffies(BEISCSI_UE_DETECT_INTERVAL)); 5373 5373 return 0;
+3 -5
drivers/scsi/bfa/bfad.c
··· 692 692 } 693 693 694 694 void 695 - bfad_bfa_tmo(unsigned long data) 695 + bfad_bfa_tmo(struct timer_list *t) 696 696 { 697 - struct bfad_s *bfad = (struct bfad_s *) data; 697 + struct bfad_s *bfad = from_timer(bfad, t, hal_tmo); 698 698 unsigned long flags; 699 699 struct list_head doneq; 700 700 ··· 719 719 void 720 720 bfad_init_timer(struct bfad_s *bfad) 721 721 { 722 - init_timer(&bfad->hal_tmo); 723 - bfad->hal_tmo.function = bfad_bfa_tmo; 724 - bfad->hal_tmo.data = (unsigned long)bfad; 722 + timer_setup(&bfad->hal_tmo, bfad_bfa_tmo, 0); 725 723 726 724 mod_timer(&bfad->hal_tmo, 727 725 jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));
+1 -1
drivers/scsi/bfa/bfad_drv.h
··· 314 314 void bfad_remove_intr(struct bfad_s *bfad); 315 315 void bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg); 316 316 bfa_status_t bfad_hal_mem_alloc(struct bfad_s *bfad); 317 - void bfad_bfa_tmo(unsigned long data); 317 + void bfad_bfa_tmo(struct timer_list *t); 318 318 void bfad_init_timer(struct bfad_s *bfad); 319 319 int bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad); 320 320 void bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
+8 -8
drivers/scsi/bnx2fc/bnx2fc_tgt.c
··· 14 14 */ 15 15 16 16 #include "bnx2fc.h" 17 - static void bnx2fc_upld_timer(unsigned long data); 18 - static void bnx2fc_ofld_timer(unsigned long data); 17 + static void bnx2fc_upld_timer(struct timer_list *t); 18 + static void bnx2fc_ofld_timer(struct timer_list *t); 19 19 static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, 20 20 struct fcoe_port *port, 21 21 struct fc_rport_priv *rdata); ··· 27 27 struct bnx2fc_rport *tgt); 28 28 static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id); 29 29 30 - static void bnx2fc_upld_timer(unsigned long data) 30 + static void bnx2fc_upld_timer(struct timer_list *t) 31 31 { 32 32 33 - struct bnx2fc_rport *tgt = (struct bnx2fc_rport *)data; 33 + struct bnx2fc_rport *tgt = from_timer(tgt, t, upld_timer); 34 34 35 35 BNX2FC_TGT_DBG(tgt, "upld_timer - Upload compl not received!!\n"); 36 36 /* fake upload completion */ ··· 40 40 wake_up_interruptible(&tgt->upld_wait); 41 41 } 42 42 43 - static void bnx2fc_ofld_timer(unsigned long data) 43 + static void bnx2fc_ofld_timer(struct timer_list *t) 44 44 { 45 45 46 - struct bnx2fc_rport *tgt = (struct bnx2fc_rport *)data; 46 + struct bnx2fc_rport *tgt = from_timer(tgt, t, ofld_timer); 47 47 48 48 BNX2FC_TGT_DBG(tgt, "entered bnx2fc_ofld_timer\n"); 49 49 /* NOTE: This function should never be called, as ··· 65 65 66 66 static void bnx2fc_ofld_wait(struct bnx2fc_rport *tgt) 67 67 { 68 - setup_timer(&tgt->ofld_timer, bnx2fc_ofld_timer, (unsigned long)tgt); 68 + timer_setup(&tgt->ofld_timer, bnx2fc_ofld_timer, 0); 69 69 mod_timer(&tgt->ofld_timer, jiffies + BNX2FC_FW_TIMEOUT); 70 70 71 71 wait_event_interruptible(tgt->ofld_wait, ··· 277 277 278 278 static void bnx2fc_upld_wait(struct bnx2fc_rport *tgt) 279 279 { 280 - setup_timer(&tgt->upld_timer, bnx2fc_upld_timer, (unsigned long)tgt); 280 + timer_setup(&tgt->upld_timer, bnx2fc_upld_timer, 0); 281 281 mod_timer(&tgt->upld_timer, jiffies + BNX2FC_FW_TIMEOUT); 282 282 wait_event_interruptible(tgt->upld_wait, 283 283 (test_bit(
+2 -2
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
··· 586 586 cxgbi_sock_get(csk); 587 587 spin_lock_bh(&csk->lock); 588 588 if (rpl->status == CPL_ERR_CONN_EXIST && 589 - csk->retry_timer.function != (TIMER_FUNC_TYPE)act_open_retry_timer) { 590 - csk->retry_timer.function = (TIMER_FUNC_TYPE)act_open_retry_timer; 589 + csk->retry_timer.function != act_open_retry_timer) { 590 + csk->retry_timer.function = act_open_retry_timer; 591 591 mod_timer(&csk->retry_timer, jiffies + HZ / 2); 592 592 } else 593 593 cxgbi_sock_fail_act_open(csk,
+2 -2
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
··· 963 963 spin_lock_bh(&csk->lock); 964 964 965 965 if (status == CPL_ERR_CONN_EXIST && 966 - csk->retry_timer.function != (TIMER_FUNC_TYPE)csk_act_open_retry_timer) { 967 - csk->retry_timer.function = (TIMER_FUNC_TYPE)csk_act_open_retry_timer; 966 + csk->retry_timer.function != csk_act_open_retry_timer) { 967 + csk->retry_timer.function = csk_act_open_retry_timer; 968 968 mod_timer(&csk->retry_timer, jiffies + HZ / 2); 969 969 } else 970 970 cxgbi_sock_fail_act_open(csk,
+4 -6
drivers/scsi/esas2r/esas2r_main.c
··· 1631 1631 } 1632 1632 } 1633 1633 1634 - static void esas2r_timer_callback(unsigned long context); 1634 + static void esas2r_timer_callback(struct timer_list *t); 1635 1635 1636 1636 void esas2r_kickoff_timer(struct esas2r_adapter *a) 1637 1637 { 1638 - init_timer(&a->timer); 1638 + timer_setup(&a->timer, esas2r_timer_callback, 0); 1639 1639 1640 - a->timer.function = esas2r_timer_callback; 1641 - a->timer.data = (unsigned long)a; 1642 1640 a->timer.expires = jiffies + 1643 1641 msecs_to_jiffies(100); 1644 1642 1645 1643 add_timer(&a->timer); 1646 1644 } 1647 1645 1648 - static void esas2r_timer_callback(unsigned long context) 1646 + static void esas2r_timer_callback(struct timer_list *t) 1649 1647 { 1650 - struct esas2r_adapter *a = (struct esas2r_adapter *)context; 1648 + struct esas2r_adapter *a = from_timer(a, t, timer); 1651 1649 1652 1650 set_bit(AF2_TIMER_TICK, &a->flags2); 1653 1651
+4 -4
drivers/scsi/fcoe/fcoe_ctlr.c
··· 49 49 #define FCOE_CTLR_MIN_FKA 500 /* min keep alive (mS) */ 50 50 #define FCOE_CTLR_DEF_FKA FIP_DEF_FKA /* default keep alive (mS) */ 51 51 52 - static void fcoe_ctlr_timeout(unsigned long); 52 + static void fcoe_ctlr_timeout(struct timer_list *); 53 53 static void fcoe_ctlr_timer_work(struct work_struct *); 54 54 static void fcoe_ctlr_recv_work(struct work_struct *); 55 55 static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *); ··· 156 156 mutex_init(&fip->ctlr_mutex); 157 157 spin_lock_init(&fip->ctlr_lock); 158 158 fip->flogi_oxid = FC_XID_UNKNOWN; 159 - setup_timer(&fip->timer, fcoe_ctlr_timeout, (unsigned long)fip); 159 + timer_setup(&fip->timer, fcoe_ctlr_timeout, 0); 160 160 INIT_WORK(&fip->timer_work, fcoe_ctlr_timer_work); 161 161 INIT_WORK(&fip->recv_work, fcoe_ctlr_recv_work); 162 162 skb_queue_head_init(&fip->fip_recv_list); ··· 1786 1786 * fcoe_ctlr_timeout() - FIP timeout handler 1787 1787 * @arg: The FCoE controller that timed out 1788 1788 */ 1789 - static void fcoe_ctlr_timeout(unsigned long arg) 1789 + static void fcoe_ctlr_timeout(struct timer_list *t) 1790 1790 { 1791 - struct fcoe_ctlr *fip = (struct fcoe_ctlr *)arg; 1791 + struct fcoe_ctlr *fip = from_timer(fip, t, timer); 1792 1792 1793 1793 schedule_work(&fip->timer_work); 1794 1794 }
+6 -8
drivers/scsi/fnic/fnic_main.c
··· 407 407 return err; 408 408 } 409 409 410 - static void fnic_notify_timer(unsigned long data) 410 + static void fnic_notify_timer(struct timer_list *t) 411 411 { 412 - struct fnic *fnic = (struct fnic *)data; 412 + struct fnic *fnic = from_timer(fnic, t, notify_timer); 413 413 414 414 fnic_handle_link_event(fnic); 415 415 mod_timer(&fnic->notify_timer, 416 416 round_jiffies(jiffies + FNIC_NOTIFY_TIMER_PERIOD)); 417 417 } 418 418 419 - static void fnic_fip_notify_timer(unsigned long data) 419 + static void fnic_fip_notify_timer(struct timer_list *t) 420 420 { 421 - struct fnic *fnic = (struct fnic *)data; 421 + struct fnic *fnic = from_timer(fnic, t, fip_timer); 422 422 423 423 fnic_handle_fip_timer(fnic); 424 424 } ··· 777 777 vnic_dev_add_addr(fnic->vdev, fnic->ctlr.ctl_src_addr); 778 778 fnic->set_vlan = fnic_set_vlan; 779 779 fcoe_ctlr_init(&fnic->ctlr, FIP_MODE_AUTO); 780 - setup_timer(&fnic->fip_timer, fnic_fip_notify_timer, 781 - (unsigned long)fnic); 780 + timer_setup(&fnic->fip_timer, fnic_fip_notify_timer, 0); 782 781 spin_lock_init(&fnic->vlans_lock); 783 782 INIT_WORK(&fnic->fip_frame_work, fnic_handle_fip_frame); 784 783 INIT_WORK(&fnic->event_work, fnic_handle_event); ··· 808 809 809 810 /* Setup notify timer when using MSI interrupts */ 810 811 if (vnic_dev_get_intr_mode(fnic->vdev) == VNIC_DEV_INTR_MODE_MSI) 811 - setup_timer(&fnic->notify_timer, 812 - fnic_notify_timer, (unsigned long)fnic); 812 + timer_setup(&fnic->notify_timer, fnic_notify_timer, 0); 813 813 814 814 /* allocate RQ buffers and post them to RQ*/ 815 815 for (i = 0; i < fnic->rq_count; i++) {
+2 -2
drivers/scsi/hisi_sas/hisi_sas_main.c
··· 839 839 } 840 840 task->task_done = hisi_sas_task_done; 841 841 842 - task->slow_task->timer.function = (TIMER_FUNC_TYPE)hisi_sas_tmf_timedout; 842 + task->slow_task->timer.function = hisi_sas_tmf_timedout; 843 843 task->slow_task->timer.expires = jiffies + TASK_TIMEOUT*HZ; 844 844 add_timer(&task->slow_task->timer); 845 845 ··· 1451 1451 task->dev = device; 1452 1452 task->task_proto = device->tproto; 1453 1453 task->task_done = hisi_sas_task_done; 1454 - task->slow_task->timer.function = (TIMER_FUNC_TYPE)hisi_sas_tmf_timedout; 1454 + task->slow_task->timer.function = hisi_sas_tmf_timedout; 1455 1455 task->slow_task->timer.expires = jiffies + msecs_to_jiffies(110); 1456 1456 add_timer(&task->slow_task->timer); 1457 1457
+3 -3
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
··· 1268 1268 } 1269 1269 } 1270 1270 1271 - hisi_hba->timer.function = (TIMER_FUNC_TYPE)link_timeout_disable_link; 1271 + hisi_hba->timer.function = link_timeout_disable_link; 1272 1272 mod_timer(&hisi_hba->timer, jiffies + msecs_to_jiffies(900)); 1273 1273 } 1274 1274 ··· 1289 1289 } 1290 1290 } 1291 1291 1292 - hisi_hba->timer.function = (TIMER_FUNC_TYPE)link_timeout_enable_link; 1292 + hisi_hba->timer.function = link_timeout_enable_link; 1293 1293 mod_timer(&hisi_hba->timer, jiffies + msecs_to_jiffies(100)); 1294 1294 } 1295 1295 1296 1296 static void set_link_timer_quirk(struct hisi_hba *hisi_hba) 1297 1297 { 1298 - hisi_hba->timer.function = (TIMER_FUNC_TYPE)link_timeout_disable_link; 1298 + hisi_hba->timer.function = link_timeout_disable_link; 1299 1299 hisi_hba->timer.expires = jiffies + msecs_to_jiffies(1000); 1300 1300 add_timer(&hisi_hba->timer); 1301 1301 }
+4 -4
drivers/scsi/ipr.c
··· 997 997 ipr_cmd->done = done; 998 998 999 999 ipr_cmd->timer.expires = jiffies + timeout; 1000 - ipr_cmd->timer.function = (TIMER_FUNC_TYPE)timeout_func; 1000 + ipr_cmd->timer.function = timeout_func; 1001 1001 1002 1002 add_timer(&ipr_cmd->timer); 1003 1003 ··· 8312 8312 ipr_cmd->done = ipr_reset_ioa_job; 8313 8313 8314 8314 ipr_cmd->timer.expires = jiffies + timeout; 8315 - ipr_cmd->timer.function = (TIMER_FUNC_TYPE)ipr_reset_timer_done; 8315 + ipr_cmd->timer.function = ipr_reset_timer_done; 8316 8316 add_timer(&ipr_cmd->timer); 8317 8317 } 8318 8318 ··· 8397 8397 } 8398 8398 8399 8399 ipr_cmd->timer.expires = jiffies + stage_time * HZ; 8400 - ipr_cmd->timer.function = (TIMER_FUNC_TYPE)ipr_oper_timeout; 8400 + ipr_cmd->timer.function = ipr_oper_timeout; 8401 8401 ipr_cmd->done = ipr_reset_ioa_job; 8402 8402 add_timer(&ipr_cmd->timer); 8403 8403 ··· 8468 8468 } 8469 8469 8470 8470 ipr_cmd->timer.expires = jiffies + (ioa_cfg->transop_timeout * HZ); 8471 - ipr_cmd->timer.function = (TIMER_FUNC_TYPE)ipr_oper_timeout; 8471 + ipr_cmd->timer.function = ipr_oper_timeout; 8472 8472 ipr_cmd->done = ipr_reset_ioa_job; 8473 8473 add_timer(&ipr_cmd->timer); 8474 8474 list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_pending_q);
+3 -3
drivers/scsi/libfc/fc_fcp.c
··· 1214 1214 fsp->seq_ptr = seq; 1215 1215 fc_fcp_pkt_hold(fsp); /* hold for fc_fcp_pkt_destroy */ 1216 1216 1217 - fsp->timer.function = (TIMER_FUNC_TYPE)fc_fcp_timeout; 1217 + fsp->timer.function = fc_fcp_timeout; 1218 1218 if (rpriv->flags & FC_RP_FLAGS_REC_SUPPORTED) 1219 1219 fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp)); 1220 1220 ··· 1307 1307 return; 1308 1308 if (fc_fcp_lock_pkt(fsp)) 1309 1309 return; 1310 - fsp->timer.function = (TIMER_FUNC_TYPE)fc_lun_reset_send; 1310 + fsp->timer.function = fc_lun_reset_send; 1311 1311 fc_fcp_timer_set(fsp, get_fsp_rec_tov(fsp)); 1312 1312 fc_fcp_unlock_pkt(fsp); 1313 1313 } ··· 1445 1445 if (fsp->lp->qfull) { 1446 1446 FC_FCP_DBG(fsp, "fcp timeout, resetting timer delay %d\n", 1447 1447 fsp->timer_delay); 1448 - fsp->timer.function = (TIMER_FUNC_TYPE)fc_fcp_timeout; 1448 + fsp->timer.function = fc_fcp_timeout; 1449 1449 fc_fcp_timer_set(fsp, fsp->timer_delay); 1450 1450 goto unlock; 1451 1451 }
+1 -1
drivers/scsi/libsas/sas_expander.c
··· 92 92 93 93 task->task_done = smp_task_done; 94 94 95 - task->slow_task->timer.function = (TIMER_FUNC_TYPE)smp_task_timedout; 95 + task->slow_task->timer.function = smp_task_timedout; 96 96 task->slow_task->timer.expires = jiffies + SMP_TIMEOUT*HZ; 97 97 add_timer(&task->slow_task->timer); 98 98
+1 -1
drivers/scsi/libsas/sas_scsi_host.c
··· 919 919 return; 920 920 if (!del_timer(&slow->timer)) 921 921 return; 922 - slow->timer.function((TIMER_DATA_TYPE)&slow->timer); 922 + slow->timer.function(&slow->timer); 923 923 return; 924 924 } 925 925
+2 -2
drivers/scsi/mvsas/mv_sas.c
··· 1310 1310 memcpy(&task->ssp_task, parameter, para_len); 1311 1311 task->task_done = mvs_task_done; 1312 1312 1313 - task->slow_task->timer.function = (TIMER_FUNC_TYPE)mvs_tmf_timedout; 1313 + task->slow_task->timer.function = mvs_tmf_timedout; 1314 1314 task->slow_task->timer.expires = jiffies + MVS_TASK_TIMEOUT*HZ; 1315 1315 add_timer(&task->slow_task->timer); 1316 1316 ··· 2020 2020 MVS_CHIP_DISP->write_port_irq_mask(mvi, phy_no, 2021 2021 tmp | PHYEV_SIG_FIS); 2022 2022 if (phy->timer.function == NULL) { 2023 - phy->timer.function = (TIMER_FUNC_TYPE)mvs_sig_time_out; 2023 + phy->timer.function = mvs_sig_time_out; 2024 2024 phy->timer.expires = jiffies + 5*HZ; 2025 2025 add_timer(&phy->timer); 2026 2026 }
+3 -5
drivers/scsi/ncr53c8xx.c
··· 8093 8093 return IRQ_HANDLED; 8094 8094 } 8095 8095 8096 - static void ncr53c8xx_timeout(unsigned long npref) 8096 + static void ncr53c8xx_timeout(struct timer_list *t) 8097 8097 { 8098 - struct ncb *np = (struct ncb *) npref; 8098 + struct ncb *np = from_timer(np, t, timer); 8099 8099 unsigned long flags; 8100 8100 struct scsi_cmnd *done_list; 8101 8101 ··· 8357 8357 if (!np->scripth0) 8358 8358 goto attach_error; 8359 8359 8360 - init_timer(&np->timer); 8361 - np->timer.data = (unsigned long) np; 8362 - np->timer.function = ncr53c8xx_timeout; 8360 + timer_setup(&np->timer, ncr53c8xx_timeout, 0); 8363 8361 8364 8362 /* Try to map the controller chip to virtual and physical memory. */ 8365 8363
+2 -2
drivers/scsi/pm8001/pm8001_sas.c
··· 695 695 task->task_proto = dev->tproto; 696 696 memcpy(&task->ssp_task, parameter, para_len); 697 697 task->task_done = pm8001_task_done; 698 - task->slow_task->timer.function = (TIMER_FUNC_TYPE)pm8001_tmf_timedout; 698 + task->slow_task->timer.function = pm8001_tmf_timedout; 699 699 task->slow_task->timer.expires = jiffies + PM8001_TASK_TIMEOUT*HZ; 700 700 add_timer(&task->slow_task->timer); 701 701 ··· 781 781 task->dev = dev; 782 782 task->task_proto = dev->tproto; 783 783 task->task_done = pm8001_task_done; 784 - task->slow_task->timer.function = (TIMER_FUNC_TYPE)pm8001_tmf_timedout; 784 + task->slow_task->timer.function = pm8001_tmf_timedout; 785 785 task->slow_task->timer.expires = jiffies + PM8001_TASK_TIMEOUT * HZ; 786 786 add_timer(&task->slow_task->timer); 787 787
+5 -5
drivers/scsi/pmcraid.c
··· 604 604 605 605 cmd->time_left = msecs_to_jiffies(PMCRAID_BIST_TIMEOUT); 606 606 cmd->timer.expires = jiffies + msecs_to_jiffies(PMCRAID_BIST_TIMEOUT); 607 - cmd->timer.function = (TIMER_FUNC_TYPE)pmcraid_bist_done; 607 + cmd->timer.function = pmcraid_bist_done; 608 608 add_timer(&cmd->timer); 609 609 } 610 610 ··· 636 636 /* restart timer if some more time is available to wait */ 637 637 cmd->time_left -= PMCRAID_CHECK_FOR_RESET_TIMEOUT; 638 638 cmd->timer.expires = jiffies + PMCRAID_CHECK_FOR_RESET_TIMEOUT; 639 - cmd->timer.function = (TIMER_FUNC_TYPE)pmcraid_reset_alert_done; 639 + cmd->timer.function = pmcraid_reset_alert_done; 640 640 add_timer(&cmd->timer); 641 641 } 642 642 } ··· 673 673 */ 674 674 cmd->time_left = PMCRAID_RESET_TIMEOUT; 675 675 cmd->timer.expires = jiffies + PMCRAID_CHECK_FOR_RESET_TIMEOUT; 676 - cmd->timer.function = (TIMER_FUNC_TYPE)pmcraid_reset_alert_done; 676 + cmd->timer.function = pmcraid_reset_alert_done; 677 677 add_timer(&cmd->timer); 678 678 679 679 iowrite32(DOORBELL_IOA_RESET_ALERT, ··· 923 923 if (timeout_func) { 924 924 /* setup timeout handler */ 925 925 cmd->timer.expires = jiffies + timeout; 926 - cmd->timer.function = (TIMER_FUNC_TYPE)timeout_func; 926 + cmd->timer.function = timeout_func; 927 927 add_timer(&cmd->timer); 928 928 } 929 929 ··· 1951 1951 cmd->cmd_done = pmcraid_ioa_reset; 1952 1952 cmd->timer.expires = jiffies + 1953 1953 msecs_to_jiffies(PMCRAID_TRANSOP_TIMEOUT); 1954 - cmd->timer.function = (TIMER_FUNC_TYPE)pmcraid_timeout_handler; 1954 + cmd->timer.function = pmcraid_timeout_handler; 1955 1955 1956 1956 if (!timer_pending(&cmd->timer)) 1957 1957 add_timer(&cmd->timer);
+3 -5
drivers/scsi/sym53c8xx_2/sym_glue.c
··· 565 565 /* 566 566 * Linux entry point of the timer handler 567 567 */ 568 - static void sym53c8xx_timer(unsigned long npref) 568 + static void sym53c8xx_timer(struct timer_list *t) 569 569 { 570 - struct sym_hcb *np = (struct sym_hcb *)npref; 570 + struct sym_hcb *np = from_timer(np, t, s.timer); 571 571 unsigned long flags; 572 572 573 573 spin_lock_irqsave(np->s.host->host_lock, flags); ··· 1351 1351 /* 1352 1352 * Start the timer daemon 1353 1353 */ 1354 - init_timer(&np->s.timer); 1355 - np->s.timer.data = (unsigned long) np; 1356 - np->s.timer.function = sym53c8xx_timer; 1354 + timer_setup(&np->s.timer, sym53c8xx_timer, 0); 1357 1355 np->s.lasttime=0; 1358 1356 sym_timer (np); 1359 1357
+3 -4
drivers/staging/greybus/operation.c
··· 293 293 gb_operation_put(operation); 294 294 } 295 295 296 - static void gb_operation_timeout(unsigned long arg) 296 + static void gb_operation_timeout(struct timer_list *t) 297 297 { 298 - struct gb_operation *operation = (void *)arg; 298 + struct gb_operation *operation = from_timer(operation, t, timer); 299 299 300 300 if (gb_operation_result_set(operation, -ETIMEDOUT)) { 301 301 /* ··· 540 540 goto err_request; 541 541 } 542 542 543 - setup_timer(&operation->timer, gb_operation_timeout, 544 - (unsigned long)operation); 543 + timer_setup(&operation->timer, gb_operation_timeout, 0); 545 544 } 546 545 547 546 operation->flags = op_flags;
+1 -1
drivers/staging/irda/include/net/irda/timer.h
··· 75 75 static inline void irda_start_timer(struct timer_list *ptimer, int timeout, 76 76 void (*callback)(struct timer_list *)) 77 77 { 78 - ptimer->function = (TIMER_FUNC_TYPE) callback; 78 + ptimer->function = callback; 79 79 80 80 /* Set new value for timer (update or add timer). 81 81 * We use mod_timer() because it's more efficient and also
+3 -3
drivers/staging/lustre/lnet/lnet/net_fault.c
··· 700 700 } 701 701 702 702 static void 703 - delay_timer_cb(unsigned long arg) 703 + delay_timer_cb(struct timer_list *t) 704 704 { 705 - struct lnet_delay_rule *rule = (struct lnet_delay_rule *)arg; 705 + struct lnet_delay_rule *rule = from_timer(rule, t, dl_timer); 706 706 707 707 spin_lock_bh(&delay_dd.dd_lock); 708 708 if (list_empty(&rule->dl_sched_link) && delay_dd.dd_running) { ··· 762 762 wait_event(delay_dd.dd_ctl_waitq, delay_dd.dd_running); 763 763 } 764 764 765 - setup_timer(&rule->dl_timer, delay_timer_cb, (unsigned long)rule); 765 + timer_setup(&rule->dl_timer, delay_timer_cb, 0); 766 766 767 767 spin_lock_init(&rule->dl_lock); 768 768 INIT_LIST_HEAD(&rule->dl_msg_list);
+4 -5
drivers/staging/lustre/lustre/ptlrpc/service.c
··· 329 329 return -1; 330 330 } 331 331 332 - static void ptlrpc_at_timer(unsigned long castmeharder) 332 + static void ptlrpc_at_timer(struct timer_list *t) 333 333 { 334 334 struct ptlrpc_service_part *svcpt; 335 335 336 - svcpt = (struct ptlrpc_service_part *)castmeharder; 336 + svcpt = from_timer(svcpt, t, scp_at_timer); 337 337 338 338 svcpt->scp_at_check = 1; 339 339 svcpt->scp_at_checktime = cfs_time_current(); ··· 506 506 if (!array->paa_reqs_count) 507 507 goto free_reqs_array; 508 508 509 - setup_timer(&svcpt->scp_at_timer, ptlrpc_at_timer, 510 - (unsigned long)svcpt); 509 + timer_setup(&svcpt->scp_at_timer, ptlrpc_at_timer, 0); 511 510 512 511 /* At SOW, service time should be quick; 10s seems generous. If client 513 512 * timeout is less than this, we'll be sending an early reply. ··· 925 926 next = (__s32)(array->paa_deadline - ktime_get_real_seconds() - 926 927 at_early_margin); 927 928 if (next <= 0) { 928 - ptlrpc_at_timer((unsigned long)svcpt); 929 + ptlrpc_at_timer(&svcpt->scp_at_timer); 929 930 } else { 930 931 mod_timer(&svcpt->scp_at_timer, cfs_time_shift(next)); 931 932 CDEBUG(D_INFO, "armed %s at %+ds\n",
+3 -4
drivers/staging/media/imx/imx-ic-prpencvf.c
··· 293 293 * EOF timeout timer function. This is an unrecoverable condition 294 294 * without a stream restart. 295 295 */ 296 - static void prp_eof_timeout(unsigned long data) 296 + static void prp_eof_timeout(struct timer_list *t) 297 297 { 298 - struct prp_priv *priv = (struct prp_priv *)data; 298 + struct prp_priv *priv = from_timer(priv, t, eof_timeout_timer); 299 299 struct imx_media_video_dev *vdev = priv->vdev; 300 300 struct imx_ic_priv *ic_priv = priv->ic_priv; 301 301 ··· 1292 1292 priv->ic_priv = ic_priv; 1293 1293 1294 1294 spin_lock_init(&priv->irqlock); 1295 - setup_timer(&priv->eof_timeout_timer, prp_eof_timeout, 1296 - (unsigned long)priv); 1295 + timer_setup(&priv->eof_timeout_timer, prp_eof_timeout, 0); 1297 1296 1298 1297 priv->vdev = imx_media_capture_device_init(&ic_priv->sd, 1299 1298 PRPENCVF_SRC_PAD);
+3 -4
drivers/staging/media/imx/imx-media-csi.c
··· 254 254 * EOF timeout timer function. This is an unrecoverable condition 255 255 * without a stream restart. 256 256 */ 257 - static void csi_idmac_eof_timeout(unsigned long data) 257 + static void csi_idmac_eof_timeout(struct timer_list *t) 258 258 { 259 - struct csi_priv *priv = (struct csi_priv *)data; 259 + struct csi_priv *priv = from_timer(priv, t, eof_timeout_timer); 260 260 struct imx_media_video_dev *vdev = priv->vdev; 261 261 262 262 v4l2_err(&priv->sd, "EOF timeout\n"); ··· 1739 1739 priv->csi_id = pdata->csi; 1740 1740 priv->smfc_id = (priv->csi_id == 0) ? 0 : 2; 1741 1741 1742 - setup_timer(&priv->eof_timeout_timer, csi_idmac_eof_timeout, 1743 - (unsigned long)priv); 1742 + timer_setup(&priv->eof_timeout_timer, csi_idmac_eof_timeout, 0); 1744 1743 spin_lock_init(&priv->irqlock); 1745 1744 1746 1745 v4l2_subdev_init(&priv->sd, &csi_subdev_ops);
+3 -4
drivers/staging/most/hdm-usb/hdm_usb.c
··· 744 744 * The handler runs in interrupt context. That's why we need to defer the 745 745 * tasks to a work queue. 746 746 */ 747 - static void link_stat_timer_handler(unsigned long data) 747 + static void link_stat_timer_handler(struct timer_list *t) 748 748 { 749 - struct most_dev *mdev = (struct most_dev *)data; 749 + struct most_dev *mdev = from_timer(mdev, t, link_stat_timer); 750 750 751 751 schedule_work(&mdev->poll_work_obj); 752 752 mdev->link_stat_timer.expires = jiffies + (2 * HZ); ··· 1138 1138 num_endpoints = usb_iface_desc->desc.bNumEndpoints; 1139 1139 mutex_init(&mdev->io_mutex); 1140 1140 INIT_WORK(&mdev->poll_work_obj, wq_netinfo); 1141 - setup_timer(&mdev->link_stat_timer, link_stat_timer_handler, 1142 - (unsigned long)mdev); 1141 + timer_setup(&mdev->link_stat_timer, link_stat_timer_handler, 0); 1143 1142 1144 1143 mdev->usb_device = usb_dev; 1145 1144 mdev->link_stat_timer.expires = jiffies + (2 * HZ);
+8 -8
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
··· 391 391 } 392 392 393 393 394 - static void ieee80211_send_beacon_cb(unsigned long _ieee) 394 + static void ieee80211_send_beacon_cb(struct timer_list *t) 395 395 { 396 396 struct ieee80211_device *ieee = 397 - (struct ieee80211_device *) _ieee; 397 + from_timer(ieee, t, beacon_timer); 398 398 unsigned long flags; 399 399 400 400 spin_lock_irqsave(&ieee->beacon_lock, flags); ··· 1251 1251 spin_unlock_irqrestore(&ieee->lock, flags); 1252 1252 } 1253 1253 1254 - static void ieee80211_associate_abort_cb(unsigned long dev) 1254 + static void ieee80211_associate_abort_cb(struct timer_list *t) 1255 1255 { 1256 - ieee80211_associate_abort((struct ieee80211_device *) dev); 1256 + struct ieee80211_device *dev = from_timer(dev, t, associate_timer); 1257 + 1258 + ieee80211_associate_abort(dev); 1257 1259 } 1258 1260 1259 1261 ··· 2720 2718 ieee->enable_rx_imm_BA = true; 2721 2719 ieee->tx_pending.txb = NULL; 2722 2720 2723 - setup_timer(&ieee->associate_timer, ieee80211_associate_abort_cb, 2724 - (unsigned long)ieee); 2721 + timer_setup(&ieee->associate_timer, ieee80211_associate_abort_cb, 0); 2725 2722 2726 - setup_timer(&ieee->beacon_timer, ieee80211_send_beacon_cb, 2727 - (unsigned long)ieee); 2723 + timer_setup(&ieee->beacon_timer, ieee80211_send_beacon_cb, 0); 2728 2724 2729 2725 2730 2726 INIT_DELAYED_WORK(&ieee->start_ibss_wq, ieee80211_start_ibss_wq);
+4 -5
drivers/staging/rtl8712/recv_linux.c
··· 138 138 precvpriv->rx_drop++; 139 139 } 140 140 141 - static void _r8712_reordering_ctrl_timeout_handler (unsigned long data) 141 + static void _r8712_reordering_ctrl_timeout_handler (struct timer_list *t) 142 142 { 143 143 struct recv_reorder_ctrl *preorder_ctrl = 144 - (struct recv_reorder_ctrl *)data; 144 + from_timer(preorder_ctrl, t, reordering_ctrl_timer); 145 145 146 146 r8712_reordering_ctrl_timeout_handler(preorder_ctrl); 147 147 } 148 148 149 149 void r8712_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl) 150 150 { 151 - setup_timer(&preorder_ctrl->reordering_ctrl_timer, 152 - _r8712_reordering_ctrl_timeout_handler, 153 - (unsigned long)preorder_ctrl); 151 + timer_setup(&preorder_ctrl->reordering_ctrl_timer, 152 + _r8712_reordering_ctrl_timeout_handler, 0); 154 153 }
+4 -5
drivers/staging/rtl8712/rtl8712_led.c
··· 74 74 * Prototype of protected function. 75 75 *=========================================================================== 76 76 */ 77 - static void BlinkTimerCallback(unsigned long data); 77 + static void BlinkTimerCallback(struct timer_list *t); 78 78 79 79 static void BlinkWorkItemCallback(struct work_struct *work); 80 80 /*=========================================================================== ··· 99 99 pLed->bLedBlinkInProgress = false; 100 100 pLed->BlinkTimes = 0; 101 101 pLed->BlinkingLedState = LED_UNKNOWN; 102 - setup_timer(&pLed->BlinkTimer, BlinkTimerCallback, 103 - (unsigned long)pLed); 102 + timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0); 104 103 INIT_WORK(&pLed->BlinkWorkItem, BlinkWorkItemCallback); 105 104 } 106 105 ··· 824 825 * Callback function of LED BlinkTimer, 825 826 * it just schedules to corresponding BlinkWorkItem. 826 827 */ 827 - static void BlinkTimerCallback(unsigned long data) 828 + static void BlinkTimerCallback(struct timer_list *t) 828 829 { 829 - struct LED_871x *pLed = (struct LED_871x *)data; 830 + struct LED_871x *pLed = from_timer(pLed, t, BlinkTimer); 830 831 831 832 /* This fixed the crash problem on Fedora 12 when trying to do the 832 833 * insmod;ifconfig up;rmmod commands.
+2 -2
drivers/staging/speakup/main.c
··· 1164 1164 static const int NUM_CTL_LABELS = (MSG_CTL_END - MSG_CTL_START + 1); 1165 1165 1166 1166 static void read_all_doc(struct vc_data *vc); 1167 - static void cursor_done(u_long data); 1167 + static void cursor_done(struct timer_list *unused); 1168 1168 static DEFINE_TIMER(cursor_timer, cursor_done); 1169 1169 1170 1170 static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag) ··· 1682 1682 return 0; 1683 1683 } 1684 1684 1685 - static void cursor_done(u_long data) 1685 + static void cursor_done(struct timer_list *unused) 1686 1686 { 1687 1687 struct vc_data *vc = vc_cons[cursor_con].d; 1688 1688 unsigned long flags;
+1 -1
drivers/staging/speakup/synth.c
··· 153 153 } 154 154 EXPORT_SYMBOL_GPL(spk_synth_is_alive_restart); 155 155 156 - static void thread_wake_up(u_long data) 156 + static void thread_wake_up(struct timer_list *unused) 157 157 { 158 158 wake_up_interruptible_all(&speakup_event); 159 159 }
+3 -3
drivers/staging/unisys/visorbus/visorbus_main.c
··· 493 493 .release = single_release, 494 494 }; 495 495 496 - static void dev_periodic_work(unsigned long __opaque) 496 + static void dev_periodic_work(struct timer_list *t) 497 497 { 498 - struct visor_device *dev = (struct visor_device *)__opaque; 498 + struct visor_device *dev = from_timer(dev, t, timer); 499 499 struct visor_driver *drv = to_visor_driver(dev->device.driver); 500 500 501 501 drv->channel_interrupt(dev); ··· 667 667 dev->device.release = visorbus_release_device; 668 668 /* keep a reference just for us (now 2) */ 669 669 get_device(&dev->device); 670 - setup_timer(&dev->timer, dev_periodic_work, (unsigned long)dev); 670 + timer_setup(&dev->timer, dev_periodic_work, 0); 671 671 /* 672 672 * bus_id must be a unique name with respect to this bus TYPE (NOT bus 673 673 * instance). That's why we need to include the bus number within the
+4 -4
drivers/staging/unisys/visornic/visornic_main.c
··· 1766 1766 * Main function of the vnic_incoming thread. Periodically check the response 1767 1767 * queue and drain it if needed. 1768 1768 */ 1769 - static void poll_for_irq(unsigned long v) 1769 + static void poll_for_irq(struct timer_list *t) 1770 1770 { 1771 - struct visornic_devdata *devdata = (struct visornic_devdata *)v; 1771 + struct visornic_devdata *devdata = from_timer(devdata, t, 1772 + irq_poll_timer); 1772 1773 1773 1774 if (!visorchannel_signalempty( 1774 1775 devdata->dev->visorchannel, ··· 1900 1899 /* Let's start our threads to get responses */ 1901 1900 netif_napi_add(netdev, &devdata->napi, visornic_poll, NAPI_WEIGHT); 1902 1901 1903 - setup_timer(&devdata->irq_poll_timer, poll_for_irq, 1904 - (unsigned long)devdata); 1902 + timer_setup(&devdata->irq_poll_timer, poll_for_irq, 0); 1905 1903 /* Note: This time has to start running before the while 1906 1904 * loop below because the napi routine is responsible for 1907 1905 * setting enab_dis_acked
+4 -4
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
··· 267 267 last_scanned_shadow[i].time_scan = jiffies; 268 268 } 269 269 270 - static void remove_network_from_shadow(unsigned long unused) 270 + static void remove_network_from_shadow(struct timer_list *unused) 271 271 { 272 272 unsigned long now = jiffies; 273 273 int i, j; ··· 292 292 } 293 293 } 294 294 295 - static void clear_duringIP(unsigned long arg) 295 + static void clear_duringIP(struct timer_list *unused) 296 296 { 297 297 wilc_optaining_ip = false; 298 298 } ··· 2278 2278 2279 2279 priv = wdev_priv(net->ieee80211_ptr); 2280 2280 if (op_ifcs == 0) { 2281 - setup_timer(&hAgingTimer, remove_network_from_shadow, 0); 2282 - setup_timer(&wilc_during_ip_timer, clear_duringIP, 0); 2281 + timer_setup(&hAgingTimer, remove_network_from_shadow, 0); 2282 + timer_setup(&wilc_during_ip_timer, clear_duringIP, 0); 2283 2283 } 2284 2284 op_ifcs++; 2285 2285
+3 -4
drivers/target/target_core_user.c
··· 1055 1055 return 0; 1056 1056 } 1057 1057 1058 - static void tcmu_device_timedout(unsigned long data) 1058 + static void tcmu_device_timedout(struct timer_list *t) 1059 1059 { 1060 - struct tcmu_dev *udev = (struct tcmu_dev *)data; 1060 + struct tcmu_dev *udev = from_timer(udev, t, timeout); 1061 1061 unsigned long flags; 1062 1062 1063 1063 spin_lock_irqsave(&udev->commands_lock, flags); ··· 1117 1117 idr_init(&udev->commands); 1118 1118 spin_lock_init(&udev->commands_lock); 1119 1119 1120 - setup_timer(&udev->timeout, tcmu_device_timedout, 1121 - (unsigned long)udev); 1120 + timer_setup(&udev->timeout, tcmu_device_timedout, 0); 1122 1121 1123 1122 init_waitqueue_head(&udev->nl_cmd_wq); 1124 1123 spin_lock_init(&udev->nl_cmd_lock);
+2 -2
drivers/tty/cyclades.c
··· 279 279 #endif /* CONFIG_ISA */ 280 280 281 281 #ifndef CONFIG_CYZ_INTR 282 - static void cyz_poll(unsigned long); 282 + static void cyz_poll(struct timer_list *); 283 283 284 284 /* The Cyclades-Z polling cycle is defined by this variable */ 285 285 static long cyz_polling_cycle = CZ_DEF_POLL; ··· 1214 1214 1215 1215 #else /* CONFIG_CYZ_INTR */ 1216 1216 1217 - static void cyz_poll(unsigned long arg) 1217 + static void cyz_poll(struct timer_list *unused) 1218 1218 { 1219 1219 struct cyclades_card *cinfo; 1220 1220 struct cyclades_port *info;
+5 -6
drivers/tty/ipwireless/hardware.c
··· 33 33 unsigned int address, 34 34 const unsigned char *data, int len, 35 35 int is_last); 36 - static void ipwireless_setup_timer(unsigned long data); 36 + static void ipwireless_setup_timer(struct timer_list *t); 37 37 static void handle_received_CTRL_packet(struct ipw_hardware *hw, 38 38 unsigned int channel_idx, const unsigned char *data, int len); 39 39 ··· 1635 1635 spin_lock_init(&hw->lock); 1636 1636 tasklet_init(&hw->tasklet, ipwireless_do_tasklet, (unsigned long) hw); 1637 1637 INIT_WORK(&hw->work_rx, ipw_receive_data_work); 1638 - setup_timer(&hw->setup_timer, ipwireless_setup_timer, 1639 - (unsigned long) hw); 1638 + timer_setup(&hw->setup_timer, ipwireless_setup_timer, 0); 1640 1639 1641 1640 return hw; 1642 1641 } ··· 1669 1670 hw->init_loops = 0; 1670 1671 printk(KERN_INFO IPWIRELESS_PCCARD_NAME 1671 1672 ": waiting for card to start up...\n"); 1672 - ipwireless_setup_timer((unsigned long) hw); 1673 + ipwireless_setup_timer(&hw->setup_timer); 1673 1674 } 1674 1675 1675 - static void ipwireless_setup_timer(unsigned long data) 1676 + static void ipwireless_setup_timer(struct timer_list *t) 1676 1677 { 1677 - struct ipw_hardware *hw = (struct ipw_hardware *) data; 1678 + struct ipw_hardware *hw = from_timer(hw, t, setup_timer); 1678 1679 1679 1680 hw->init_loops++; 1680 1681
+2 -2
drivers/tty/isicom.c
··· 170 170 static int prev_card = 3; /* start servicing isi_card[0] */ 171 171 static struct tty_driver *isicom_normal; 172 172 173 - static void isicom_tx(unsigned long _data); 173 + static void isicom_tx(struct timer_list *unused); 174 174 static void isicom_start(struct tty_struct *tty); 175 175 176 176 static DEFINE_TIMER(tx, isicom_tx); ··· 394 394 * will do the rest of the work for us. 395 395 */ 396 396 397 - static void isicom_tx(unsigned long _data) 397 + static void isicom_tx(struct timer_list *unused) 398 398 { 399 399 unsigned long flags, base; 400 400 unsigned int retries;
+2 -2
drivers/tty/moxa.c
··· 198 198 static int moxa_tiocmget(struct tty_struct *tty); 199 199 static int moxa_tiocmset(struct tty_struct *tty, 200 200 unsigned int set, unsigned int clear); 201 - static void moxa_poll(unsigned long); 201 + static void moxa_poll(struct timer_list *); 202 202 static void moxa_set_tty_param(struct tty_struct *, struct ktermios *); 203 203 static void moxa_shutdown(struct tty_port *); 204 204 static int moxa_carrier_raised(struct tty_port *); ··· 1429 1429 return 0; 1430 1430 } 1431 1431 1432 - static void moxa_poll(unsigned long ignored) 1432 + static void moxa_poll(struct timer_list *unused) 1433 1433 { 1434 1434 struct moxa_board_conf *brd; 1435 1435 u16 __iomem *ip;
+6 -6
drivers/tty/n_gsm.c
··· 1310 1310 * gsm->pending_cmd will be NULL and we just let the timer expire. 1311 1311 */ 1312 1312 1313 - static void gsm_control_retransmit(unsigned long data) 1313 + static void gsm_control_retransmit(struct timer_list *t) 1314 1314 { 1315 - struct gsm_mux *gsm = (struct gsm_mux *)data; 1315 + struct gsm_mux *gsm = from_timer(gsm, t, t2_timer); 1316 1316 struct gsm_control *ctrl; 1317 1317 unsigned long flags; 1318 1318 spin_lock_irqsave(&gsm->control_lock, flags); ··· 1453 1453 * end will get a DM response) 1454 1454 */ 1455 1455 1456 - static void gsm_dlci_t1(unsigned long data) 1456 + static void gsm_dlci_t1(struct timer_list *t) 1457 1457 { 1458 - struct gsm_dlci *dlci = (struct gsm_dlci *)data; 1458 + struct gsm_dlci *dlci = from_timer(dlci, t, t1); 1459 1459 struct gsm_mux *gsm = dlci->gsm; 1460 1460 1461 1461 switch (dlci->state) { ··· 1634 1634 } 1635 1635 1636 1636 skb_queue_head_init(&dlci->skb_list); 1637 - setup_timer(&dlci->t1, gsm_dlci_t1, (unsigned long)dlci); 1637 + timer_setup(&dlci->t1, gsm_dlci_t1, 0); 1638 1638 tty_port_init(&dlci->port); 1639 1639 dlci->port.ops = &gsm_port_ops; 1640 1640 dlci->gsm = gsm; ··· 2088 2088 struct gsm_dlci *dlci; 2089 2089 int i = 0; 2090 2090 2091 - setup_timer(&gsm->t2_timer, gsm_control_retransmit, (unsigned long)gsm); 2091 + timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0); 2092 2092 init_waitqueue_head(&gsm->event); 2093 2093 spin_lock_init(&gsm->control_lock); 2094 2094 spin_lock_init(&gsm->tx_lock);
+4 -4
drivers/tty/n_r3964.c
··· 115 115 static void transmit_block(struct r3964_info *pInfo); 116 116 static void receive_char(struct r3964_info *pInfo, const unsigned char c); 117 117 static void receive_error(struct r3964_info *pInfo, const char flag); 118 - static void on_timeout(unsigned long priv); 118 + static void on_timeout(struct timer_list *t); 119 119 static int enable_signals(struct r3964_info *pInfo, struct pid *pid, int arg); 120 120 static int read_telegram(struct r3964_info *pInfo, struct pid *pid, 121 121 unsigned char __user * buf); ··· 688 688 } 689 689 } 690 690 691 - static void on_timeout(unsigned long priv) 691 + static void on_timeout(struct timer_list *t) 692 692 { 693 - struct r3964_info *pInfo = (void *)priv; 693 + struct r3964_info *pInfo = from_timer(pInfo, t, tmr); 694 694 695 695 switch (pInfo->state) { 696 696 case R3964_TX_REQUEST: ··· 993 993 tty->disc_data = pInfo; 994 994 tty->receive_room = 65536; 995 995 996 - setup_timer(&pInfo->tmr, on_timeout, (unsigned long)pInfo); 996 + timer_setup(&pInfo->tmr, on_timeout, 0); 997 997 998 998 return 0; 999 999 }
+2 -2
drivers/tty/rocket.c
··· 86 86 87 87 /****** RocketPort Local Variables ******/ 88 88 89 - static void rp_do_poll(unsigned long dummy); 89 + static void rp_do_poll(struct timer_list *unused); 90 90 91 91 static struct tty_driver *rocket_driver; 92 92 ··· 525 525 /* 526 526 * The top level polling routine. Repeats every 1/100 HZ (10ms). 527 527 */ 528 - static void rp_do_poll(unsigned long dummy) 528 + static void rp_do_poll(struct timer_list *unused) 529 529 { 530 530 CONTROLLER_t *ctlp; 531 531 int ctrl, aiop, ch, line;
+2 -2
drivers/tty/serial/8250/8250_core.c
··· 325 325 if (up->bugs & UART_BUG_THRE) { 326 326 pr_debug("ttyS%d - using backup timer\n", serial_index(port)); 327 327 328 - up->timer.function = (TIMER_FUNC_TYPE)serial8250_backup_timeout; 328 + up->timer.function = serial8250_backup_timeout; 329 329 mod_timer(&up->timer, jiffies + 330 330 uart_poll_timeout(port) + HZ / 5); 331 331 } ··· 348 348 struct uart_port *port = &up->port; 349 349 350 350 del_timer_sync(&up->timer); 351 - up->timer.function = (TIMER_FUNC_TYPE)serial8250_timeout; 351 + up->timer.function = serial8250_timeout; 352 352 if (port->irq) 353 353 serial_unlink_irq_chain(up); 354 354 }
+2 -2
drivers/tty/serial/crisv10.c
··· 2059 2059 static struct timer_list flush_timer; 2060 2060 2061 2061 static void 2062 - timed_flush_handler(unsigned long ptr) 2062 + timed_flush_handler(struct timer_list *unused) 2063 2063 { 2064 2064 struct e100_serial *info; 2065 2065 int i; ··· 4137 4137 /* Setup the timed flush handler system */ 4138 4138 4139 4139 #if !defined(CONFIG_ETRAX_SERIAL_FAST_TIMER) 4140 - setup_timer(&flush_timer, timed_flush_handler, 0); 4140 + timer_setup(&flush_timer, timed_flush_handler, 0); 4141 4141 mod_timer(&flush_timer, jiffies + 5); 4142 4142 #endif 4143 4143
+3 -4
drivers/tty/serial/fsl_lpuart.c
··· 966 966 lpuart_copy_rx_to_tty(sport); 967 967 } 968 968 969 - static void lpuart_timer_func(unsigned long data) 969 + static void lpuart_timer_func(struct timer_list *t) 970 970 { 971 - struct lpuart_port *sport = (struct lpuart_port *)data; 971 + struct lpuart_port *sport = from_timer(sport, t, lpuart_timer); 972 972 973 973 lpuart_copy_rx_to_tty(sport); 974 974 } ··· 1263 1263 1264 1264 static void rx_dma_timer_init(struct lpuart_port *sport) 1265 1265 { 1266 - setup_timer(&sport->lpuart_timer, lpuart_timer_func, 1267 - (unsigned long)sport); 1266 + timer_setup(&sport->lpuart_timer, lpuart_timer_func, 0); 1268 1267 sport->lpuart_timer.expires = jiffies + sport->dma_rx_timeout; 1269 1268 add_timer(&sport->lpuart_timer); 1270 1269 }
+3 -4
drivers/tty/serial/ifx6x60.c
··· 263 263 * The SPI has timed out: hang up the tty. Users will then see a hangup 264 264 * and error events. 265 265 */ 266 - static void ifx_spi_timeout(unsigned long arg) 266 + static void ifx_spi_timeout(struct timer_list *t) 267 267 { 268 - struct ifx_spi_device *ifx_dev = (struct ifx_spi_device *)arg; 268 + struct ifx_spi_device *ifx_dev = from_timer(ifx_dev, t, spi_timer); 269 269 270 270 dev_warn(&ifx_dev->spi_dev->dev, "*** SPI Timeout ***"); 271 271 tty_port_tty_hangup(&ifx_dev->tty_port, false); ··· 1016 1016 spin_lock_init(&ifx_dev->write_lock); 1017 1017 spin_lock_init(&ifx_dev->power_lock); 1018 1018 ifx_dev->power_status = 0; 1019 - setup_timer(&ifx_dev->spi_timer, ifx_spi_timeout, 1020 - (unsigned long)ifx_dev); 1019 + timer_setup(&ifx_dev->spi_timer, ifx_spi_timeout, 0); 1021 1020 ifx_dev->modem = pl_data->modem_type; 1022 1021 ifx_dev->use_dma = pl_data->use_dma; 1023 1022 ifx_dev->max_hz = pl_data->max_hz;
+3 -3
drivers/tty/serial/imx.c
··· 906 906 * This is our per-port timeout handler, for checking the 907 907 * modem status signals. 908 908 */ 909 - static void imx_timeout(unsigned long data) 909 + static void imx_timeout(struct timer_list *t) 910 910 { 911 - struct imx_port *sport = (struct imx_port *)data; 911 + struct imx_port *sport = from_timer(sport, t, timer); 912 912 unsigned long flags; 913 913 914 914 if (sport->port.state) { ··· 2082 2082 sport->port.rs485_config = imx_rs485_config; 2083 2083 sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND; 2084 2084 sport->port.flags = UPF_BOOT_AUTOCONF; 2085 - setup_timer(&sport->timer, imx_timeout, (unsigned long)sport); 2085 + timer_setup(&sport->timer, imx_timeout, 0); 2086 2086 2087 2087 sport->gpios = mctrl_gpio_init(&sport->port, 0); 2088 2088 if (IS_ERR(sport->gpios))
+3 -3
drivers/tty/serial/kgdb_nmi.c
··· 188 188 * The tasklet is cheap, it does not cause wakeups when reschedules itself, 189 189 * instead it waits for the next tick. 190 190 */ 191 - static void kgdb_nmi_tty_receiver(unsigned long data) 191 + static void kgdb_nmi_tty_receiver(struct timer_list *t) 192 192 { 193 - struct kgdb_nmi_tty_priv *priv = (void *)data; 193 + struct kgdb_nmi_tty_priv *priv = from_timer(priv, t, timer); 194 194 char ch; 195 195 196 196 priv->timer.expires = jiffies + (HZ/100); ··· 241 241 return -ENOMEM; 242 242 243 243 INIT_KFIFO(priv->fifo); 244 - setup_timer(&priv->timer, kgdb_nmi_tty_receiver, (unsigned long)priv); 244 + timer_setup(&priv->timer, kgdb_nmi_tty_receiver, 0); 245 245 tty_port_init(&priv->port); 246 246 priv->port.ops = &kgdb_nmi_tty_port_ops; 247 247 tty->driver_data = priv;
+3 -4
drivers/tty/serial/max3100.c
··· 178 178 queue_work(s->workqueue, &s->work); 179 179 } 180 180 181 - static void max3100_timeout(unsigned long data) 181 + static void max3100_timeout(struct timer_list *t) 182 182 { 183 - struct max3100_port *s = (struct max3100_port *)data; 183 + struct max3100_port *s = from_timer(s, t, timer); 184 184 185 185 if (s->port.state) { 186 186 max3100_dowork(s); ··· 780 780 max3100s[i]->poll_time = 1; 781 781 max3100s[i]->max3100_hw_suspend = pdata->max3100_hw_suspend; 782 782 max3100s[i]->minor = i; 783 - setup_timer(&max3100s[i]->timer, max3100_timeout, 784 - (unsigned long)max3100s[i]); 783 + timer_setup(&max3100s[i]->timer, max3100_timeout, 0); 785 784 786 785 dev_dbg(&spi->dev, "%s: adding port %d\n", __func__, i); 787 786 max3100s[i]->port.irq = max3100s[i]->irq;
+2 -2
drivers/tty/serial/mux.c
··· 371 371 * 372 372 * This function periodically polls the Serial MUX to check for new data. 373 373 */ 374 - static void mux_poll(unsigned long unused) 374 + static void mux_poll(struct timer_list *unused) 375 375 { 376 376 int i; 377 377 ··· 572 572 573 573 if(port_cnt > 0) { 574 574 /* Start the Mux timer */ 575 - setup_timer(&mux_timer, mux_poll, 0UL); 575 + timer_setup(&mux_timer, mux_poll, 0); 576 576 mod_timer(&mux_timer, jiffies + MUX_POLL_DELAY); 577 577 578 578 #ifdef CONFIG_SERIAL_MUX_CONSOLE
+3 -4
drivers/tty/serial/pnx8xxx_uart.c
··· 103 103 * This is our per-port timeout handler, for checking the 104 104 * modem status signals. 105 105 */ 106 - static void pnx8xxx_timeout(unsigned long data) 106 + static void pnx8xxx_timeout(struct timer_list *t) 107 107 { 108 - struct pnx8xxx_port *sport = (struct pnx8xxx_port *)data; 108 + struct pnx8xxx_port *sport = from_timer(sport, t, timer); 109 109 unsigned long flags; 110 110 111 111 if (sport->port.state) { ··· 662 662 first = 0; 663 663 664 664 for (i = 0; i < NR_PORTS; i++) { 665 - setup_timer(&pnx8xxx_ports[i].timer, pnx8xxx_timeout, 666 - (unsigned long)&pnx8xxx_ports[i]); 665 + timer_setup(&pnx8xxx_ports[i].timer, pnx8xxx_timeout, 0); 667 666 pnx8xxx_ports[i].port.ops = &pnx8xxx_pops; 668 667 } 669 668 }
+3 -4
drivers/tty/serial/sa1100.c
··· 110 110 * This is our per-port timeout handler, for checking the 111 111 * modem status signals. 112 112 */ 113 - static void sa1100_timeout(unsigned long data) 113 + static void sa1100_timeout(struct timer_list *t) 114 114 { 115 - struct sa1100_port *sport = (struct sa1100_port *)data; 115 + struct sa1100_port *sport = from_timer(sport, t, timer); 116 116 unsigned long flags; 117 117 118 118 if (sport->port.state) { ··· 627 627 sa1100_ports[i].port.fifosize = 8; 628 628 sa1100_ports[i].port.line = i; 629 629 sa1100_ports[i].port.iotype = UPIO_MEM; 630 - setup_timer(&sa1100_ports[i].timer, sa1100_timeout, 631 - (unsigned long)&sa1100_ports[i]); 630 + timer_setup(&sa1100_ports[i].timer, sa1100_timeout, 0); 632 631 } 633 632 634 633 /*
+7 -9
drivers/tty/serial/sh-sci.c
··· 1058 1058 (SCFCR_RTRG0 | SCFCR_RTRG1)) != 0; 1059 1059 } 1060 1060 1061 - static void rx_fifo_timer_fn(unsigned long arg) 1061 + static void rx_fifo_timer_fn(struct timer_list *t) 1062 1062 { 1063 - struct sci_port *s = (struct sci_port *)arg; 1063 + struct sci_port *s = from_timer(s, t, rx_fifo_timer); 1064 1064 struct uart_port *port = &s->port; 1065 1065 1066 1066 dev_dbg(port->dev, "Rx timed out\n"); ··· 1138 1138 sci->rx_fifo_timeout = r; 1139 1139 scif_set_rtrg(port, 1); 1140 1140 if (r > 0) 1141 - setup_timer(&sci->rx_fifo_timer, rx_fifo_timer_fn, 1142 - (unsigned long)sci); 1141 + timer_setup(&sci->rx_fifo_timer, rx_fifo_timer_fn, 0); 1143 1142 } 1144 1143 1145 1144 return count; ··· 1391 1392 dma_async_issue_pending(chan); 1392 1393 } 1393 1394 1394 - static void rx_timer_fn(unsigned long arg) 1395 + static void rx_timer_fn(struct timer_list *t) 1395 1396 { 1396 - struct sci_port *s = (struct sci_port *)arg; 1397 + struct sci_port *s = from_timer(s, t, rx_timer); 1397 1398 struct dma_chan *chan = s->chan_rx; 1398 1399 struct uart_port *port = &s->port; 1399 1400 struct dma_tx_state state; ··· 1571 1572 dma += s->buf_len_rx; 1572 1573 } 1573 1574 1574 - setup_timer(&s->rx_timer, rx_timer_fn, (unsigned long)s); 1575 + timer_setup(&s->rx_timer, rx_timer_fn, 0); 1575 1576 1576 1577 if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) 1577 1578 sci_submit_rx(s); ··· 2237 2238 if (s->rx_trigger > 1) { 2238 2239 if (s->rx_fifo_timeout) { 2239 2240 scif_set_rtrg(port, 1); 2240 - setup_timer(&s->rx_fifo_timer, rx_fifo_timer_fn, 2241 - (unsigned long)s); 2241 + timer_setup(&s->rx_fifo_timer, rx_fifo_timer_fn, 0); 2242 2242 } else { 2243 2243 if (port->type == PORT_SCIFA || 2244 2244 port->type == PORT_SCIFB)
+3 -3
drivers/tty/serial/sn_console.c
··· 612 612 * Obviously not used in interrupt mode 613 613 * 614 614 */ 615 - static void sn_sal_timer_poll(unsigned long data) 615 + static void sn_sal_timer_poll(struct timer_list *t) 616 616 { 617 - struct sn_cons_port *port = (struct sn_cons_port *)data; 617 + struct sn_cons_port *port = from_timer(port, t, sc_timer); 618 618 unsigned long flags; 619 619 620 620 if (!port) ··· 668 668 * timer to poll for input and push data from the console 669 669 * buffer. 670 670 */ 671 - setup_timer(&port->sc_timer, sn_sal_timer_poll, (unsigned long)port); 671 + timer_setup(&port->sc_timer, sn_sal_timer_poll, 0); 672 672 673 673 if (IS_RUNNING_ON_SIMULATOR()) 674 674 port->sc_interrupt_timeout = 6;
+4 -4
drivers/tty/synclink.c
··· 700 700 701 701 static void usc_loopback_frame( struct mgsl_struct *info ); 702 702 703 - static void mgsl_tx_timeout(unsigned long context); 703 + static void mgsl_tx_timeout(struct timer_list *t); 704 704 705 705 706 706 static void usc_loopmode_cancel_transmit( struct mgsl_struct * info ); ··· 1768 1768 1769 1769 memset(&info->icount, 0, sizeof(info->icount)); 1770 1770 1771 - setup_timer(&info->tx_timer, mgsl_tx_timeout, (unsigned long)info); 1771 + timer_setup(&info->tx_timer, mgsl_tx_timeout, 0); 1772 1772 1773 1773 /* Allocate and claim adapter resources */ 1774 1774 retval = mgsl_claim_resources(info); ··· 7517 7517 * Arguments: context pointer to device instance data 7518 7518 * Return Value: None 7519 7519 */ 7520 - static void mgsl_tx_timeout(unsigned long context) 7520 + static void mgsl_tx_timeout(struct timer_list *t) 7521 7521 { 7522 - struct mgsl_struct *info = (struct mgsl_struct*)context; 7522 + struct mgsl_struct *info = from_timer(info, t, tx_timer); 7523 7523 unsigned long flags; 7524 7524 7525 7525 if ( debug_level >= DEBUG_LEVEL_INFO )
+8 -9
drivers/tty/synclinkmp.c
··· 615 615 616 616 static void load_pci_memory(SLMP_INFO *info, char* dest, const char* src, unsigned short count); 617 617 static void trace_block(SLMP_INFO *info, const char* data, int count, int xmit); 618 - static void tx_timeout(unsigned long context); 619 - static void status_timeout(unsigned long context); 618 + static void tx_timeout(struct timer_list *t); 619 + static void status_timeout(struct timer_list *t); 620 620 621 621 static unsigned char read_reg(SLMP_INFO *info, unsigned char addr); 622 622 static void write_reg(SLMP_INFO *info, unsigned char addr, unsigned char val); ··· 3782 3782 info->bus_type = MGSL_BUS_TYPE_PCI; 3783 3783 info->irq_flags = IRQF_SHARED; 3784 3784 3785 - setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info); 3786 - setup_timer(&info->status_timer, status_timeout, 3787 - (unsigned long)info); 3785 + timer_setup(&info->tx_timer, tx_timeout, 0); 3786 + timer_setup(&info->status_timer, status_timeout, 0); 3788 3787 3789 3788 /* Store the PCI9050 misc control register value because a flaw 3790 3789 * in the PCI9050 prevents LCR registers from being read if ··· 5467 5468 /* called when HDLC frame times out 5468 5469 * update stats and do tx completion processing 5469 5470 */ 5470 - static void tx_timeout(unsigned long context) 5471 + static void tx_timeout(struct timer_list *t) 5471 5472 { 5472 - SLMP_INFO *info = (SLMP_INFO*)context; 5473 + SLMP_INFO *info = from_timer(info, t, tx_timer); 5473 5474 unsigned long flags; 5474 5475 5475 5476 if ( debug_level >= DEBUG_LEVEL_INFO ) ··· 5494 5495 5495 5496 /* called to periodically check the DSR/RI modem signal input status 5496 5497 */ 5497 - static void status_timeout(unsigned long context) 5498 + static void status_timeout(struct timer_list *t) 5498 5499 { 5499 5500 u16 status = 0; 5500 - SLMP_INFO *info = (SLMP_INFO*)context; 5501 + SLMP_INFO *info = from_timer(info, t, status_timer); 5501 5502 unsigned long flags; 5502 5503 unsigned char delta; 5503 5504
+1 -1
drivers/tty/vt/keyboard.c
··· 244 244 return 0; 245 245 } 246 246 247 - static void kd_nosound(unsigned long ignored) 247 + static void kd_nosound(struct timer_list *unused) 248 248 { 249 249 static unsigned int zero; 250 250
+2 -2
drivers/tty/vt/vt.c
··· 158 158 static void hide_cursor(struct vc_data *vc); 159 159 static void console_callback(struct work_struct *ignored); 160 160 static void con_driver_unregister_callback(struct work_struct *ignored); 161 - static void blank_screen_t(unsigned long dummy); 161 + static void blank_screen_t(struct timer_list *unused); 162 162 static void set_palette(struct vc_data *vc); 163 163 164 164 #define vt_get_kmsg_redirect() vt_kmsg_redirect(-1) ··· 3929 3929 * (console operations can still happen at irq time, but only from printk which 3930 3930 * has the console mutex. Not perfect yet, but better than no locking 3931 3931 */ 3932 - static void blank_screen_t(unsigned long dummy) 3932 + static void blank_screen_t(struct timer_list *unused) 3933 3933 { 3934 3934 blank_timer_expired = 1; 3935 3935 schedule_work(&console_work);
+16 -7
drivers/usb/atm/cxacru.c
··· 547 547 complete(urb->context); 548 548 } 549 549 550 - static void cxacru_timeout_kill(unsigned long data) 550 + struct cxacru_timer { 551 + struct timer_list timer; 552 + struct urb *urb; 553 + }; 554 + 555 + static void cxacru_timeout_kill(struct timer_list *t) 551 556 { 552 - usb_unlink_urb((struct urb *) data); 557 + struct cxacru_timer *timer = from_timer(timer, t, timer); 558 + 559 + usb_unlink_urb(timer->urb); 553 560 } 554 561 555 562 static int cxacru_start_wait_urb(struct urb *urb, struct completion *done, 556 563 int *actual_length) 557 564 { 558 - struct timer_list timer; 565 + struct cxacru_timer timer = { 566 + .urb = urb, 567 + }; 559 568 560 - setup_timer(&timer, cxacru_timeout_kill, (unsigned long)urb); 561 - timer.expires = jiffies + msecs_to_jiffies(CMD_TIMEOUT); 562 - add_timer(&timer); 569 + timer_setup_on_stack(&timer.timer, cxacru_timeout_kill, 0); 570 + mod_timer(&timer.timer, jiffies + msecs_to_jiffies(CMD_TIMEOUT)); 563 571 wait_for_completion(done); 564 - del_timer_sync(&timer); 572 + del_timer_sync(&timer.timer); 573 + destroy_timer_on_stack(&timer.timer); 565 574 566 575 if (actual_length) 567 576 *actual_length = urb->actual_length;
+8 -8
drivers/usb/atm/speedtch.c
··· 557 557 } 558 558 } 559 559 560 - static void speedtch_status_poll(unsigned long data) 560 + static void speedtch_status_poll(struct timer_list *t) 561 561 { 562 - struct speedtch_instance_data *instance = (void *)data; 562 + struct speedtch_instance_data *instance = from_timer(instance, t, 563 + status_check_timer); 563 564 564 565 schedule_work(&instance->status_check_work); 565 566 ··· 571 570 atm_warn(instance->usbatm, "Too many failures - disabling line status polling\n"); 572 571 } 573 572 574 - static void speedtch_resubmit_int(unsigned long data) 573 + static void speedtch_resubmit_int(struct timer_list *t) 575 574 { 576 - struct speedtch_instance_data *instance = (void *)data; 575 + struct speedtch_instance_data *instance = from_timer(instance, t, 576 + resubmit_timer); 577 577 struct urb *int_urb = instance->int_urb; 578 578 int ret; 579 579 ··· 862 860 usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0); 863 861 864 862 INIT_WORK(&instance->status_check_work, speedtch_check_status); 865 - setup_timer(&instance->status_check_timer, speedtch_status_poll, 866 - (unsigned long)instance); 863 + timer_setup(&instance->status_check_timer, speedtch_status_poll, 0); 867 864 instance->last_status = 0xff; 868 865 instance->poll_delay = MIN_POLL_DELAY; 869 866 870 - setup_timer(&instance->resubmit_timer, speedtch_resubmit_int, 871 - (unsigned long)instance); 867 + timer_setup(&instance->resubmit_timer, speedtch_resubmit_int, 0); 872 868 873 869 instance->int_urb = usb_alloc_urb(0, GFP_KERNEL); 874 870
+5 -5
drivers/usb/atm/usbatm.c
··· 989 989 return 0; 990 990 } 991 991 992 - static void usbatm_tasklet_schedule(unsigned long data) 992 + static void usbatm_tasklet_schedule(struct timer_list *t) 993 993 { 994 - tasklet_schedule((struct tasklet_struct *) data); 994 + struct usbatm_channel *channel = from_timer(channel, t, delay); 995 + 996 + tasklet_schedule(&channel->tasklet); 995 997 } 996 998 997 999 static void usbatm_init_channel(struct usbatm_channel *channel) 998 1000 { 999 1001 spin_lock_init(&channel->lock); 1000 1002 INIT_LIST_HEAD(&channel->list); 1001 - channel->delay.function = usbatm_tasklet_schedule; 1002 - channel->delay.data = (unsigned long) &channel->tasklet; 1003 - init_timer(&channel->delay); 1003 + timer_setup(&channel->delay, usbatm_tasklet_schedule, 0); 1004 1004 } 1005 1005 1006 1006 int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
+5 -3
drivers/usb/core/hcd.c
··· 788 788 EXPORT_SYMBOL_GPL(usb_hcd_poll_rh_status); 789 789 790 790 /* timer callback */ 791 - static void rh_timer_func (unsigned long _hcd) 791 + static void rh_timer_func (struct timer_list *t) 792 792 { 793 - usb_hcd_poll_rh_status((struct usb_hcd *) _hcd); 793 + struct usb_hcd *_hcd = from_timer(_hcd, t, rh_timer); 794 + 795 + usb_hcd_poll_rh_status(_hcd); 794 796 } 795 797 796 798 /*-------------------------------------------------------------------------*/ ··· 2547 2545 hcd->self.bus_name = bus_name; 2548 2546 hcd->self.uses_dma = (sysdev->dma_mask != NULL); 2549 2547 2550 - setup_timer(&hcd->rh_timer, rh_timer_func, (unsigned long)hcd); 2548 + timer_setup(&hcd->rh_timer, rh_timer_func, 0); 2551 2549 #ifdef CONFIG_PM 2552 2550 INIT_WORK(&hcd->wakeup_work, hcd_resume_work); 2553 2551 #endif
+3 -4
drivers/usb/dwc2/hcd.c
··· 3314 3314 } 3315 3315 } 3316 3316 3317 - static void dwc2_wakeup_detected(unsigned long data) 3317 + static void dwc2_wakeup_detected(struct timer_list *t) 3318 3318 { 3319 - struct dwc2_hsotg *hsotg = (struct dwc2_hsotg *)data; 3319 + struct dwc2_hsotg *hsotg = from_timer(hsotg, t, wkp_timer); 3320 3320 u32 hprt0; 3321 3321 3322 3322 dev_dbg(hsotg->dev, "%s()\n", __func__); ··· 5155 5155 } 5156 5156 INIT_WORK(&hsotg->wf_otg, dwc2_conn_id_status_change); 5157 5157 5158 - setup_timer(&hsotg->wkp_timer, dwc2_wakeup_detected, 5159 - (unsigned long)hsotg); 5158 + timer_setup(&hsotg->wkp_timer, dwc2_wakeup_detected, 0); 5160 5159 5161 5160 /* Initialize the non-periodic schedule */ 5162 5161 INIT_LIST_HEAD(&hsotg->non_periodic_sched_inactive);
+3 -4
drivers/usb/dwc2/hcd_queue.c
··· 1275 1275 * 1276 1276 * @work: Pointer to a qh unreserve_work. 1277 1277 */ 1278 - static void dwc2_unreserve_timer_fn(unsigned long data) 1278 + static void dwc2_unreserve_timer_fn(struct timer_list *t) 1279 1279 { 1280 - struct dwc2_qh *qh = (struct dwc2_qh *)data; 1280 + struct dwc2_qh *qh = from_timer(qh, t, unreserve_timer); 1281 1281 struct dwc2_hsotg *hsotg = qh->hsotg; 1282 1282 unsigned long flags; 1283 1283 ··· 1467 1467 1468 1468 /* Initialize QH */ 1469 1469 qh->hsotg = hsotg; 1470 - setup_timer(&qh->unreserve_timer, dwc2_unreserve_timer_fn, 1471 - (unsigned long)qh); 1470 + timer_setup(&qh->unreserve_timer, dwc2_unreserve_timer_fn, 0); 1472 1471 qh->ep_type = ep_type; 1473 1472 qh->ep_is_in = ep_is_in; 1474 1473
+3 -4
drivers/usb/gadget/udc/at91_udc.c
··· 1550 1550 mod_timer(&udc->vbus_timer, jiffies + VBUS_POLL_TIMEOUT); 1551 1551 } 1552 1552 1553 - static void at91_vbus_timer(unsigned long data) 1553 + static void at91_vbus_timer(struct timer_list *t) 1554 1554 { 1555 - struct at91_udc *udc = (struct at91_udc *)data; 1555 + struct at91_udc *udc = from_timer(udc, t, vbus_timer); 1556 1556 1557 1557 /* 1558 1558 * If we are polling vbus it is likely that the gpio is on an ··· 1918 1918 1919 1919 if (udc->board.vbus_polled) { 1920 1920 INIT_WORK(&udc->vbus_timer_work, at91_vbus_timer_work); 1921 - setup_timer(&udc->vbus_timer, at91_vbus_timer, 1922 - (unsigned long)udc); 1921 + timer_setup(&udc->vbus_timer, at91_vbus_timer, 0); 1923 1922 mod_timer(&udc->vbus_timer, 1924 1923 jiffies + VBUS_POLL_TIMEOUT); 1925 1924 } else {
+4 -4
drivers/usb/gadget/udc/dummy_hcd.c
··· 1771 1771 /* drive both sides of the transfers; looks like irq handlers to 1772 1772 * both drivers except the callbacks aren't in_irq(). 1773 1773 */ 1774 - static void dummy_timer(unsigned long _dum_hcd) 1774 + static void dummy_timer(struct timer_list *t) 1775 1775 { 1776 - struct dummy_hcd *dum_hcd = (struct dummy_hcd *) _dum_hcd; 1776 + struct dummy_hcd *dum_hcd = from_timer(dum_hcd, t, timer); 1777 1777 struct dummy *dum = dum_hcd->dum; 1778 1778 struct urbp *urbp, *tmp; 1779 1779 unsigned long flags; ··· 2445 2445 2446 2446 static int dummy_start_ss(struct dummy_hcd *dum_hcd) 2447 2447 { 2448 - setup_timer(&dum_hcd->timer, dummy_timer, (unsigned long)dum_hcd); 2448 + timer_setup(&dum_hcd->timer, dummy_timer, 0); 2449 2449 dum_hcd->rh_state = DUMMY_RH_RUNNING; 2450 2450 dum_hcd->stream_en_ep = 0; 2451 2451 INIT_LIST_HEAD(&dum_hcd->urbp_list); ··· 2474 2474 return dummy_start_ss(dum_hcd); 2475 2475 2476 2476 spin_lock_init(&dum_hcd->dum->lock); 2477 - setup_timer(&dum_hcd->timer, dummy_timer, (unsigned long)dum_hcd); 2477 + timer_setup(&dum_hcd->timer, dummy_timer, 0); 2478 2478 dum_hcd->rh_state = DUMMY_RH_RUNNING; 2479 2479 2480 2480 INIT_LIST_HEAD(&dum_hcd->urbp_list);
+3 -3
drivers/usb/gadget/udc/m66592-udc.c
··· 1259 1259 return IRQ_HANDLED; 1260 1260 } 1261 1261 1262 - static void m66592_timer(unsigned long _m66592) 1262 + static void m66592_timer(struct timer_list *t) 1263 1263 { 1264 - struct m66592 *m66592 = (struct m66592 *)_m66592; 1264 + struct m66592 *m66592 = from_timer(m66592, t, timer); 1265 1265 unsigned long flags; 1266 1266 u16 tmp; 1267 1267 ··· 1589 1589 m66592->gadget.max_speed = USB_SPEED_HIGH; 1590 1590 m66592->gadget.name = udc_name; 1591 1591 1592 - setup_timer(&m66592->timer, m66592_timer, (unsigned long)m66592); 1592 + timer_setup(&m66592->timer, m66592_timer, 0); 1593 1593 m66592->reg = reg; 1594 1594 1595 1595 ret = request_irq(ires->start, m66592_irq, IRQF_SHARED,
+3 -5
drivers/usb/gadget/udc/omap_udc.c
··· 1854 1854 #define PIO_OUT_TIMEOUT (jiffies + HZ/3) 1855 1855 #define HALF_FULL(f) (!((f)&(UDC_NON_ISO_FIFO_FULL|UDC_NON_ISO_FIFO_EMPTY))) 1856 1856 1857 - static void pio_out_timer(unsigned long _ep) 1857 + static void pio_out_timer(struct timer_list *t) 1858 1858 { 1859 - struct omap_ep *ep = (void *) _ep; 1859 + struct omap_ep *ep = from_timer(ep, t, timer); 1860 1860 unsigned long flags; 1861 1861 u16 stat_flg; 1862 1862 ··· 2542 2542 } 2543 2543 if (dbuf && addr) 2544 2544 epn_rxtx |= UDC_EPN_RX_DB; 2545 - init_timer(&ep->timer); 2546 - ep->timer.function = pio_out_timer; 2547 - ep->timer.data = (unsigned long) ep; 2545 + timer_setup(&ep->timer, pio_out_timer, 0); 2548 2546 } 2549 2547 if (addr) 2550 2548 epn_rxtx |= UDC_EPN_RX_VALID;
+3 -3
drivers/usb/gadget/udc/pxa25x_udc.c
··· 1624 1624 nuke(&dev->ep[i], -ECONNABORTED); 1625 1625 } 1626 1626 1627 - static void udc_watchdog(unsigned long _dev) 1627 + static void udc_watchdog(struct timer_list *t) 1628 1628 { 1629 - struct pxa25x_udc *dev = (void *)_dev; 1629 + struct pxa25x_udc *dev = from_timer(dev, t, timer); 1630 1630 1631 1631 local_irq_disable(); 1632 1632 if (dev->ep0state == EP0_STALL ··· 2413 2413 gpio_direction_output(dev->mach->gpio_pullup, 0); 2414 2414 } 2415 2415 2416 - setup_timer(&dev->timer, udc_watchdog, (unsigned long)dev); 2416 + timer_setup(&dev->timer, udc_watchdog, 0); 2417 2417 2418 2418 the_controller = dev; 2419 2419 platform_set_drvdata(pdev, dev);
+3 -3
drivers/usb/gadget/udc/r8a66597-udc.c
··· 1514 1514 return IRQ_HANDLED; 1515 1515 } 1516 1516 1517 - static void r8a66597_timer(unsigned long _r8a66597) 1517 + static void r8a66597_timer(struct timer_list *t) 1518 1518 { 1519 - struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; 1519 + struct r8a66597 *r8a66597 = from_timer(r8a66597, t, timer); 1520 1520 unsigned long flags; 1521 1521 u16 tmp; 1522 1522 ··· 1874 1874 r8a66597->gadget.max_speed = USB_SPEED_HIGH; 1875 1875 r8a66597->gadget.name = udc_name; 1876 1876 1877 - setup_timer(&r8a66597->timer, r8a66597_timer, (unsigned long)r8a66597); 1877 + timer_setup(&r8a66597->timer, r8a66597_timer, 0); 1878 1878 r8a66597->reg = reg; 1879 1879 1880 1880 if (r8a66597->pdata->on_chip) {
+4 -5
drivers/usb/host/ohci-hcd.c
··· 80 80 81 81 static void ohci_dump(struct ohci_hcd *ohci); 82 82 static void ohci_stop(struct usb_hcd *hcd); 83 - static void io_watchdog_func(unsigned long _ohci); 83 + static void io_watchdog_func(struct timer_list *t); 84 84 85 85 #include "ohci-hub.c" 86 86 #include "ohci-dbg.c" ··· 500 500 if (ohci->hcca) 501 501 return 0; 502 502 503 - setup_timer(&ohci->io_watchdog, io_watchdog_func, 504 - (unsigned long) ohci); 503 + timer_setup(&ohci->io_watchdog, io_watchdog_func, 0); 505 504 506 505 ohci->hcca = dma_alloc_coherent (hcd->self.controller, 507 506 sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL); ··· 722 723 * the unlink list. As a result, URBs could never be dequeued and 723 724 * endpoints could never be released. 724 725 */ 725 - static void io_watchdog_func(unsigned long _ohci) 726 + static void io_watchdog_func(struct timer_list *t) 726 727 { 727 - struct ohci_hcd *ohci = (struct ohci_hcd *) _ohci; 728 + struct ohci_hcd *ohci = from_timer(ohci, t, io_watchdog); 728 729 bool takeback_all_pending = false; 729 730 u32 status; 730 731 u32 head;
+3 -3
drivers/usb/host/oxu210hp-hcd.c
··· 2539 2539 return ret; 2540 2540 } 2541 2541 2542 - static void oxu_watchdog(unsigned long param) 2542 + static void oxu_watchdog(struct timer_list *t) 2543 2543 { 2544 - struct oxu_hcd *oxu = (struct oxu_hcd *) param; 2544 + struct oxu_hcd *oxu = from_timer(oxu, t, watchdog); 2545 2545 unsigned long flags; 2546 2546 2547 2547 spin_lock_irqsave(&oxu->lock, flags); ··· 2577 2577 2578 2578 spin_lock_init(&oxu->lock); 2579 2579 2580 - setup_timer(&oxu->watchdog, oxu_watchdog, (unsigned long)oxu); 2580 + timer_setup(&oxu->watchdog, oxu_watchdog, 0); 2581 2581 2582 2582 /* 2583 2583 * hw default: 1K periodic list heads, one per frame.
+3 -4
drivers/usb/host/r8a66597-hcd.c
··· 1798 1798 spin_unlock_irqrestore(&r8a66597->lock, flags); 1799 1799 } 1800 1800 1801 - static void r8a66597_timer(unsigned long _r8a66597) 1801 + static void r8a66597_timer(struct timer_list *t) 1802 1802 { 1803 - struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; 1803 + struct r8a66597 *r8a66597 = from_timer(r8a66597, t, rh_timer); 1804 1804 unsigned long flags; 1805 1805 int port; 1806 1806 ··· 2472 2472 r8a66597->max_root_hub = 2; 2473 2473 2474 2474 spin_lock_init(&r8a66597->lock); 2475 - setup_timer(&r8a66597->rh_timer, r8a66597_timer, 2476 - (unsigned long)r8a66597); 2475 + timer_setup(&r8a66597->rh_timer, r8a66597_timer, 0); 2477 2476 r8a66597->reg = reg; 2478 2477 2479 2478 /* make sure no interrupts are pending */
+3 -3
drivers/usb/host/sl811-hcd.c
··· 1119 1119 } 1120 1120 1121 1121 static void 1122 - sl811h_timer(unsigned long _sl811) 1122 + sl811h_timer(struct timer_list *t) 1123 1123 { 1124 - struct sl811 *sl811 = (void *) _sl811; 1124 + struct sl811 *sl811 = from_timer(sl811, t, timer); 1125 1125 unsigned long flags; 1126 1126 u8 irqstat; 1127 1127 u8 signaling = sl811->ctrl1 & SL11H_CTL1MASK_FORCE; ··· 1692 1692 spin_lock_init(&sl811->lock); 1693 1693 INIT_LIST_HEAD(&sl811->async); 1694 1694 sl811->board = dev_get_platdata(&dev->dev); 1695 - setup_timer(&sl811->timer, sl811h_timer, (unsigned long)sl811); 1695 + timer_setup(&sl811->timer, sl811h_timer, 0); 1696 1696 sl811->addr_reg = addr_reg; 1697 1697 sl811->data_reg = data_reg; 1698 1698
+1 -2
drivers/usb/host/uhci-hcd.c
··· 585 585 hcd->self.sg_tablesize = ~0; 586 586 587 587 spin_lock_init(&uhci->lock); 588 - setup_timer(&uhci->fsbr_timer, uhci_fsbr_timeout, 589 - (unsigned long) uhci); 588 + timer_setup(&uhci->fsbr_timer, uhci_fsbr_timeout, 0); 590 589 INIT_LIST_HEAD(&uhci->idle_qh_list); 591 590 init_waitqueue_head(&uhci->waitqh); 592 591
+2 -2
drivers/usb/host/uhci-q.c
··· 90 90 } 91 91 } 92 92 93 - static void uhci_fsbr_timeout(unsigned long _uhci) 93 + static void uhci_fsbr_timeout(struct timer_list *t) 94 94 { 95 - struct uhci_hcd *uhci = (struct uhci_hcd *) _uhci; 95 + struct uhci_hcd *uhci = from_timer(uhci, t, fsbr_timer); 96 96 unsigned long flags; 97 97 98 98 spin_lock_irqsave(&uhci->lock, flags);
+4 -4
drivers/usb/host/xhci.c
··· 395 395 396 396 #endif 397 397 398 - static void compliance_mode_recovery(unsigned long arg) 398 + static void compliance_mode_recovery(struct timer_list *t) 399 399 { 400 400 struct xhci_hcd *xhci; 401 401 struct usb_hcd *hcd; 402 402 u32 temp; 403 403 int i; 404 404 405 - xhci = (struct xhci_hcd *)arg; 405 + xhci = from_timer(xhci, t, comp_mode_recovery_timer); 406 406 407 407 for (i = 0; i < xhci->num_usb3_ports; i++) { 408 408 temp = readl(xhci->usb3_ports[i]); ··· 443 443 static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci) 444 444 { 445 445 xhci->port_status_u0 = 0; 446 - setup_timer(&xhci->comp_mode_recovery_timer, 447 - compliance_mode_recovery, (unsigned long)xhci); 446 + timer_setup(&xhci->comp_mode_recovery_timer, compliance_mode_recovery, 447 + 0); 448 448 xhci->comp_mode_recovery_timer.expires = jiffies + 449 449 msecs_to_jiffies(COMP_MODE_RCVRY_MSECS); 450 450
+7 -8
drivers/usb/serial/mos7840.c
··· 555 555 val, reg, NULL, 0, MOS_WDR_TIMEOUT); 556 556 } 557 557 558 - static void mos7840_led_off(unsigned long arg) 558 + static void mos7840_led_off(struct timer_list *t) 559 559 { 560 - struct moschip_port *mcs = (struct moschip_port *) arg; 560 + struct moschip_port *mcs = from_timer(mcs, t, led_timer1); 561 561 562 562 /* Turn off LED */ 563 563 mos7840_set_led_async(mcs, 0x0300, MODEM_CONTROL_REGISTER); ··· 565 565 jiffies + msecs_to_jiffies(LED_OFF_MS)); 566 566 } 567 567 568 - static void mos7840_led_flag_off(unsigned long arg) 568 + static void mos7840_led_flag_off(struct timer_list *t) 569 569 { 570 - struct moschip_port *mcs = (struct moschip_port *) arg; 570 + struct moschip_port *mcs = from_timer(mcs, t, led_timer2); 571 571 572 572 clear_bit_unlock(MOS7840_FLAG_LED_BUSY, &mcs->flags); 573 573 } ··· 2289 2289 goto error; 2290 2290 } 2291 2291 2292 - setup_timer(&mos7840_port->led_timer1, mos7840_led_off, 2293 - (unsigned long)mos7840_port); 2292 + timer_setup(&mos7840_port->led_timer1, mos7840_led_off, 0); 2294 2293 mos7840_port->led_timer1.expires = 2295 2294 jiffies + msecs_to_jiffies(LED_ON_MS); 2296 - setup_timer(&mos7840_port->led_timer2, mos7840_led_flag_off, 2297 - (unsigned long)mos7840_port); 2295 + timer_setup(&mos7840_port->led_timer2, mos7840_led_flag_off, 2296 + 0); 2298 2297 mos7840_port->led_timer2.expires = 2299 2298 jiffies + msecs_to_jiffies(LED_OFF_MS); 2300 2299
+3 -4
drivers/usb/storage/realtek_cr.c
··· 751 751 mod_timer(&chip->rts51x_suspend_timer, chip->timer_expires); 752 752 } 753 753 754 - static void rts51x_suspend_timer_fn(unsigned long data) 754 + static void rts51x_suspend_timer_fn(struct timer_list *t) 755 755 { 756 - struct rts51x_chip *chip = (struct rts51x_chip *)data; 756 + struct rts51x_chip *chip = from_timer(chip, t, rts51x_suspend_timer); 757 757 struct us_data *us = chip->us; 758 758 759 759 switch (rts51x_get_stat(chip)) { ··· 917 917 us->proto_handler = rts51x_invoke_transport; 918 918 919 919 chip->timer_expires = 0; 920 - setup_timer(&chip->rts51x_suspend_timer, rts51x_suspend_timer_fn, 921 - (unsigned long)chip); 920 + timer_setup(&chip->rts51x_suspend_timer, rts51x_suspend_timer_fn, 0); 922 921 fw5895_init(us); 923 922 924 923 /* enable autosuspend function of the usb device */
+3 -3
drivers/uwb/drp.c
··· 603 603 mutex_unlock(&rc->rsvs_mutex); 604 604 } 605 605 606 - static void uwb_cnflt_timer(unsigned long arg) 606 + static void uwb_cnflt_timer(struct timer_list *t) 607 607 { 608 - struct uwb_cnflt_alien *cnflt = (struct uwb_cnflt_alien *)arg; 608 + struct uwb_cnflt_alien *cnflt = from_timer(cnflt, t, timer); 609 609 610 610 queue_work(cnflt->rc->rsv_workq, &cnflt->cnflt_update_work); 611 611 } ··· 642 642 } 643 643 644 644 INIT_LIST_HEAD(&cnflt->rc_node); 645 - setup_timer(&cnflt->timer, uwb_cnflt_timer, (unsigned long)cnflt); 645 + timer_setup(&cnflt->timer, uwb_cnflt_timer, 0); 646 646 647 647 cnflt->rc = rc; 648 648 INIT_WORK(&cnflt->cnflt_update_work, uwb_cnflt_update_work);
+4 -4
drivers/uwb/neh.c
··· 115 115 struct list_head list_node; 116 116 }; 117 117 118 - static void uwb_rc_neh_timer(unsigned long arg); 118 + static void uwb_rc_neh_timer(struct timer_list *t); 119 119 120 120 static void uwb_rc_neh_release(struct kref *kref) 121 121 { ··· 223 223 224 224 kref_init(&neh->kref); 225 225 INIT_LIST_HEAD(&neh->list_node); 226 - setup_timer(&neh->timer, uwb_rc_neh_timer, (unsigned long)neh); 226 + timer_setup(&neh->timer, uwb_rc_neh_timer, 0); 227 227 228 228 neh->rc = rc; 229 229 neh->evt_type = expected_type; ··· 565 565 EXPORT_SYMBOL_GPL(uwb_rc_neh_error); 566 566 567 567 568 - static void uwb_rc_neh_timer(unsigned long arg) 568 + static void uwb_rc_neh_timer(struct timer_list *t) 569 569 { 570 - struct uwb_rc_neh *neh = (struct uwb_rc_neh *)arg; 570 + struct uwb_rc_neh *neh = from_timer(neh, t, timer); 571 571 struct uwb_rc *rc = neh->rc; 572 572 unsigned long flags; 573 573
+7 -8
drivers/uwb/rsv.c
··· 23 23 24 24 #include "uwb-internal.h" 25 25 26 - static void uwb_rsv_timer(unsigned long arg); 26 + static void uwb_rsv_timer(struct timer_list *t); 27 27 28 28 static const char *rsv_states[] = { 29 29 [UWB_RSV_STATE_NONE] = "none ", ··· 198 198 dev_dbg(dev, "put stream %d\n", rsv->stream); 199 199 } 200 200 201 - void uwb_rsv_backoff_win_timer(unsigned long arg) 201 + void uwb_rsv_backoff_win_timer(struct timer_list *t) 202 202 { 203 - struct uwb_drp_backoff_win *bow = (struct uwb_drp_backoff_win *)arg; 203 + struct uwb_drp_backoff_win *bow = from_timer(bow, t, timer); 204 204 struct uwb_rc *rc = container_of(bow, struct uwb_rc, bow); 205 205 struct device *dev = &rc->uwb_dev.dev; 206 206 ··· 470 470 INIT_LIST_HEAD(&rsv->rc_node); 471 471 INIT_LIST_HEAD(&rsv->pal_node); 472 472 kref_init(&rsv->kref); 473 - setup_timer(&rsv->timer, uwb_rsv_timer, (unsigned long)rsv); 473 + timer_setup(&rsv->timer, uwb_rsv_timer, 0); 474 474 475 475 rsv->rc = rc; 476 476 INIT_WORK(&rsv->handle_timeout_work, uwb_rsv_handle_timeout_work); ··· 939 939 mutex_unlock(&rc->rsvs_mutex); 940 940 } 941 941 942 - static void uwb_rsv_timer(unsigned long arg) 942 + static void uwb_rsv_timer(struct timer_list *t) 943 943 { 944 - struct uwb_rsv *rsv = (struct uwb_rsv *)arg; 944 + struct uwb_rsv *rsv = from_timer(rsv, t, timer); 945 945 946 946 queue_work(rsv->rc->rsv_workq, &rsv->handle_timeout_work); 947 947 } ··· 987 987 rc->bow.can_reserve_extra_mases = true; 988 988 rc->bow.total_expired = 0; 989 989 rc->bow.window = UWB_DRP_BACKOFF_WIN_MIN >> 1; 990 - setup_timer(&rc->bow.timer, uwb_rsv_backoff_win_timer, 991 - (unsigned long)&rc->bow); 990 + timer_setup(&rc->bow.timer, uwb_rsv_backoff_win_timer, 0); 992 991 993 992 bitmap_complement(rc->uwb_dev.streams, rc->uwb_dev.streams, UWB_NUM_STREAMS); 994 993 }
+1 -1
drivers/uwb/uwb-internal.h
··· 329 329 bool uwb_rsv_has_two_drp_ies(struct uwb_rsv *rsv); 330 330 void uwb_rsv_dump(char *text, struct uwb_rsv *rsv); 331 331 int uwb_rsv_try_move(struct uwb_rsv *rsv, struct uwb_mas_bm *available); 332 - void uwb_rsv_backoff_win_timer(unsigned long arg); 332 + void uwb_rsv_backoff_win_timer(struct timer_list *t); 333 333 void uwb_rsv_backoff_win_increment(struct uwb_rc *rc); 334 334 int uwb_rsv_status(struct uwb_rsv *rsv); 335 335 int uwb_rsv_companion_status(struct uwb_rsv *rsv);
+2 -2
drivers/watchdog/alim7101_wdt.c
··· 70 70 MODULE_PARM_DESC(use_gpio, 71 71 "Use the gpio watchdog (required by old cobalt boards)."); 72 72 73 - static void wdt_timer_ping(unsigned long); 73 + static void wdt_timer_ping(struct timer_list *); 74 74 static DEFINE_TIMER(timer, wdt_timer_ping); 75 75 static unsigned long next_heartbeat; 76 76 static unsigned long wdt_is_open; ··· 87 87 * Whack the dog 88 88 */ 89 89 90 - static void wdt_timer_ping(unsigned long unused) 90 + static void wdt_timer_ping(struct timer_list *unused) 91 91 { 92 92 /* If we got a heartbeat pulse within the WDT_US_INTERVAL 93 93 * we agree to ping the WDT
+3 -3
drivers/watchdog/at91sam9_wdt.c
··· 120 120 /* 121 121 * Timer tick 122 122 */ 123 - static void at91_ping(unsigned long data) 123 + static void at91_ping(struct timer_list *t) 124 124 { 125 - struct at91wdt *wdt = (struct at91wdt *)data; 125 + struct at91wdt *wdt = from_timer(wdt, t, timer); 126 126 if (time_before(jiffies, wdt->next_heartbeat) || 127 127 !watchdog_active(&wdt->wdd)) { 128 128 at91_wdt_reset(wdt); ··· 222 222 "watchdog already configured differently (mr = %x expecting %x)\n", 223 223 tmp & wdt->mr_mask, wdt->mr & wdt->mr_mask); 224 224 225 - setup_timer(&wdt->timer, at91_ping, (unsigned long)wdt); 225 + timer_setup(&wdt->timer, at91_ping, 0); 226 226 227 227 /* 228 228 * Use min_heartbeat the first time to avoid spurious watchdog reset:
+4 -5
drivers/watchdog/bcm47xx_wdt.c
··· 106 106 .restart = bcm47xx_wdt_restart, 107 107 }; 108 108 109 - static void bcm47xx_wdt_soft_timer_tick(unsigned long data) 109 + static void bcm47xx_wdt_soft_timer_tick(struct timer_list *t) 110 110 { 111 - struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data; 111 + struct bcm47xx_wdt *wdt = from_timer(wdt, t, soft_timer); 112 112 u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms); 113 113 114 114 if (!atomic_dec_and_test(&wdt->soft_ticks)) { ··· 133 133 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); 134 134 135 135 bcm47xx_wdt_soft_keepalive(wdd); 136 - bcm47xx_wdt_soft_timer_tick((unsigned long)wdt); 136 + bcm47xx_wdt_soft_timer_tick(&wdt->soft_timer); 137 137 138 138 return 0; 139 139 } ··· 190 190 191 191 if (soft) { 192 192 wdt->wdd.ops = &bcm47xx_wdt_soft_ops; 193 - setup_timer(&wdt->soft_timer, bcm47xx_wdt_soft_timer_tick, 194 - (long unsigned int)wdt); 193 + timer_setup(&wdt->soft_timer, bcm47xx_wdt_soft_timer_tick, 0); 195 194 } else { 196 195 wdt->wdd.ops = &bcm47xx_wdt_hard_ops; 197 196 }
+2 -2
drivers/watchdog/bcm63xx_wdt.c
··· 77 77 die(PFX " fire", regs); 78 78 } 79 79 80 - static void bcm63xx_timer_tick(unsigned long unused) 80 + static void bcm63xx_timer_tick(struct timer_list *unused) 81 81 { 82 82 if (!atomic_dec_and_test(&bcm63xx_wdt_device.ticks)) { 83 83 bcm63xx_wdt_hw_start(); ··· 240 240 int ret; 241 241 struct resource *r; 242 242 243 - setup_timer(&bcm63xx_wdt_device.timer, bcm63xx_timer_tick, 0L); 243 + timer_setup(&bcm63xx_wdt_device.timer, bcm63xx_timer_tick, 0); 244 244 245 245 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 246 246 if (!r) {
+2 -2
drivers/watchdog/cpu5wdt.c
··· 69 69 70 70 /* generic helper functions */ 71 71 72 - static void cpu5wdt_trigger(unsigned long unused) 72 + static void cpu5wdt_trigger(struct timer_list *unused) 73 73 { 74 74 if (verbose > 2) 75 75 pr_debug("trigger at %i ticks\n", ticks); ··· 224 224 225 225 init_completion(&cpu5wdt_device.stop); 226 226 cpu5wdt_device.queue = 0; 227 - setup_timer(&cpu5wdt_device.timer, cpu5wdt_trigger, 0); 227 + timer_setup(&cpu5wdt_device.timer, cpu5wdt_trigger, 0); 228 228 cpu5wdt_device.default_ticks = ticks; 229 229 230 230 if (!request_region(port, CPU5WDT_EXTENT, PFX)) {
+2 -2
drivers/watchdog/machzwd.c
··· 121 121 MODULE_PARM_DESC(action, "after watchdog resets, generate: " 122 122 "0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI"); 123 123 124 - static void zf_ping(unsigned long data); 124 + static void zf_ping(struct timer_list *unused); 125 125 126 126 static int zf_action = GEN_RESET; 127 127 static unsigned long zf_is_open; ··· 237 237 } 238 238 239 239 240 - static void zf_ping(unsigned long data) 240 + static void zf_ping(struct timer_list *unused) 241 241 { 242 242 unsigned int ctrl_reg = 0; 243 243 unsigned long flags;
+2 -2
drivers/watchdog/mixcomwd.c
··· 99 99 {0x0000, 0}, 100 100 }; 101 101 102 - static void mixcomwd_timerfun(unsigned long d); 102 + static void mixcomwd_timerfun(struct timer_list *unused); 103 103 104 104 static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */ 105 105 ··· 120 120 return; 121 121 } 122 122 123 - static void mixcomwd_timerfun(unsigned long d) 123 + static void mixcomwd_timerfun(struct timer_list *unused) 124 124 { 125 125 mixcomwd_ping(); 126 126 mod_timer(&mixcomwd_timer, jiffies + 5 * HZ);
+3 -4
drivers/watchdog/mpc8xxx_wdt.c
··· 80 80 spin_unlock(&ddata->lock); 81 81 } 82 82 83 - static void mpc8xxx_wdt_timer_ping(unsigned long arg) 83 + static void mpc8xxx_wdt_timer_ping(struct timer_list *t) 84 84 { 85 - struct mpc8xxx_wdt_ddata *ddata = (void *)arg; 85 + struct mpc8xxx_wdt_ddata *ddata = from_timer(ddata, t, timer); 86 86 87 87 mpc8xxx_wdt_keepalive(ddata); 88 88 /* We're pinging it twice faster than needed, just to be sure. */ ··· 173 173 } 174 174 175 175 spin_lock_init(&ddata->lock); 176 - setup_timer(&ddata->timer, mpc8xxx_wdt_timer_ping, 177 - (unsigned long)ddata); 176 + timer_setup(&ddata->timer, mpc8xxx_wdt_timer_ping, 0); 178 177 179 178 ddata->wdd.info = &mpc8xxx_wdt_info, 180 179 ddata->wdd.ops = &mpc8xxx_wdt_ops,
+2 -2
drivers/watchdog/mtx-1_wdt.c
··· 68 68 unsigned int gstate; 69 69 } mtx1_wdt_device; 70 70 71 - static void mtx1_wdt_trigger(unsigned long unused) 71 + static void mtx1_wdt_trigger(struct timer_list *unused) 72 72 { 73 73 spin_lock(&mtx1_wdt_device.lock); 74 74 if (mtx1_wdt_device.running) ··· 219 219 init_completion(&mtx1_wdt_device.stop); 220 220 mtx1_wdt_device.queue = 0; 221 221 clear_bit(0, &mtx1_wdt_device.inuse); 222 - setup_timer(&mtx1_wdt_device.timer, mtx1_wdt_trigger, 0L); 222 + timer_setup(&mtx1_wdt_device.timer, mtx1_wdt_trigger, 0); 223 223 mtx1_wdt_device.default_ticks = ticks; 224 224 225 225 ret = misc_register(&mtx1_wdt_misc);
+2 -2
drivers/watchdog/nuc900_wdt.c
··· 216 216 return len; 217 217 } 218 218 219 - static void nuc900_wdt_timer_ping(unsigned long data) 219 + static void nuc900_wdt_timer_ping(struct timer_list *unused) 220 220 { 221 221 if (time_before(jiffies, nuc900_wdt->next_heartbeat)) { 222 222 nuc900_wdt_keepalive(); ··· 267 267 268 268 clk_enable(nuc900_wdt->wdt_clock); 269 269 270 - setup_timer(&nuc900_wdt->timer, nuc900_wdt_timer_ping, 0); 270 + timer_setup(&nuc900_wdt->timer, nuc900_wdt_timer_ping, 0); 271 271 272 272 ret = misc_register(&nuc900wdt_miscdev); 273 273 if (ret) {
+2 -2
drivers/watchdog/pcwd.c
··· 367 367 pr_info("No previous trip detected - Cold boot or reset\n"); 368 368 } 369 369 370 - static void pcwd_timer_ping(unsigned long data) 370 + static void pcwd_timer_ping(struct timer_list *unused) 371 371 { 372 372 int wdrst_stat; 373 373 ··· 893 893 /* clear the "card caused reboot" flag */ 894 894 pcwd_clear_status(); 895 895 896 - setup_timer(&pcwd_private.timer, pcwd_timer_ping, 0); 896 + timer_setup(&pcwd_private.timer, pcwd_timer_ping, 0); 897 897 898 898 /* Disable the board */ 899 899 pcwd_stop();
+2 -2
drivers/watchdog/pika_wdt.c
··· 85 85 /* 86 86 * Timer tick 87 87 */ 88 - static void pikawdt_ping(unsigned long data) 88 + static void pikawdt_ping(struct timer_list *unused) 89 89 { 90 90 if (time_before(jiffies, pikawdt_private.next_heartbeat) || 91 91 (!nowayout && !pikawdt_private.open)) { ··· 269 269 270 270 iounmap(fpga); 271 271 272 - setup_timer(&pikawdt_private.timer, pikawdt_ping, 0); 272 + timer_setup(&pikawdt_private.timer, pikawdt_ping, 0); 273 273 274 274 ret = misc_register(&pikawdt_miscdev); 275 275 if (ret) {
+2 -2
drivers/watchdog/rdc321x_wdt.c
··· 67 67 68 68 /* generic helper functions */ 69 69 70 - static void rdc321x_wdt_trigger(unsigned long unused) 70 + static void rdc321x_wdt_trigger(struct timer_list *unused) 71 71 { 72 72 unsigned long flags; 73 73 u32 val; ··· 262 262 263 263 clear_bit(0, &rdc321x_wdt_device.inuse); 264 264 265 - setup_timer(&rdc321x_wdt_device.timer, rdc321x_wdt_trigger, 0); 265 + timer_setup(&rdc321x_wdt_device.timer, rdc321x_wdt_trigger, 0); 266 266 267 267 rdc321x_wdt_device.default_ticks = ticks; 268 268
+2 -2
drivers/watchdog/sbc60xxwdt.c
··· 112 112 "Watchdog cannot be stopped once started (default=" 113 113 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 114 114 115 - static void wdt_timer_ping(unsigned long); 115 + static void wdt_timer_ping(struct timer_list *); 116 116 static DEFINE_TIMER(timer, wdt_timer_ping); 117 117 static unsigned long next_heartbeat; 118 118 static unsigned long wdt_is_open; ··· 122 122 * Whack the dog 123 123 */ 124 124 125 - static void wdt_timer_ping(unsigned long data) 125 + static void wdt_timer_ping(struct timer_list *unused) 126 126 { 127 127 /* If we got a heartbeat pulse within the WDT_US_INTERVAL 128 128 * we agree to ping the WDT
+2 -2
drivers/watchdog/sc520_wdt.c
··· 123 123 124 124 static __u16 __iomem *wdtmrctl; 125 125 126 - static void wdt_timer_ping(unsigned long); 126 + static void wdt_timer_ping(struct timer_list *); 127 127 static DEFINE_TIMER(timer, wdt_timer_ping); 128 128 static unsigned long next_heartbeat; 129 129 static unsigned long wdt_is_open; ··· 134 134 * Whack the dog 135 135 */ 136 136 137 - static void wdt_timer_ping(unsigned long data) 137 + static void wdt_timer_ping(struct timer_list *unused) 138 138 { 139 139 /* If we got a heartbeat pulse within the WDT_US_INTERVAL 140 140 * we agree to ping the WDT
+3 -3
drivers/watchdog/shwdt.c
··· 175 175 return 0; 176 176 } 177 177 178 - static void sh_wdt_ping(unsigned long data) 178 + static void sh_wdt_ping(struct timer_list *t) 179 179 { 180 - struct sh_wdt *wdt = (struct sh_wdt *)data; 180 + struct sh_wdt *wdt = from_timer(wdt, t, timer); 181 181 unsigned long flags; 182 182 183 183 spin_lock_irqsave(&wdt->lock, flags); ··· 275 275 return rc; 276 276 } 277 277 278 - setup_timer(&wdt->timer, sh_wdt_ping, (unsigned long)wdt); 278 + timer_setup(&wdt->timer, sh_wdt_ping, 0); 279 279 wdt->timer.expires = next_ping_period(clock_division_ratio); 280 280 281 281 dev_info(&pdev->dev, "initialized.\n");
+2 -2
drivers/watchdog/via_wdt.c
··· 67 67 static struct resource wdt_res; 68 68 static void __iomem *wdt_mem; 69 69 static unsigned int mmio; 70 - static void wdt_timer_tick(unsigned long data); 70 + static void wdt_timer_tick(struct timer_list *unused); 71 71 static DEFINE_TIMER(timer, wdt_timer_tick); 72 72 /* The timer that pings the watchdog */ 73 73 static unsigned long next_heartbeat; /* the next_heartbeat for the timer */ ··· 88 88 * then the external/userspace heartbeat). 89 89 * 2) the watchdog timer has been stopped by userspace. 90 90 */ 91 - static void wdt_timer_tick(unsigned long data) 91 + static void wdt_timer_tick(struct timer_list *unused) 92 92 { 93 93 if (time_before(jiffies, next_heartbeat) || 94 94 (!watchdog_active(&wdt_dev))) {
+2 -2
drivers/watchdog/w83877f_wdt.c
··· 97 97 "Watchdog cannot be stopped once started (default=" 98 98 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 99 99 100 - static void wdt_timer_ping(unsigned long); 100 + static void wdt_timer_ping(struct timer_list *); 101 101 static DEFINE_TIMER(timer, wdt_timer_ping); 102 102 static unsigned long next_heartbeat; 103 103 static unsigned long wdt_is_open; ··· 108 108 * Whack the dog 109 109 */ 110 110 111 - static void wdt_timer_ping(unsigned long data) 111 + static void wdt_timer_ping(struct timer_list *unused) 112 112 { 113 113 /* If we got a heartbeat pulse within the WDT_US_INTERVAL 114 114 * we agree to ping the WDT
+2 -2
drivers/xen/grant-table.c
··· 358 358 struct page *page; 359 359 }; 360 360 static LIST_HEAD(deferred_list); 361 - static void gnttab_handle_deferred(unsigned long); 361 + static void gnttab_handle_deferred(struct timer_list *); 362 362 static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred); 363 363 364 - static void gnttab_handle_deferred(unsigned long unused) 364 + static void gnttab_handle_deferred(struct timer_list *unused) 365 365 { 366 366 unsigned int nr = 10; 367 367 struct deferred_entry *first = NULL;
+4 -5
fs/ocfs2/cluster/tcp.c
··· 140 140 static void o2net_shutdown_sc(struct work_struct *work); 141 141 static void o2net_listen_data_ready(struct sock *sk); 142 142 static void o2net_sc_send_keep_req(struct work_struct *work); 143 - static void o2net_idle_timer(unsigned long data); 143 + static void o2net_idle_timer(struct timer_list *t); 144 144 static void o2net_sc_postpone_idle(struct o2net_sock_container *sc); 145 145 static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc); 146 146 ··· 450 450 INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc); 451 451 INIT_DELAYED_WORK(&sc->sc_keepalive_work, o2net_sc_send_keep_req); 452 452 453 - setup_timer(&sc->sc_idle_timeout, o2net_idle_timer, 454 - (unsigned long)sc); 453 + timer_setup(&sc->sc_idle_timeout, o2net_idle_timer, 0); 455 454 456 455 sclog(sc, "alloced\n"); 457 456 ··· 1516 1517 /* socket shutdown does a del_timer_sync against this as it tears down. 1517 1518 * we can't start this timer until we've got to the point in sc buildup 1518 1519 * where shutdown is going to be involved */ 1519 - static void o2net_idle_timer(unsigned long data) 1520 + static void o2net_idle_timer(struct timer_list *t) 1520 1521 { 1521 - struct o2net_sock_container *sc = (struct o2net_sock_container *)data; 1522 + struct o2net_sock_container *sc = from_timer(sc, t, sc_idle_timeout); 1522 1523 struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); 1523 1524 #ifdef CONFIG_DEBUG_FS 1524 1525 unsigned long msecs = ktime_to_ms(ktime_get()) -
+2 -2
fs/pstore/platform.c
··· 61 61 62 62 static int pstore_new_entry; 63 63 64 - static void pstore_timefunc(unsigned long); 64 + static void pstore_timefunc(struct timer_list *); 65 65 static DEFINE_TIMER(pstore_timer, pstore_timefunc); 66 66 67 67 static void pstore_dowork(struct work_struct *); ··· 890 890 pstore_get_records(1); 891 891 } 892 892 893 - static void pstore_timefunc(unsigned long dummy) 893 + static void pstore_timefunc(struct timer_list *unused) 894 894 { 895 895 if (pstore_new_entry) { 896 896 pstore_new_entry = 0;
+4 -6
include/linux/kthread.h
··· 118 118 119 119 #define KTHREAD_DELAYED_WORK_INIT(dwork, fn) { \ 120 120 .work = KTHREAD_WORK_INIT((dwork).work, (fn)), \ 121 - .timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\ 122 - (TIMER_DATA_TYPE)&(dwork.timer), \ 121 + .timer = __TIMER_INITIALIZER(kthread_delayed_work_timer_fn,\ 123 122 TIMER_IRQSAFE), \ 124 123 } 125 124 ··· 164 165 #define kthread_init_delayed_work(dwork, fn) \ 165 166 do { \ 166 167 kthread_init_work(&(dwork)->work, (fn)); \ 167 - __setup_timer(&(dwork)->timer, \ 168 - (TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\ 169 - (TIMER_DATA_TYPE)&(dwork)->timer, \ 170 - TIMER_IRQSAFE); \ 168 + __init_timer(&(dwork)->timer, \ 169 + kthread_delayed_work_timer_fn, \ 170 + TIMER_IRQSAFE); \ 171 171 } while (0) 172 172 173 173 int kthread_worker_fn(void *worker_ptr);
-7
include/linux/timekeeper_internal.h
··· 136 136 extern void update_vsyscall(struct timekeeper *tk); 137 137 extern void update_vsyscall_tz(void); 138 138 139 - #elif defined(CONFIG_GENERIC_TIME_VSYSCALL_OLD) 140 - 141 - extern void update_vsyscall_old(struct timespec *ts, struct timespec *wtm, 142 - struct clocksource *c, u32 mult, 143 - u64 cycle_last); 144 - extern void update_vsyscall_tz(void); 145 - 146 139 #else 147 140 148 141 static inline void update_vsyscall(struct timekeeper *tk)
-6
include/linux/timekeeping.h
··· 143 143 extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); 144 144 145 145 /* 146 - * PPS accessor 147 - */ 148 - extern void ktime_get_raw_and_real_ts64(struct timespec64 *ts_raw, 149 - struct timespec64 *ts_real); 150 - 151 - /* 152 146 * struct system_time_snapshot - simultaneous raw/real time capture with 153 147 * counter value 154 148 * @cycles: Clocksource counter value to produce the system times
+41 -83
include/linux/timer.h
··· 17 17 */ 18 18 struct hlist_node entry; 19 19 unsigned long expires; 20 - void (*function)(unsigned long); 21 - unsigned long data; 20 + void (*function)(struct timer_list *); 22 21 u32 flags; 23 22 24 23 #ifdef CONFIG_LOCKDEP ··· 63 64 64 65 #define TIMER_TRACE_FLAGMASK (TIMER_MIGRATING | TIMER_DEFERRABLE | TIMER_PINNED | TIMER_IRQSAFE) 65 66 66 - #define TIMER_DATA_TYPE unsigned long 67 - #define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE) 68 - 69 - #define __TIMER_INITIALIZER(_function, _data, _flags) { \ 67 + #define __TIMER_INITIALIZER(_function, _flags) { \ 70 68 .entry = { .next = TIMER_ENTRY_STATIC }, \ 71 69 .function = (_function), \ 72 - .data = (_data), \ 73 70 .flags = (_flags), \ 74 71 __TIMER_LOCKDEP_MAP_INITIALIZER( \ 75 72 __FILE__ ":" __stringify(__LINE__)) \ ··· 73 78 74 79 #define DEFINE_TIMER(_name, _function) \ 75 80 struct timer_list _name = \ 76 - __TIMER_INITIALIZER((TIMER_FUNC_TYPE)_function, 0, 0) 81 + __TIMER_INITIALIZER(_function, 0) 77 82 78 - void init_timer_key(struct timer_list *timer, unsigned int flags, 83 + /* 84 + * LOCKDEP and DEBUG timer interfaces. 85 + */ 86 + void init_timer_key(struct timer_list *timer, 87 + void (*func)(struct timer_list *), unsigned int flags, 79 88 const char *name, struct lock_class_key *key); 80 89 81 90 #ifdef CONFIG_DEBUG_OBJECTS_TIMERS 82 91 extern void init_timer_on_stack_key(struct timer_list *timer, 92 + void (*func)(struct timer_list *), 83 93 unsigned int flags, const char *name, 84 94 struct lock_class_key *key); 85 - extern void destroy_timer_on_stack(struct timer_list *timer); 86 95 #else 87 - static inline void destroy_timer_on_stack(struct timer_list *timer) { } 88 96 static inline void init_timer_on_stack_key(struct timer_list *timer, 89 - unsigned int flags, const char *name, 97 + void (*func)(struct timer_list *), 98 + unsigned int flags, 99 + const char *name, 90 100 struct lock_class_key *key) 91 101 { 92 - init_timer_key(timer, flags, name, key); 102 + init_timer_key(timer, func, flags, name, key); 93 103 } 94 104 #endif 95 105 96 106 #ifdef CONFIG_LOCKDEP 97 - #define __init_timer(_timer, _flags) \ 107 + #define __init_timer(_timer, _fn, _flags) \ 98 108 do { \ 99 109 static struct lock_class_key __key; \ 100 - init_timer_key((_timer), (_flags), #_timer, &__key); \ 110 + init_timer_key((_timer), (_fn), (_flags), #_timer, &__key);\ 101 111 } while (0) 102 112 103 - #define __init_timer_on_stack(_timer, _flags) \ 113 + #define __init_timer_on_stack(_timer, _fn, _flags) \ 104 114 do { \ 105 115 static struct lock_class_key __key; \ 106 - init_timer_on_stack_key((_timer), (_flags), #_timer, &__key); \ 116 + init_timer_on_stack_key((_timer), (_fn), (_flags), \ 117 + #_timer, &__key); \ 107 118 } while (0) 108 119 #else 109 - #define __init_timer(_timer, _flags) \ 110 - init_timer_key((_timer), (_flags), NULL, NULL) 111 - #define __init_timer_on_stack(_timer, _flags) \ 112 - init_timer_on_stack_key((_timer), (_flags), NULL, NULL) 120 + #define __init_timer(_timer, _fn, _flags) \ 121 + init_timer_key((_timer), (_fn), (_flags), NULL, NULL) 122 + #define __init_timer_on_stack(_timer, _fn, _flags) \ 123 + init_timer_on_stack_key((_timer), (_fn), (_flags), NULL, NULL) 113 124 #endif 114 125 115 - #define init_timer(timer) \ 116 - __init_timer((timer), 0) 117 - 118 - #define __setup_timer(_timer, _fn, _data, _flags) \ 119 - do { \ 120 - __init_timer((_timer), (_flags)); \ 121 - (_timer)->function = (_fn); \ 122 - (_timer)->data = (_data); \ 123 - } while (0) 124 - 125 - #define __setup_timer_on_stack(_timer, _fn, _data, _flags) \ 126 - do { \ 127 - __init_timer_on_stack((_timer), (_flags)); \ 128 - (_timer)->function = (_fn); \ 129 - (_timer)->data = (_data); \ 130 - } while (0) 131 - 132 - #define setup_timer(timer, fn, data) \ 133 - __setup_timer((timer), (fn), (data), 0) 134 - #define setup_pinned_timer(timer, fn, data) \ 135 - __setup_timer((timer), (fn), (data), TIMER_PINNED) 136 - #define setup_deferrable_timer(timer, fn, data) \ 137 - __setup_timer((timer), (fn), (data), TIMER_DEFERRABLE) 138 - #define setup_pinned_deferrable_timer(timer, fn, data) \ 139 - __setup_timer((timer), (fn), (data), TIMER_DEFERRABLE | TIMER_PINNED) 140 - #define setup_timer_on_stack(timer, fn, data) \ 141 - __setup_timer_on_stack((timer), (fn), (data), 0) 142 - #define setup_pinned_timer_on_stack(timer, fn, data) \ 143 - __setup_timer_on_stack((timer), (fn), (data), TIMER_PINNED) 144 - #define setup_deferrable_timer_on_stack(timer, fn, data) \ 145 - __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE) 146 - #define setup_pinned_deferrable_timer_on_stack(timer, fn, data) \ 147 - __setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE | TIMER_PINNED) 148 - 149 - #ifndef CONFIG_LOCKDEP 150 - static inline void timer_setup(struct timer_list *timer, 151 - void (*callback)(struct timer_list *), 152 - unsigned int flags) 153 - { 154 - __setup_timer(timer, (TIMER_FUNC_TYPE)callback, 155 - (TIMER_DATA_TYPE)timer, flags); 156 - } 157 - 158 - static inline void timer_setup_on_stack(struct timer_list *timer, 159 - void (*callback)(struct timer_list *), 160 - unsigned int flags) 161 - { 162 - __setup_timer_on_stack(timer, (TIMER_FUNC_TYPE)callback, 163 - (TIMER_DATA_TYPE)timer, flags); 164 - } 165 - #else 166 - /* 167 - * Under LOCKDEP, the timer lock_class_key (set up in __init_timer) needs 168 - * to be tied to the caller's context, so an inline (above) won't work. We 169 - * do want to keep the inline for argument type checking, though. 126 + /** 127 + * timer_setup - prepare a timer for first use 128 + * @timer: the timer in question 129 + * @callback: the function to call when timer expires 130 + * @flags: any TIMER_* flags 131 + * 132 + * Regular timer initialization should use either DEFINE_TIMER() above, 133 + * or timer_setup(). For timers on the stack, timer_setup_on_stack() must 134 + * be used and must be balanced with a call to destroy_timer_on_stack(). 170 135 */ 171 - # define timer_setup(timer, callback, flags) \ 172 - __setup_timer((timer), (TIMER_FUNC_TYPE)(callback), \ 173 - (TIMER_DATA_TYPE)(timer), (flags)) 174 - # define timer_setup_on_stack(timer, callback, flags) \ 175 - __setup_timer_on_stack((timer), \ 176 - (TIMER_FUNC_TYPE)(callback), \ 177 - (TIMER_DATA_TYPE)(timer), (flags)) 136 + #define timer_setup(timer, callback, flags) \ 137 + __init_timer((timer), (callback), (flags)) 138 + 139 + #define timer_setup_on_stack(timer, callback, flags) \ 140 + __init_timer_on_stack((timer), (callback), (flags)) 141 + 142 + #ifdef CONFIG_DEBUG_OBJECTS_TIMERS 143 + extern void destroy_timer_on_stack(struct timer_list *timer); 144 + #else 145 + static inline void destroy_timer_on_stack(struct timer_list *timer) { } 178 146 #endif 179 147 180 148 #define from_timer(var, callback_timer, timer_fieldname) \
+7 -10
include/linux/workqueue.h
··· 176 176 177 177 #define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \ 178 178 .work = __WORK_INITIALIZER((n).work, (f)), \ 179 - .timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)delayed_work_timer_fn,\ 180 - (TIMER_DATA_TYPE)&(n.timer), \ 179 + .timer = __TIMER_INITIALIZER(delayed_work_timer_fn,\ 181 180 (tflags) | TIMER_IRQSAFE), \ 182 181 } 183 182 ··· 241 242 #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ 242 243 do { \ 243 244 INIT_WORK(&(_work)->work, (_func)); \ 244 - __setup_timer(&(_work)->timer, \ 245 - (TIMER_FUNC_TYPE)delayed_work_timer_fn, \ 246 - (TIMER_DATA_TYPE)&(_work)->timer, \ 247 - (_tflags) | TIMER_IRQSAFE); \ 245 + __init_timer(&(_work)->timer, \ 246 + delayed_work_timer_fn, \ 247 + (_tflags) | TIMER_IRQSAFE); \ 248 248 } while (0) 249 249 250 250 #define __INIT_DELAYED_WORK_ONSTACK(_work, _func, _tflags) \ 251 251 do { \ 252 252 INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ 253 - __setup_timer_on_stack(&(_work)->timer, \ 254 - (TIMER_FUNC_TYPE)delayed_work_timer_fn,\ 255 - (TIMER_DATA_TYPE)&(_work)->timer,\ 256 - (_tflags) | TIMER_IRQSAFE); \ 253 + __init_timer_on_stack(&(_work)->timer, \ 254 + delayed_work_timer_fn, \ 255 + (_tflags) | TIMER_IRQSAFE); \ 257 256 } while (0) 258 257 259 258 #define INIT_DELAYED_WORK(_work, _func) \
+1 -1
include/linux/writeback.h
··· 308 308 void laptop_io_completion(struct backing_dev_info *info); 309 309 void laptop_sync_completion(void); 310 310 void laptop_mode_sync(struct work_struct *work); 311 - void laptop_mode_timer_fn(unsigned long data); 311 + void laptop_mode_timer_fn(struct timer_list *t); 312 312 #else 313 313 static inline void laptop_sync_completion(void) { } 314 314 #endif
+2 -2
kernel/irq/spurious.c
··· 20 20 static int irqfixup __read_mostly; 21 21 22 22 #define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10) 23 - static void poll_spurious_irqs(unsigned long dummy); 23 + static void poll_spurious_irqs(struct timer_list *unused); 24 24 static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs); 25 25 static int irq_poll_cpu; 26 26 static atomic_t irq_poll_active; ··· 143 143 return ok; 144 144 } 145 145 146 - static void poll_spurious_irqs(unsigned long dummy) 146 + static void poll_spurious_irqs(struct timer_list *unused) 147 147 { 148 148 struct irq_desc *desc; 149 149 int i;
+1 -1
kernel/kthread.c
··· 843 843 struct timer_list *timer = &dwork->timer; 844 844 struct kthread_work *work = &dwork->work; 845 845 846 - WARN_ON_ONCE(timer->function != (TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn); 846 + WARN_ON_ONCE(timer->function != kthread_delayed_work_timer_fn); 847 847 848 848 /* 849 849 * If @delay is 0, queue @dwork->work immediately. This is for
+3 -3
kernel/padata.c
··· 288 288 local_bh_enable(); 289 289 } 290 290 291 - static void padata_reorder_timer(unsigned long arg) 291 + static void padata_reorder_timer(struct timer_list *t) 292 292 { 293 - struct parallel_data *pd = (struct parallel_data *)arg; 293 + struct parallel_data *pd = from_timer(pd, t, timer); 294 294 unsigned int weight; 295 295 int target_cpu, cpu; 296 296 ··· 485 485 486 486 padata_init_pqueues(pd); 487 487 padata_init_squeues(pd); 488 - setup_timer(&pd->timer, padata_reorder_timer, (unsigned long)pd); 488 + timer_setup(&pd->timer, padata_reorder_timer, 0); 489 489 atomic_set(&pd->seq_nr, -1); 490 490 atomic_set(&pd->reorder_objects, 0); 491 491 atomic_set(&pd->refcnt, 0);
-4
kernel/time/Kconfig
··· 21 21 config GENERIC_TIME_VSYSCALL 22 22 bool 23 23 24 - # Timekeeping vsyscall support 25 - config GENERIC_TIME_VSYSCALL_OLD 26 - bool 27 - 28 24 # Old style timekeeping 29 25 config ARCH_USES_GETTIMEOFFSET 30 26 bool
+2 -3
kernel/time/clocksource.c
··· 171 171 spin_unlock_irqrestore(&watchdog_lock, flags); 172 172 } 173 173 174 - static void clocksource_watchdog(unsigned long data) 174 + static void clocksource_watchdog(struct timer_list *unused) 175 175 { 176 176 struct clocksource *cs; 177 177 u64 csnow, wdnow, cslast, wdlast, delta; ··· 290 290 { 291 291 if (watchdog_running || !watchdog || list_empty(&watchdog_list)) 292 292 return; 293 - init_timer(&watchdog_timer); 294 - watchdog_timer.function = clocksource_watchdog; 293 + timer_setup(&watchdog_timer, clocksource_watchdog, 0); 295 294 watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL; 296 295 add_timer_on(&watchdog_timer, cpumask_first(cpu_online_mask)); 297 296 watchdog_running = 1;
-45
kernel/time/timekeeping.c
··· 557 557 update_fast_timekeeper(&tkr_dummy, &tk_fast_raw); 558 558 } 559 559 560 - #ifdef CONFIG_GENERIC_TIME_VSYSCALL_OLD 561 - #warning Please contact your maintainers, as GENERIC_TIME_VSYSCALL_OLD compatibity will disappear soon. 562 - 563 - static inline void update_vsyscall(struct timekeeper *tk) 564 - { 565 - struct timespec xt, wm; 566 - 567 - xt = timespec64_to_timespec(tk_xtime(tk)); 568 - wm = timespec64_to_timespec(tk->wall_to_monotonic); 569 - update_vsyscall_old(&xt, &wm, tk->tkr_mono.clock, tk->tkr_mono.mult, 570 - tk->tkr_mono.cycle_last); 571 - } 572 - 573 - static inline void old_vsyscall_fixup(struct timekeeper *tk) 574 - { 575 - s64 remainder; 576 - 577 - /* 578 - * Store only full nanoseconds into xtime_nsec after rounding 579 - * it up and add the remainder to the error difference. 580 - * XXX - This is necessary to avoid small 1ns inconsistnecies caused 581 - * by truncating the remainder in vsyscalls. However, it causes 582 - * additional work to be done in timekeeping_adjust(). Once 583 - * the vsyscall implementations are converted to use xtime_nsec 584 - * (shifted nanoseconds), and CONFIG_GENERIC_TIME_VSYSCALL_OLD 585 - * users are removed, this can be killed. 586 - */ 587 - remainder = tk->tkr_mono.xtime_nsec & ((1ULL << tk->tkr_mono.shift) - 1); 588 - if (remainder != 0) { 589 - tk->tkr_mono.xtime_nsec -= remainder; 590 - tk->tkr_mono.xtime_nsec += 1ULL << tk->tkr_mono.shift; 591 - tk->ntp_error += remainder << tk->ntp_error_shift; 592 - tk->ntp_error -= (1ULL << tk->tkr_mono.shift) << tk->ntp_error_shift; 593 - } 594 - } 595 - #else 596 - #define old_vsyscall_fixup(tk) 597 - #endif 598 - 599 560 static RAW_NOTIFIER_HEAD(pvclock_gtod_chain); 600 561 601 562 static void update_pvclock_gtod(struct timekeeper *tk, bool was_set) ··· 2123 2162 2124 2163 /* correct the clock when NTP error is too big */ 2125 2164 timekeeping_adjust(tk, offset); 2126 - 2127 - /* 2128 - * XXX This can be killed once everyone converts 2129 - * to the new update_vsyscall. 2130 - */ 2131 - old_vsyscall_fixup(tk); 2132 2165 2133 2166 /* 2134 2167 * Finally, make sure that after the rounding
+23 -17
kernel/time/timer.c
··· 707 707 debug_object_assert_init(timer, &timer_debug_descr); 708 708 } 709 709 710 - static void do_init_timer(struct timer_list *timer, unsigned int flags, 710 + static void do_init_timer(struct timer_list *timer, 711 + void (*func)(struct timer_list *), 712 + unsigned int flags, 711 713 const char *name, struct lock_class_key *key); 712 714 713 - void init_timer_on_stack_key(struct timer_list *timer, unsigned int flags, 715 + void init_timer_on_stack_key(struct timer_list *timer, 716 + void (*func)(struct timer_list *), 717 + unsigned int flags, 714 718 const char *name, struct lock_class_key *key) 715 719 { 716 720 debug_object_init_on_stack(timer, &timer_debug_descr); 717 - do_init_timer(timer, flags, name, key); 721 + do_init_timer(timer, func, flags, name, key); 718 722 } 719 723 EXPORT_SYMBOL_GPL(init_timer_on_stack_key); 720 724 ··· 759 755 debug_timer_assert_init(timer); 760 756 } 761 757 762 - static void do_init_timer(struct timer_list *timer, unsigned int flags, 758 + static void do_init_timer(struct timer_list *timer, 759 + void (*func)(struct timer_list *), 760 + unsigned int flags, 763 761 const char *name, struct lock_class_key *key) 764 762 { 765 763 timer->entry.pprev = NULL; 764 + timer->function = func; 766 765 timer->flags = flags | raw_smp_processor_id(); 767 766 lockdep_init_map(&timer->lockdep_map, name, key, 0); 768 767 } ··· 773 766 /** 774 767 * init_timer_key - initialize a timer 775 768 * @timer: the timer to be initialized 769 + * @func: timer callback function 776 770 * @flags: timer flags 777 771 * @name: name of the timer 778 772 * @key: lockdep class key of the fake lock used for tracking timer ··· 782 774 * init_timer_key() must be done to a timer prior calling *any* of the 783 775 * other timer functions. 784 776 */ 785 - void init_timer_key(struct timer_list *timer, unsigned int flags, 777 + void init_timer_key(struct timer_list *timer, 778 + void (*func)(struct timer_list *), unsigned int flags, 786 779 const char *name, struct lock_class_key *key) 787 780 { 788 781 debug_init(timer); 789 - do_init_timer(timer, flags, name, key); 782 + do_init_timer(timer, func, flags, name, key); 790 783 } 791 784 EXPORT_SYMBOL(init_timer_key); 792 785 ··· 1116 1107 * add_timer - start a timer 1117 1108 * @timer: the timer to be added 1118 1109 * 1119 - * The kernel will do a ->function(->data) callback from the 1110 + * The kernel will do a ->function(@timer) callback from the 1120 1111 * timer interrupt at the ->expires point in the future. The 1121 1112 * current time is 'jiffies'. 1122 1113 * 1123 - * The timer's ->expires, ->function (and if the handler uses it, ->data) 1124 - * fields must be set prior calling this function. 1114 + * The timer's ->expires, ->function fields must be set prior calling this 1115 + * function. 1125 1116 * 1126 1117 * Timers with an ->expires field in the past will be executed in the next 1127 1118 * timer tick. ··· 1293 1284 EXPORT_SYMBOL(del_timer_sync); 1294 1285 #endif 1295 1286 1296 - static void call_timer_fn(struct timer_list *timer, void (*fn)(unsigned long), 1297 - unsigned long data) 1287 + static void call_timer_fn(struct timer_list *timer, void (*fn)(struct timer_list *)) 1298 1288 { 1299 1289 int count = preempt_count(); 1300 1290 ··· 1317 1309 lock_map_acquire(&lockdep_map); 1318 1310 1319 1311 trace_timer_expire_entry(timer); 1320 - fn(data); 1312 + fn(timer); 1321 1313 trace_timer_expire_exit(timer); 1322 1314 1323 1315 lock_map_release(&lockdep_map); ··· 1339 1331 { 1340 1332 while (!hlist_empty(head)) { 1341 1333 struct timer_list *timer; 1342 - void (*fn)(unsigned long); 1343 - unsigned long data; 1334 + void (*fn)(struct timer_list *); 1344 1335 1345 1336 timer = hlist_entry(head->first, struct timer_list, entry); 1346 1337 ··· 1347 1340 detach_timer(timer, true); 1348 1341 1349 1342 fn = timer->function; 1350 - data = timer->data; 1351 1343 1352 1344 if (timer->flags & TIMER_IRQSAFE) { 1353 1345 raw_spin_unlock(&base->lock); 1354 - call_timer_fn(timer, fn, data); 1346 + call_timer_fn(timer, fn); 1355 1347 raw_spin_lock(&base->lock); 1356 1348 } else { 1357 1349 raw_spin_unlock_irq(&base->lock); 1358 - call_timer_fn(timer, fn, data); 1350 + call_timer_fn(timer, fn); 1359 1351 raw_spin_lock_irq(&base->lock); 1360 1352 } 1361 1353 }
+1 -1
kernel/time/timer_list.c
··· 389 389 { 390 390 struct proc_dir_entry *pe; 391 391 392 - pe = proc_create("timer_list", 0444, NULL, &timer_list_fops); 392 + pe = proc_create("timer_list", 0400, NULL, &timer_list_fops); 393 393 if (!pe) 394 394 return -ENOMEM; 395 395 return 0;
+1 -1
kernel/workqueue.c
··· 1509 1509 struct work_struct *work = &dwork->work; 1510 1510 1511 1511 WARN_ON_ONCE(!wq); 1512 - WARN_ON_ONCE(timer->function != (TIMER_FUNC_TYPE)delayed_work_timer_fn); 1512 + WARN_ON_ONCE(timer->function != delayed_work_timer_fn); 1513 1513 WARN_ON_ONCE(timer_pending(timer)); 1514 1514 WARN_ON_ONCE(!list_empty(&work->entry)); 1515 1515
+2 -2
lib/random32.c
··· 213 213 } 214 214 core_initcall(prandom_init); 215 215 216 - static void __prandom_timer(unsigned long dontcare); 216 + static void __prandom_timer(struct timer_list *unused); 217 217 218 218 static DEFINE_TIMER(seed_timer, __prandom_timer); 219 219 220 - static void __prandom_timer(unsigned long dontcare) 220 + static void __prandom_timer(struct timer_list *unused) 221 221 { 222 222 u32 entropy; 223 223 unsigned long expires;
+4 -3
mm/page-writeback.c
··· 1993 1993 } 1994 1994 1995 1995 #ifdef CONFIG_BLOCK 1996 - void laptop_mode_timer_fn(unsigned long data) 1996 + void laptop_mode_timer_fn(struct timer_list *t) 1997 1997 { 1998 - struct request_queue *q = (struct request_queue *)data; 1998 + struct backing_dev_info *backing_dev_info = 1999 + from_timer(backing_dev_info, t, laptop_mode_wb_timer); 1999 2000 2000 - wakeup_flusher_threads_bdi(q->backing_dev_info, WB_REASON_LAPTOP_TIMER); 2001 + wakeup_flusher_threads_bdi(backing_dev_info, WB_REASON_LAPTOP_TIMER); 2001 2002 } 2002 2003 2003 2004 /*
+3 -3
net/802/garp.c
··· 401 401 mod_timer(&app->join_timer, jiffies + delay); 402 402 } 403 403 404 - static void garp_join_timer(unsigned long data) 404 + static void garp_join_timer(struct timer_list *t) 405 405 { 406 - struct garp_applicant *app = (struct garp_applicant *)data; 406 + struct garp_applicant *app = from_timer(app, t, join_timer); 407 407 408 408 spin_lock(&app->lock); 409 409 garp_gid_event(app, GARP_EVENT_TRANSMIT_PDU); ··· 584 584 spin_lock_init(&app->lock); 585 585 skb_queue_head_init(&app->queue); 586 586 rcu_assign_pointer(dev->garp_port->applicants[appl->type], app); 587 - setup_timer(&app->join_timer, garp_join_timer, (unsigned long)app); 587 + timer_setup(&app->join_timer, garp_join_timer, 0); 588 588 garp_join_timer_arm(app); 589 589 return 0; 590 590
+6 -7
net/802/mrp.c
··· 586 586 mod_timer(&app->join_timer, jiffies + delay); 587 587 } 588 588 589 - static void mrp_join_timer(unsigned long data) 589 + static void mrp_join_timer(struct timer_list *t) 590 590 { 591 - struct mrp_applicant *app = (struct mrp_applicant *)data; 591 + struct mrp_applicant *app = from_timer(app, t, join_timer); 592 592 593 593 spin_lock(&app->lock); 594 594 mrp_mad_event(app, MRP_EVENT_TX); ··· 605 605 jiffies + msecs_to_jiffies(mrp_periodic_time)); 606 606 } 607 607 608 - static void mrp_periodic_timer(unsigned long data) 608 + static void mrp_periodic_timer(struct timer_list *t) 609 609 { 610 - struct mrp_applicant *app = (struct mrp_applicant *)data; 610 + struct mrp_applicant *app = from_timer(app, t, periodic_timer); 611 611 612 612 spin_lock(&app->lock); 613 613 mrp_mad_event(app, MRP_EVENT_PERIODIC); ··· 865 865 spin_lock_init(&app->lock); 866 866 skb_queue_head_init(&app->queue); 867 867 rcu_assign_pointer(dev->mrp_port->applicants[appl->type], app); 868 - setup_timer(&app->join_timer, mrp_join_timer, (unsigned long)app); 868 + timer_setup(&app->join_timer, mrp_join_timer, 0); 869 869 mrp_join_timer_arm(app); 870 - setup_timer(&app->periodic_timer, mrp_periodic_timer, 871 - (unsigned long)app); 870 + timer_setup(&app->periodic_timer, mrp_periodic_timer, 0); 872 871 mrp_periodic_timer_arm(app); 873 872 return 0; 874 873
+2 -2
net/appletalk/aarp.c
··· 310 310 } 311 311 312 312 /* Handle the timer event */ 313 - static void aarp_expire_timeout(unsigned long unused) 313 + static void aarp_expire_timeout(struct timer_list *unused) 314 314 { 315 315 int ct; 316 316 ··· 884 884 aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv); 885 885 if (!aarp_dl) 886 886 printk(KERN_CRIT "Unable to register AARP with SNAP.\n"); 887 - setup_timer(&aarp_timer, aarp_expire_timeout, 0); 887 + timer_setup(&aarp_timer, aarp_expire_timeout, 0); 888 888 aarp_timer.expires = jiffies + sysctl_aarp_expiry_time; 889 889 add_timer(&aarp_timer); 890 890 register_netdevice_notifier(&aarp_notifier);
+3 -4
net/appletalk/ddp.c
··· 158 158 return s; 159 159 } 160 160 161 - static void atalk_destroy_timer(unsigned long data) 161 + static void atalk_destroy_timer(struct timer_list *t) 162 162 { 163 - struct sock *sk = (struct sock *)data; 163 + struct sock *sk = from_timer(sk, t, sk_timer); 164 164 165 165 if (sk_has_allocations(sk)) { 166 166 sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; ··· 175 175 skb_queue_purge(&sk->sk_receive_queue); 176 176 177 177 if (sk_has_allocations(sk)) { 178 - setup_timer(&sk->sk_timer, atalk_destroy_timer, 179 - (unsigned long)sk); 178 + timer_setup(&sk->sk_timer, atalk_destroy_timer, 0); 180 179 sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME; 181 180 add_timer(&sk->sk_timer); 182 181 } else
+3 -3
net/atm/lec.c
··· 1798 1798 else 1799 1799 send_to_lecd(priv, l_arp_xmt, mac_to_find, NULL, NULL); 1800 1800 entry->timer.expires = jiffies + (1 * HZ); 1801 - entry->timer.function = (TIMER_FUNC_TYPE)lec_arp_expire_arp; 1801 + entry->timer.function = lec_arp_expire_arp; 1802 1802 add_timer(&entry->timer); 1803 1803 found = priv->mcast_vcc; 1804 1804 } ··· 1998 1998 entry->old_recv_push = old_push; 1999 1999 entry->status = ESI_UNKNOWN; 2000 2000 entry->timer.expires = jiffies + priv->vcc_timeout_period; 2001 - entry->timer.function = (TIMER_FUNC_TYPE)lec_arp_expire_vcc; 2001 + entry->timer.function = lec_arp_expire_vcc; 2002 2002 hlist_add_head(&entry->next, &priv->lec_no_forward); 2003 2003 add_timer(&entry->timer); 2004 2004 dump_arp_table(priv); ··· 2082 2082 entry->status = ESI_UNKNOWN; 2083 2083 hlist_add_head(&entry->next, &priv->lec_arp_empty_ones); 2084 2084 entry->timer.expires = jiffies + priv->vcc_timeout_period; 2085 - entry->timer.function = (TIMER_FUNC_TYPE)lec_arp_expire_vcc; 2085 + entry->timer.function = lec_arp_expire_vcc; 2086 2086 add_timer(&entry->timer); 2087 2087 pr_debug("After vcc was added\n"); 2088 2088 dump_arp_table(priv);
+1 -2
net/atm/mpc.c
··· 121 121 122 122 struct mpoa_client *mpcs = NULL; /* FIXME */ 123 123 static struct atm_mpoa_qos *qos_head = NULL; 124 - static DEFINE_TIMER(mpc_timer, NULL); 124 + static DEFINE_TIMER(mpc_timer, mpc_cache_check); 125 125 126 126 127 127 static struct mpoa_client *find_mpc_by_itfnum(int itf) ··· 1413 1413 { 1414 1414 mpc_timer.expires = jiffies + (MPC_P2 * HZ); 1415 1415 checking_time = mpc_timer.expires; 1416 - mpc_timer.function = (TIMER_FUNC_TYPE)mpc_cache_check; 1417 1416 add_timer(&mpc_timer); 1418 1417 } 1419 1418
+6 -8
net/batman-adv/tp_meter.c
··· 488 488 * Switch to Slow Start, set the ss_threshold to half of the current cwnd and 489 489 * reset the cwnd to 3*MSS 490 490 */ 491 - static void batadv_tp_sender_timeout(unsigned long arg) 491 + static void batadv_tp_sender_timeout(struct timer_list *t) 492 492 { 493 - struct batadv_tp_vars *tp_vars = (struct batadv_tp_vars *)arg; 493 + struct batadv_tp_vars *tp_vars = from_timer(tp_vars, t, timer); 494 494 struct batadv_priv *bat_priv = tp_vars->bat_priv; 495 495 496 496 if (atomic_read(&tp_vars->sending) == 0) ··· 1020 1020 atomic64_set(&tp_vars->tot_sent, 0); 1021 1021 1022 1022 kref_get(&tp_vars->refcount); 1023 - setup_timer(&tp_vars->timer, batadv_tp_sender_timeout, 1024 - (unsigned long)tp_vars); 1023 + timer_setup(&tp_vars->timer, batadv_tp_sender_timeout, 0); 1025 1024 1026 1025 tp_vars->bat_priv = bat_priv; 1027 1026 tp_vars->start_time = jiffies; ··· 1108 1109 * reached without received ack 1109 1110 * @arg: address of the related tp_vars 1110 1111 */ 1111 - static void batadv_tp_receiver_shutdown(unsigned long arg) 1112 + static void batadv_tp_receiver_shutdown(struct timer_list *t) 1112 1113 { 1113 - struct batadv_tp_vars *tp_vars = (struct batadv_tp_vars *)arg; 1114 + struct batadv_tp_vars *tp_vars = from_timer(tp_vars, t, timer); 1114 1115 struct batadv_tp_unacked *un, *safe; 1115 1116 struct batadv_priv *bat_priv; 1116 1117 ··· 1372 1373 hlist_add_head_rcu(&tp_vars->list, &bat_priv->tp_list); 1373 1374 1374 1375 kref_get(&tp_vars->refcount); 1375 - setup_timer(&tp_vars->timer, batadv_tp_receiver_shutdown, 1376 - (unsigned long)tp_vars); 1376 + timer_setup(&tp_vars->timer, batadv_tp_receiver_shutdown, 0); 1377 1377 1378 1378 batadv_tp_reset_receiver_timer(tp_vars); 1379 1379
+3 -4
net/bluetooth/hidp/core.c
··· 398 398 } 399 399 } 400 400 401 - static void hidp_idle_timeout(unsigned long arg) 401 + static void hidp_idle_timeout(struct timer_list *t) 402 402 { 403 - struct hidp_session *session = (struct hidp_session *) arg; 403 + struct hidp_session *session = from_timer(session, t, timer); 404 404 405 405 /* The HIDP user-space API only contains calls to add and remove 406 406 * devices. There is no way to forward events of any kind. Therefore, ··· 944 944 945 945 /* device management */ 946 946 INIT_WORK(&session->dev_init, hidp_session_dev_work); 947 - setup_timer(&session->timer, hidp_idle_timeout, 948 - (unsigned long)session); 947 + timer_setup(&session->timer, hidp_idle_timeout, 0); 949 948 950 949 /* session data */ 951 950 mutex_init(&session->report_mutex);
+6 -6
net/bluetooth/rfcomm/core.c
··· 233 233 d->out); 234 234 } 235 235 236 - static void rfcomm_session_timeout(unsigned long arg) 236 + static void rfcomm_session_timeout(struct timer_list *t) 237 237 { 238 - struct rfcomm_session *s = (void *) arg; 238 + struct rfcomm_session *s = from_timer(s, t, timer); 239 239 240 240 BT_DBG("session %p state %ld", s, s->state); 241 241 ··· 258 258 } 259 259 260 260 /* ---- RFCOMM DLCs ---- */ 261 - static void rfcomm_dlc_timeout(unsigned long arg) 261 + static void rfcomm_dlc_timeout(struct timer_list *t) 262 262 { 263 - struct rfcomm_dlc *d = (void *) arg; 263 + struct rfcomm_dlc *d = from_timer(d, t, timer); 264 264 265 265 BT_DBG("dlc %p state %ld", d, d->state); 266 266 ··· 307 307 if (!d) 308 308 return NULL; 309 309 310 - setup_timer(&d->timer, rfcomm_dlc_timeout, (unsigned long)d); 310 + timer_setup(&d->timer, rfcomm_dlc_timeout, 0); 311 311 312 312 skb_queue_head_init(&d->tx_queue); 313 313 mutex_init(&d->lock); ··· 650 650 651 651 BT_DBG("session %p sock %p", s, sock); 652 652 653 - setup_timer(&s->timer, rfcomm_session_timeout, (unsigned long) s); 653 + timer_setup(&s->timer, rfcomm_session_timeout, 0); 654 654 655 655 INIT_LIST_HEAD(&s->dlcs); 656 656 s->state = state;
+3 -3
net/bluetooth/sco.c
··· 73 73 #define SCO_CONN_TIMEOUT (HZ * 40) 74 74 #define SCO_DISCONN_TIMEOUT (HZ * 2) 75 75 76 - static void sco_sock_timeout(unsigned long arg) 76 + static void sco_sock_timeout(struct timer_list *t) 77 77 { 78 - struct sock *sk = (struct sock *)arg; 78 + struct sock *sk = from_timer(sk, t, sk_timer); 79 79 80 80 BT_DBG("sock %p state %d", sk, sk->sk_state); 81 81 ··· 487 487 488 488 sco_pi(sk)->setting = BT_VOICE_CVSD_16BIT; 489 489 490 - setup_timer(&sk->sk_timer, sco_sock_timeout, (unsigned long)sk); 490 + timer_setup(&sk->sk_timer, sco_sock_timeout, 0); 491 491 492 492 bt_sock_link(&sco_sk_list, sk); 493 493 return sk;
+2 -2
net/can/proc.c
··· 221 221 222 222 seq_putc(m, '\n'); 223 223 224 - if (net->can.can_stattimer.function == (TIMER_FUNC_TYPE)can_stat_update) { 224 + if (net->can.can_stattimer.function == can_stat_update) { 225 225 seq_printf(m, " %8ld %% total match ratio (RXMR)\n", 226 226 can_stats->total_rx_match_ratio); 227 227 ··· 291 291 292 292 user_reset = 1; 293 293 294 - if (net->can.can_stattimer.function == (TIMER_FUNC_TYPE)can_stat_update) { 294 + if (net->can.can_stattimer.function == can_stat_update) { 295 295 seq_printf(m, "Scheduled statistic reset #%ld.\n", 296 296 can_pstats->stats_reset + 1); 297 297 } else {
+3 -4
net/core/drop_monitor.c
··· 144 144 * in the event that more drops will arrive during the 145 145 * hysteresis period. 146 146 */ 147 - static void sched_send_work(unsigned long _data) 147 + static void sched_send_work(struct timer_list *t) 148 148 { 149 - struct per_cpu_dm_data *data = (struct per_cpu_dm_data *)_data; 149 + struct per_cpu_dm_data *data = from_timer(data, t, send_timer); 150 150 151 151 schedule_work(&data->dm_alert_work); 152 152 } ··· 412 412 for_each_possible_cpu(cpu) { 413 413 data = &per_cpu(dm_cpu_data, cpu); 414 414 INIT_WORK(&data->dm_alert_work, send_dm_alert); 415 - setup_timer(&data->send_timer, sched_send_work, 416 - (unsigned long)data); 415 + timer_setup(&data->send_timer, sched_send_work, 0); 417 416 spin_lock_init(&data->lock); 418 417 reset_per_cpu_data(data); 419 418 }
+3 -3
net/core/gen_estimator.c
··· 76 76 77 77 } 78 78 79 - static void est_timer(unsigned long arg) 79 + static void est_timer(struct timer_list *t) 80 80 { 81 - struct net_rate_estimator *est = (struct net_rate_estimator *)arg; 81 + struct net_rate_estimator *est = from_timer(est, t, timer); 82 82 struct gnet_stats_basic_packed b; 83 83 u64 rate, brate; 84 84 ··· 170 170 } 171 171 172 172 est->next_jiffies = jiffies + ((HZ/4) << intvl_log); 173 - setup_timer(&est->timer, est_timer, (unsigned long)est); 173 + timer_setup(&est->timer, est_timer, 0); 174 174 mod_timer(&est->timer, est->next_jiffies); 175 175 176 176 rcu_assign_pointer(*rate_est, est);
+7 -7
net/core/neighbour.c
··· 51 51 52 52 #define PNEIGH_HASHMASK 0xF 53 53 54 - static void neigh_timer_handler(unsigned long arg); 54 + static void neigh_timer_handler(struct timer_list *t); 55 55 static void __neigh_notify(struct neighbour *n, int type, int flags, 56 56 u32 pid); 57 57 static void neigh_update_notify(struct neighbour *neigh, u32 nlmsg_pid); ··· 331 331 n->output = neigh_blackhole; 332 332 seqlock_init(&n->hh.hh_lock); 333 333 n->parms = neigh_parms_clone(&tbl->parms); 334 - setup_timer(&n->timer, neigh_timer_handler, (unsigned long)n); 334 + timer_setup(&n->timer, neigh_timer_handler, 0); 335 335 336 336 NEIGH_CACHE_STAT_INC(tbl, allocs); 337 337 n->tbl = tbl; ··· 903 903 904 904 /* Called when a timer expires for a neighbour entry. */ 905 905 906 - static void neigh_timer_handler(unsigned long arg) 906 + static void neigh_timer_handler(struct timer_list *t) 907 907 { 908 908 unsigned long now, next; 909 - struct neighbour *neigh = (struct neighbour *)arg; 909 + struct neighbour *neigh = from_timer(neigh, t, timer); 910 910 unsigned int state; 911 911 int notify = 0; 912 912 ··· 1391 1391 } 1392 1392 EXPORT_SYMBOL(neigh_direct_output); 1393 1393 1394 - static void neigh_proxy_process(unsigned long arg) 1394 + static void neigh_proxy_process(struct timer_list *t) 1395 1395 { 1396 - struct neigh_table *tbl = (struct neigh_table *)arg; 1396 + struct neigh_table *tbl = from_timer(tbl, t, proxy_timer); 1397 1397 long sched_next = 0; 1398 1398 unsigned long now = jiffies; 1399 1399 struct sk_buff *skb, *n; ··· 1573 1573 INIT_DEFERRABLE_WORK(&tbl->gc_work, neigh_periodic_work); 1574 1574 queue_delayed_work(system_power_efficient_wq, &tbl->gc_work, 1575 1575 tbl->parms.reachable_time); 1576 - setup_timer(&tbl->proxy_timer, neigh_proxy_process, (unsigned long)tbl); 1576 + timer_setup(&tbl->proxy_timer, neigh_proxy_process, 0); 1577 1577 skb_queue_head_init_class(&tbl->proxy_queue, 1578 1578 &neigh_table_proxy_queue_class); 1579 1579
+4 -4
net/decnet/dn_route.c
··· 125 125 struct sk_buff *skb, 126 126 const void *daddr); 127 127 static int dn_route_input(struct sk_buff *); 128 - static void dn_run_flush(unsigned long dummy); 128 + static void dn_run_flush(struct timer_list *unused); 129 129 130 130 static struct dn_rt_hash_bucket *dn_rt_hash_table; 131 131 static unsigned int dn_rt_hash_mask; ··· 183 183 return dn_rt_hash_mask & (unsigned int)tmp; 184 184 } 185 185 186 - static void dn_dst_check_expire(unsigned long dummy) 186 + static void dn_dst_check_expire(struct timer_list *unused) 187 187 { 188 188 int i; 189 189 struct dn_route *rt; ··· 357 357 return 0; 358 358 } 359 359 360 - static void dn_run_flush(unsigned long dummy) 360 + static void dn_run_flush(struct timer_list *unused) 361 361 { 362 362 int i; 363 363 struct dn_route *rt, *next; ··· 1875 1875 kmem_cache_create("dn_dst_cache", sizeof(struct dn_route), 0, 1876 1876 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); 1877 1877 dst_entries_init(&dn_dst_ops); 1878 - setup_timer(&dn_route_timer, dn_dst_check_expire, 0); 1878 + timer_setup(&dn_route_timer, dn_dst_check_expire, 0); 1879 1879 dn_route_timer.expires = jiffies + decnet_dst_gc_interval * HZ; 1880 1880 add_timer(&dn_route_timer); 1881 1881
+4 -4
net/decnet/dn_timer.c
··· 34 34 35 35 #define SLOW_INTERVAL (HZ/2) 36 36 37 - static void dn_slow_timer(unsigned long arg); 37 + static void dn_slow_timer(struct timer_list *t); 38 38 39 39 void dn_start_slow_timer(struct sock *sk) 40 40 { 41 - setup_timer(&sk->sk_timer, dn_slow_timer, (unsigned long)sk); 41 + timer_setup(&sk->sk_timer, dn_slow_timer, 0); 42 42 sk_reset_timer(sk, &sk->sk_timer, jiffies + SLOW_INTERVAL); 43 43 } 44 44 ··· 47 47 sk_stop_timer(sk, &sk->sk_timer); 48 48 } 49 49 50 - static void dn_slow_timer(unsigned long arg) 50 + static void dn_slow_timer(struct timer_list *t) 51 51 { 52 - struct sock *sk = (struct sock *)arg; 52 + struct sock *sk = from_timer(sk, t, sk_timer); 53 53 struct dn_scp *scp = DN_SK(sk); 54 54 55 55 bh_lock_sock(sk);
+9 -11
net/ipv4/igmp.c
··· 752 752 return ip_local_out(net, skb->sk, skb); 753 753 } 754 754 755 - static void igmp_gq_timer_expire(unsigned long data) 755 + static void igmp_gq_timer_expire(struct timer_list *t) 756 756 { 757 - struct in_device *in_dev = (struct in_device *)data; 757 + struct in_device *in_dev = from_timer(in_dev, t, mr_gq_timer); 758 758 759 759 in_dev->mr_gq_running = 0; 760 760 igmpv3_send_report(in_dev, NULL); 761 761 in_dev_put(in_dev); 762 762 } 763 763 764 - static void igmp_ifc_timer_expire(unsigned long data) 764 + static void igmp_ifc_timer_expire(struct timer_list *t) 765 765 { 766 - struct in_device *in_dev = (struct in_device *)data; 766 + struct in_device *in_dev = from_timer(in_dev, t, mr_ifc_timer); 767 767 768 768 igmpv3_send_cr(in_dev); 769 769 if (in_dev->mr_ifc_count) { ··· 784 784 } 785 785 786 786 787 - static void igmp_timer_expire(unsigned long data) 787 + static void igmp_timer_expire(struct timer_list *t) 788 788 { 789 - struct ip_mc_list *im = (struct ip_mc_list *)data; 789 + struct ip_mc_list *im = from_timer(im, t, timer); 790 790 struct in_device *in_dev = im->interface; 791 791 792 792 spin_lock(&im->lock); ··· 1385 1385 refcount_set(&im->refcnt, 1); 1386 1386 spin_lock_init(&im->lock); 1387 1387 #ifdef CONFIG_IP_MULTICAST 1388 - setup_timer(&im->timer, igmp_timer_expire, (unsigned long)im); 1388 + timer_setup(&im->timer, igmp_timer_expire, 0); 1389 1389 im->unsolicit_count = net->ipv4.sysctl_igmp_qrv; 1390 1390 #endif 1391 1391 ··· 1695 1695 ASSERT_RTNL(); 1696 1696 1697 1697 #ifdef CONFIG_IP_MULTICAST 1698 - setup_timer(&in_dev->mr_gq_timer, igmp_gq_timer_expire, 1699 - (unsigned long)in_dev); 1700 - setup_timer(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire, 1701 - (unsigned long)in_dev); 1698 + timer_setup(&in_dev->mr_gq_timer, igmp_gq_timer_expire, 0); 1699 + timer_setup(&in_dev->mr_ifc_timer, igmp_ifc_timer_expire, 0); 1702 1700 in_dev->mr_qrv = net->ipv4.sysctl_igmp_qrv; 1703 1701 #endif 1704 1702
+4 -5
net/ipv4/ipmr.c
··· 112 112 int cmd); 113 113 static void igmpmsg_netlink_event(struct mr_table *mrt, struct sk_buff *pkt); 114 114 static void mroute_clean_tables(struct mr_table *mrt, bool all); 115 - static void ipmr_expire_process(unsigned long arg); 115 + static void ipmr_expire_process(struct timer_list *t); 116 116 117 117 #ifdef CONFIG_IP_MROUTE_MULTIPLE_TABLES 118 118 #define ipmr_for_each_table(mrt, net) \ ··· 375 375 INIT_LIST_HEAD(&mrt->mfc_cache_list); 376 376 INIT_LIST_HEAD(&mrt->mfc_unres_queue); 377 377 378 - setup_timer(&mrt->ipmr_expire_timer, ipmr_expire_process, 379 - (unsigned long)mrt); 378 + timer_setup(&mrt->ipmr_expire_timer, ipmr_expire_process, 0); 380 379 381 380 mrt->mroute_reg_vif_num = -1; 382 381 #ifdef CONFIG_IP_MROUTE_MULTIPLE_TABLES ··· 803 804 } 804 805 805 806 /* Timer process for the unresolved queue. */ 806 - static void ipmr_expire_process(unsigned long arg) 807 + static void ipmr_expire_process(struct timer_list *t) 807 808 { 808 - struct mr_table *mrt = (struct mr_table *)arg; 809 + struct mr_table *mrt = from_timer(mrt, t, ipmr_expire_timer); 809 810 unsigned long now; 810 811 unsigned long expires; 811 812 struct mfc_cache *c, *next;
+4 -5
net/ipv6/addrconf.c
··· 188 188 static void addrconf_dad_work(struct work_struct *w); 189 189 static void addrconf_dad_completed(struct inet6_ifaddr *ifp, bool bump_id); 190 190 static void addrconf_dad_run(struct inet6_dev *idev); 191 - static void addrconf_rs_timer(unsigned long data); 191 + static void addrconf_rs_timer(struct timer_list *t); 192 192 static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); 193 193 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); 194 194 ··· 388 388 rwlock_init(&ndev->lock); 389 389 ndev->dev = dev; 390 390 INIT_LIST_HEAD(&ndev->addr_list); 391 - setup_timer(&ndev->rs_timer, addrconf_rs_timer, 392 - (unsigned long)ndev); 391 + timer_setup(&ndev->rs_timer, addrconf_rs_timer, 0); 393 392 memcpy(&ndev->cnf, dev_net(dev)->ipv6.devconf_dflt, sizeof(ndev->cnf)); 394 393 395 394 if (ndev->cnf.stable_secret.initialized) ··· 3740 3741 return 0; 3741 3742 } 3742 3743 3743 - static void addrconf_rs_timer(unsigned long data) 3744 + static void addrconf_rs_timer(struct timer_list *t) 3744 3745 { 3745 - struct inet6_dev *idev = (struct inet6_dev *)data; 3746 + struct inet6_dev *idev = from_timer(idev, t, rs_timer); 3746 3747 struct net_device *dev = idev->dev; 3747 3748 struct in6_addr lladdr; 3748 3749
+6 -4
net/ipv6/ip6_fib.c
··· 70 70 * result of redirects, path MTU changes, etc. 71 71 */ 72 72 73 - static void fib6_gc_timer_cb(unsigned long arg); 73 + static void fib6_gc_timer_cb(struct timer_list *t); 74 74 75 75 #define FOR_WALKERS(net, w) \ 76 76 list_for_each_entry(w, &(net)->ipv6.fib6_walkers, lh) ··· 2026 2026 spin_unlock_bh(&net->ipv6.fib6_gc_lock); 2027 2027 } 2028 2028 2029 - static void fib6_gc_timer_cb(unsigned long arg) 2029 + static void fib6_gc_timer_cb(struct timer_list *t) 2030 2030 { 2031 - fib6_run_gc(0, (struct net *)arg, true); 2031 + struct net *arg = from_timer(arg, t, ipv6.ip6_fib_timer); 2032 + 2033 + fib6_run_gc(0, arg, true); 2032 2034 } 2033 2035 2034 2036 static int __net_init fib6_net_init(struct net *net) ··· 2045 2043 spin_lock_init(&net->ipv6.fib6_gc_lock); 2046 2044 rwlock_init(&net->ipv6.fib6_walker_lock); 2047 2045 INIT_LIST_HEAD(&net->ipv6.fib6_walkers); 2048 - setup_timer(&net->ipv6.ip6_fib_timer, fib6_gc_timer_cb, (unsigned long)net); 2046 + timer_setup(&net->ipv6.ip6_fib_timer, fib6_gc_timer_cb, 0); 2049 2047 2050 2048 net->ipv6.rt6_stats = kzalloc(sizeof(*net->ipv6.rt6_stats), GFP_KERNEL); 2051 2049 if (!net->ipv6.rt6_stats)
+2 -2
net/ipv6/ip6_flowlabel.c
··· 46 46 static atomic_t fl_size = ATOMIC_INIT(0); 47 47 static struct ip6_flowlabel __rcu *fl_ht[FL_HASH_MASK+1]; 48 48 49 - static void ip6_fl_gc(unsigned long dummy); 49 + static void ip6_fl_gc(struct timer_list *unused); 50 50 static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc); 51 51 52 52 /* FL hash table lock: it protects only of GC */ ··· 127 127 spin_unlock_bh(&ip6_fl_lock); 128 128 } 129 129 130 - static void ip6_fl_gc(unsigned long dummy) 130 + static void ip6_fl_gc(struct timer_list *unused) 131 131 { 132 132 int i; 133 133 unsigned long now = jiffies;
+4 -5
net/ipv6/ip6mr.c
··· 120 120 static int ip6mr_rtm_dumproute(struct sk_buff *skb, 121 121 struct netlink_callback *cb); 122 122 static void mroute_clean_tables(struct mr6_table *mrt, bool all); 123 - static void ipmr_expire_process(unsigned long arg); 123 + static void ipmr_expire_process(struct timer_list *t); 124 124 125 125 #ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES 126 126 #define ip6mr_for_each_table(mrt, net) \ ··· 320 320 321 321 INIT_LIST_HEAD(&mrt->mfc6_unres_queue); 322 322 323 - setup_timer(&mrt->ipmr_expire_timer, ipmr_expire_process, 324 - (unsigned long)mrt); 323 + timer_setup(&mrt->ipmr_expire_timer, ipmr_expire_process, 0); 325 324 326 325 #ifdef CONFIG_IPV6_PIMSM_V2 327 326 mrt->mroute_reg_vif_num = -1; ··· 887 888 mod_timer(&mrt->ipmr_expire_timer, jiffies + expires); 888 889 } 889 890 890 - static void ipmr_expire_process(unsigned long arg) 891 + static void ipmr_expire_process(struct timer_list *t) 891 892 { 892 - struct mr6_table *mrt = (struct mr6_table *)arg; 893 + struct mr6_table *mrt = from_timer(mrt, t, ipmr_expire_timer); 893 894 894 895 if (!spin_trylock(&mfc_unres_lock)) { 895 896 mod_timer(&mrt->ipmr_expire_timer, jiffies + 1);
+15 -18
net/ipv6/mcast.c
··· 75 75 76 76 static void igmp6_join_group(struct ifmcaddr6 *ma); 77 77 static void igmp6_leave_group(struct ifmcaddr6 *ma); 78 - static void igmp6_timer_handler(unsigned long data); 78 + static void igmp6_timer_handler(struct timer_list *t); 79 79 80 - static void mld_gq_timer_expire(unsigned long data); 81 - static void mld_ifc_timer_expire(unsigned long data); 80 + static void mld_gq_timer_expire(struct timer_list *t); 81 + static void mld_ifc_timer_expire(struct timer_list *t); 82 82 static void mld_ifc_event(struct inet6_dev *idev); 83 83 static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *pmc); 84 84 static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *pmc); ··· 839 839 if (!mc) 840 840 return NULL; 841 841 842 - setup_timer(&mc->mca_timer, igmp6_timer_handler, (unsigned long)mc); 842 + timer_setup(&mc->mca_timer, igmp6_timer_handler, 0); 843 843 844 844 mc->mca_addr = *addr; 845 845 mc->idev = idev; /* reference taken by caller */ ··· 2083 2083 } 2084 2084 } 2085 2085 2086 - static void mld_dad_timer_expire(unsigned long data) 2086 + static void mld_dad_timer_expire(struct timer_list *t) 2087 2087 { 2088 - struct inet6_dev *idev = (struct inet6_dev *)data; 2088 + struct inet6_dev *idev = from_timer(idev, t, mc_dad_timer); 2089 2089 2090 2090 mld_send_initial_cr(idev); 2091 2091 if (idev->mc_dad_count) { ··· 2432 2432 } 2433 2433 } 2434 2434 2435 - static void mld_gq_timer_expire(unsigned long data) 2435 + static void mld_gq_timer_expire(struct timer_list *t) 2436 2436 { 2437 - struct inet6_dev *idev = (struct inet6_dev *)data; 2437 + struct inet6_dev *idev = from_timer(idev, t, mc_gq_timer); 2438 2438 2439 2439 idev->mc_gq_running = 0; 2440 2440 mld_send_report(idev, NULL); 2441 2441 in6_dev_put(idev); 2442 2442 } 2443 2443 2444 - static void mld_ifc_timer_expire(unsigned long data) 2444 + static void mld_ifc_timer_expire(struct timer_list *t) 2445 2445 { 2446 - struct inet6_dev *idev = (struct inet6_dev *)data; 2446 + struct inet6_dev *idev = from_timer(idev, t, mc_ifc_timer); 2447 2447 2448 2448 mld_send_cr(idev); 2449 2449 if (idev->mc_ifc_count) { ··· 2462 2462 mld_ifc_start_timer(idev, 1); 2463 2463 } 2464 2464 2465 - static void igmp6_timer_handler(unsigned long data) 2465 + static void igmp6_timer_handler(struct timer_list *t) 2466 2466 { 2467 - struct ifmcaddr6 *ma = (struct ifmcaddr6 *) data; 2467 + struct ifmcaddr6 *ma = from_timer(ma, t, mca_timer); 2468 2468 2469 2469 if (mld_in_v1_mode(ma->idev)) 2470 2470 igmp6_send(&ma->mca_addr, ma->idev->dev, ICMPV6_MGM_REPORT); ··· 2552 2552 write_lock_bh(&idev->lock); 2553 2553 spin_lock_init(&idev->mc_lock); 2554 2554 idev->mc_gq_running = 0; 2555 - setup_timer(&idev->mc_gq_timer, mld_gq_timer_expire, 2556 - (unsigned long)idev); 2555 + timer_setup(&idev->mc_gq_timer, mld_gq_timer_expire, 0); 2557 2556 idev->mc_tomb = NULL; 2558 2557 idev->mc_ifc_count = 0; 2559 - setup_timer(&idev->mc_ifc_timer, mld_ifc_timer_expire, 2560 - (unsigned long)idev); 2561 - setup_timer(&idev->mc_dad_timer, mld_dad_timer_expire, 2562 - (unsigned long)idev); 2558 + timer_setup(&idev->mc_ifc_timer, mld_ifc_timer_expire, 0); 2559 + timer_setup(&idev->mc_dad_timer, mld_dad_timer_expire, 0); 2563 2560 ipv6_mc_reset(idev); 2564 2561 write_unlock_bh(&idev->lock); 2565 2562 }
+2 -2
net/lapb/lapb_timer.c
··· 42 42 { 43 43 del_timer(&lapb->t1timer); 44 44 45 - lapb->t1timer.function = (TIMER_FUNC_TYPE)lapb_t1timer_expiry; 45 + lapb->t1timer.function = lapb_t1timer_expiry; 46 46 lapb->t1timer.expires = jiffies + lapb->t1; 47 47 48 48 add_timer(&lapb->t1timer); ··· 52 52 { 53 53 del_timer(&lapb->t2timer); 54 54 55 - lapb->t2timer.function = (TIMER_FUNC_TYPE)lapb_t2timer_expiry; 55 + lapb->t2timer.function = lapb_t2timer_expiry; 56 56 lapb->t2timer.expires = jiffies + lapb->t2; 57 57 58 58 add_timer(&lapb->t2timer);
+6 -9
net/ncsi/ncsi-manage.c
··· 184 184 nd->handler(nd); 185 185 } 186 186 187 - static void ncsi_channel_monitor(unsigned long data) 187 + static void ncsi_channel_monitor(struct timer_list *t) 188 188 { 189 - struct ncsi_channel *nc = (struct ncsi_channel *)data; 189 + struct ncsi_channel *nc = from_timer(nc, t, monitor.timer); 190 190 struct ncsi_package *np = nc->package; 191 191 struct ncsi_dev_priv *ndp = np->ndp; 192 192 struct ncsi_channel_mode *ncm; ··· 313 313 nc->package = np; 314 314 nc->state = NCSI_CHANNEL_INACTIVE; 315 315 nc->monitor.enabled = false; 316 - setup_timer(&nc->monitor.timer, 317 - ncsi_channel_monitor, (unsigned long)nc); 316 + timer_setup(&nc->monitor.timer, ncsi_channel_monitor, 0); 318 317 spin_lock_init(&nc->lock); 319 318 INIT_LIST_HEAD(&nc->link); 320 319 for (index = 0; index < NCSI_CAP_MAX; index++) ··· 528 529 return NULL; 529 530 } 530 531 531 - static void ncsi_request_timeout(unsigned long data) 532 + static void ncsi_request_timeout(struct timer_list *t) 532 533 { 533 - struct ncsi_request *nr = (struct ncsi_request *)data; 534 + struct ncsi_request *nr = from_timer(nr, t, timer); 534 535 struct ncsi_dev_priv *ndp = nr->ndp; 535 536 unsigned long flags; 536 537 ··· 1576 1577 for (i = 0; i < ARRAY_SIZE(ndp->requests); i++) { 1577 1578 ndp->requests[i].id = i; 1578 1579 ndp->requests[i].ndp = ndp; 1579 - setup_timer(&ndp->requests[i].timer, 1580 - ncsi_request_timeout, 1581 - (unsigned long)&ndp->requests[i]); 1580 + timer_setup(&ndp->requests[i].timer, ncsi_request_timeout, 0); 1582 1581 } 1583 1582 1584 1583 spin_lock_irqsave(&ncsi_dev_lock, flags);
+3 -4
net/netfilter/nf_conntrack_expect.c
··· 67 67 } 68 68 EXPORT_SYMBOL_GPL(nf_ct_unlink_expect_report); 69 69 70 - static void nf_ct_expectation_timed_out(unsigned long ul_expect) 70 + static void nf_ct_expectation_timed_out(struct timer_list *t) 71 71 { 72 - struct nf_conntrack_expect *exp = (void *)ul_expect; 72 + struct nf_conntrack_expect *exp = from_timer(exp, t, timeout); 73 73 74 74 spin_lock_bh(&nf_conntrack_expect_lock); 75 75 nf_ct_unlink_expect(exp); ··· 368 368 /* two references : one for hash insert, one for the timer */ 369 369 refcount_add(2, &exp->use); 370 370 371 - setup_timer(&exp->timeout, nf_ct_expectation_timed_out, 372 - (unsigned long)exp); 371 + timer_setup(&exp->timeout, nf_ct_expectation_timed_out, 0); 373 372 helper = rcu_dereference_protected(master_help->helper, 374 373 lockdep_is_held(&nf_conntrack_expect_lock)); 375 374 if (helper) {
+3 -4
net/netfilter/xt_IDLETIMER.c
··· 107 107 sysfs_notify(idletimer_tg_kobj, NULL, timer->attr.attr.name); 108 108 } 109 109 110 - static void idletimer_tg_expired(unsigned long data) 110 + static void idletimer_tg_expired(struct timer_list *t) 111 111 { 112 - struct idletimer_tg *timer = (struct idletimer_tg *) data; 112 + struct idletimer_tg *timer = from_timer(timer, t, timer); 113 113 114 114 pr_debug("timer %s expired\n", timer->attr.attr.name); 115 115 ··· 143 143 144 144 list_add(&info->timer->entry, &idletimer_tg_list); 145 145 146 - setup_timer(&info->timer->timer, idletimer_tg_expired, 147 - (unsigned long) info->timer); 146 + timer_setup(&info->timer->timer, idletimer_tg_expired, 0); 148 147 info->timer->refcnt = 1; 149 148 150 149 mod_timer(&info->timer->timer,
+4 -4
net/netfilter/xt_LED.c
··· 85 85 return XT_CONTINUE; 86 86 } 87 87 88 - static void led_timeout_callback(unsigned long data) 88 + static void led_timeout_callback(struct timer_list *t) 89 89 { 90 - struct xt_led_info_internal *ledinternal = (struct xt_led_info_internal *)data; 90 + struct xt_led_info_internal *ledinternal = from_timer(ledinternal, t, 91 + timer); 91 92 92 93 led_trigger_event(&ledinternal->netfilter_led_trigger, LED_OFF); 93 94 } ··· 144 143 145 144 /* See if we need to set up a timer */ 146 145 if (ledinfo->delay > 0) 147 - setup_timer(&ledinternal->timer, led_timeout_callback, 148 - (unsigned long)ledinternal); 146 + timer_setup(&ledinternal->timer, led_timeout_callback, 0); 149 147 150 148 list_add_tail(&ledinternal->list, &xt_led_triggers); 151 149
+1 -1
net/netrom/af_netrom.c
··· 284 284 285 285 if (sk_has_allocations(sk)) { 286 286 /* Defer: outstanding buffers */ 287 - sk->sk_timer.function = (TIMER_FUNC_TYPE)nr_destroy_timer; 287 + sk->sk_timer.function = nr_destroy_timer; 288 288 sk->sk_timer.expires = jiffies + 2 * HZ; 289 289 add_timer(&sk->sk_timer); 290 290 } else
+2 -2
net/netrom/nr_loopback.c
··· 15 15 #include <net/netrom.h> 16 16 #include <linux/init.h> 17 17 18 - static void nr_loopback_timer(unsigned long); 18 + static void nr_loopback_timer(struct timer_list *); 19 19 20 20 static struct sk_buff_head loopback_queue; 21 21 static DEFINE_TIMER(loopback_timer, nr_loopback_timer); ··· 48 48 return 1; 49 49 } 50 50 51 - static void nr_loopback_timer(unsigned long param) 51 + static void nr_loopback_timer(struct timer_list *unused) 52 52 { 53 53 struct sk_buff *skb; 54 54 ax25_address *nr_dest;
+1 -1
net/netrom/nr_timer.c
··· 45 45 timer_setup(&nr->idletimer, nr_idletimer_expiry, 0); 46 46 47 47 /* initialized by sock_init_data */ 48 - sk->sk_timer.function = (TIMER_FUNC_TYPE)nr_heartbeat_expiry; 48 + sk->sk_timer.function = nr_heartbeat_expiry; 49 49 } 50 50 51 51 void nr_start_t1timer(struct sock *sk)
+6 -8
net/nfc/nci/core.c
··· 591 591 } 592 592 593 593 /* NCI command timer function */ 594 - static void nci_cmd_timer(unsigned long arg) 594 + static void nci_cmd_timer(struct timer_list *t) 595 595 { 596 - struct nci_dev *ndev = (void *) arg; 596 + struct nci_dev *ndev = from_timer(ndev, t, cmd_timer); 597 597 598 598 atomic_set(&ndev->cmd_cnt, 1); 599 599 queue_work(ndev->cmd_wq, &ndev->cmd_work); 600 600 } 601 601 602 602 /* NCI data exchange timer function */ 603 - static void nci_data_timer(unsigned long arg) 603 + static void nci_data_timer(struct timer_list *t) 604 604 { 605 - struct nci_dev *ndev = (void *) arg; 605 + struct nci_dev *ndev = from_timer(ndev, t, data_timer); 606 606 607 607 set_bit(NCI_DATA_EXCHANGE_TO, &ndev->flags); 608 608 queue_work(ndev->rx_wq, &ndev->rx_work); ··· 1232 1232 skb_queue_head_init(&ndev->rx_q); 1233 1233 skb_queue_head_init(&ndev->tx_q); 1234 1234 1235 - setup_timer(&ndev->cmd_timer, nci_cmd_timer, 1236 - (unsigned long) ndev); 1237 - setup_timer(&ndev->data_timer, nci_data_timer, 1238 - (unsigned long) ndev); 1235 + timer_setup(&ndev->cmd_timer, nci_cmd_timer, 0); 1236 + timer_setup(&ndev->data_timer, nci_data_timer, 0); 1239 1237 1240 1238 mutex_init(&ndev->req_lock); 1241 1239 INIT_LIST_HEAD(&ndev->conn_info_list);
+2 -2
net/rose/rose_link.c
··· 37 37 { 38 38 del_timer(&neigh->ftimer); 39 39 40 - neigh->ftimer.function = (TIMER_FUNC_TYPE)rose_ftimer_expiry; 40 + neigh->ftimer.function = rose_ftimer_expiry; 41 41 neigh->ftimer.expires = 42 42 jiffies + msecs_to_jiffies(sysctl_rose_link_fail_timeout); 43 43 ··· 48 48 { 49 49 del_timer(&neigh->t0timer); 50 50 51 - neigh->t0timer.function = (TIMER_FUNC_TYPE)rose_t0timer_expiry; 51 + neigh->t0timer.function = rose_t0timer_expiry; 52 52 neigh->t0timer.expires = 53 53 jiffies + msecs_to_jiffies(sysctl_rose_restart_request_timeout); 54 54
+6 -6
net/rose/rose_timer.c
··· 36 36 { 37 37 del_timer(&sk->sk_timer); 38 38 39 - sk->sk_timer.function = (TIMER_FUNC_TYPE)rose_heartbeat_expiry; 39 + sk->sk_timer.function = rose_heartbeat_expiry; 40 40 sk->sk_timer.expires = jiffies + 5 * HZ; 41 41 42 42 add_timer(&sk->sk_timer); ··· 48 48 49 49 del_timer(&rose->timer); 50 50 51 - rose->timer.function = (TIMER_FUNC_TYPE)rose_timer_expiry; 51 + rose->timer.function = rose_timer_expiry; 52 52 rose->timer.expires = jiffies + rose->t1; 53 53 54 54 add_timer(&rose->timer); ··· 60 60 61 61 del_timer(&rose->timer); 62 62 63 - rose->timer.function = (TIMER_FUNC_TYPE)rose_timer_expiry; 63 + rose->timer.function = rose_timer_expiry; 64 64 rose->timer.expires = jiffies + rose->t2; 65 65 66 66 add_timer(&rose->timer); ··· 72 72 73 73 del_timer(&rose->timer); 74 74 75 - rose->timer.function = (TIMER_FUNC_TYPE)rose_timer_expiry; 75 + rose->timer.function = rose_timer_expiry; 76 76 rose->timer.expires = jiffies + rose->t3; 77 77 78 78 add_timer(&rose->timer); ··· 84 84 85 85 del_timer(&rose->timer); 86 86 87 - rose->timer.function = (TIMER_FUNC_TYPE)rose_timer_expiry; 87 + rose->timer.function = rose_timer_expiry; 88 88 rose->timer.expires = jiffies + rose->hb; 89 89 90 90 add_timer(&rose->timer); ··· 97 97 del_timer(&rose->idletimer); 98 98 99 99 if (rose->idle > 0) { 100 - rose->idletimer.function = (TIMER_FUNC_TYPE)rose_idletimer_expiry; 100 + rose->idletimer.function = rose_idletimer_expiry; 101 101 rose->idletimer.expires = jiffies + rose->idle; 102 102 103 103 add_timer(&rose->idletimer);
+3 -4
net/rxrpc/call_object.c
··· 45 45 46 46 struct kmem_cache *rxrpc_call_jar; 47 47 48 - static void rxrpc_call_timer_expired(unsigned long _call) 48 + static void rxrpc_call_timer_expired(struct timer_list *t) 49 49 { 50 - struct rxrpc_call *call = (struct rxrpc_call *)_call; 50 + struct rxrpc_call *call = from_timer(call, t, timer); 51 51 52 52 _enter("%d", call->debug_id); 53 53 ··· 114 114 goto nomem_2; 115 115 116 116 mutex_init(&call->user_mutex); 117 - setup_timer(&call->timer, rxrpc_call_timer_expired, 118 - (unsigned long)call); 117 + timer_setup(&call->timer, rxrpc_call_timer_expired, 0); 119 118 INIT_WORK(&call->processor, &rxrpc_process_call); 120 119 INIT_LIST_HEAD(&call->link); 121 120 INIT_LIST_HEAD(&call->chan_wait_link);
+1 -1
net/sunrpc/svc_xprt.c
··· 745 745 serv->sv_tmpcnt++; 746 746 if (serv->sv_temptimer.function == NULL) { 747 747 /* setup timer to age temp transports */ 748 - serv->sv_temptimer.function = (TIMER_FUNC_TYPE)svc_age_temp_xprts; 748 + serv->sv_temptimer.function = svc_age_temp_xprts; 749 749 mod_timer(&serv->sv_temptimer, 750 750 jiffies + svc_conn_age_period * HZ); 751 751 }
+6 -5
net/wireless/lib80211.c
··· 44 44 static void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, 45 45 int force); 46 46 static void lib80211_crypt_quiescing(struct lib80211_crypt_info *info); 47 - static void lib80211_crypt_deinit_handler(unsigned long data); 47 + static void lib80211_crypt_deinit_handler(struct timer_list *t); 48 48 49 49 int lib80211_crypt_info_init(struct lib80211_crypt_info *info, char *name, 50 50 spinlock_t *lock) ··· 55 55 info->lock = lock; 56 56 57 57 INIT_LIST_HEAD(&info->crypt_deinit_list); 58 - setup_timer(&info->crypt_deinit_timer, lib80211_crypt_deinit_handler, 59 - (unsigned long)info); 58 + timer_setup(&info->crypt_deinit_timer, lib80211_crypt_deinit_handler, 59 + 0); 60 60 61 61 return 0; 62 62 } ··· 116 116 spin_unlock_irqrestore(info->lock, flags); 117 117 } 118 118 119 - static void lib80211_crypt_deinit_handler(unsigned long data) 119 + static void lib80211_crypt_deinit_handler(struct timer_list *t) 120 120 { 121 - struct lib80211_crypt_info *info = (struct lib80211_crypt_info *)data; 121 + struct lib80211_crypt_info *info = from_timer(info, t, 122 + crypt_deinit_timer); 122 123 unsigned long flags; 123 124 124 125 lib80211_crypt_deinit_entries(info, 0);
+1 -1
net/x25/af_x25.c
··· 415 415 if (sk_has_allocations(sk)) { 416 416 /* Defer: outstanding buffers */ 417 417 sk->sk_timer.expires = jiffies + 10 * HZ; 418 - sk->sk_timer.function = (TIMER_FUNC_TYPE)x25_destroy_timer; 418 + sk->sk_timer.function = x25_destroy_timer; 419 419 add_timer(&sk->sk_timer); 420 420 } else { 421 421 /* drop last reference so sock_put will free */
+4 -4
net/x25/x25_link.c
··· 36 36 LIST_HEAD(x25_neigh_list); 37 37 DEFINE_RWLOCK(x25_neigh_list_lock); 38 38 39 - static void x25_t20timer_expiry(unsigned long); 39 + static void x25_t20timer_expiry(struct timer_list *); 40 40 41 41 static void x25_transmit_restart_confirmation(struct x25_neigh *nb); 42 42 static void x25_transmit_restart_request(struct x25_neigh *nb); ··· 49 49 mod_timer(&nb->t20timer, jiffies + nb->t20); 50 50 } 51 51 52 - static void x25_t20timer_expiry(unsigned long param) 52 + static void x25_t20timer_expiry(struct timer_list *t) 53 53 { 54 - struct x25_neigh *nb = (struct x25_neigh *)param; 54 + struct x25_neigh *nb = from_timer(nb, t, t20timer); 55 55 56 56 x25_transmit_restart_request(nb); 57 57 ··· 252 252 return; 253 253 254 254 skb_queue_head_init(&nb->queue); 255 - setup_timer(&nb->t20timer, x25_t20timer_expiry, (unsigned long)nb); 255 + timer_setup(&nb->t20timer, x25_t20timer_expiry, 0); 256 256 257 257 dev_hold(dev); 258 258 nb->dev = dev;
+1 -1
net/x25/x25_timer.c
··· 36 36 timer_setup(&x25->timer, x25_timer_expiry, 0); 37 37 38 38 /* initialized by sock_init_data */ 39 - sk->sk_timer.function = (TIMER_FUNC_TYPE)x25_heartbeat_expiry; 39 + sk->sk_timer.function = x25_heartbeat_expiry; 40 40 } 41 41 42 42 void x25_start_heartbeat(struct sock *sk)
+4 -5
net/xfrm/xfrm_state.c
··· 556 556 return HRTIMER_NORESTART; 557 557 } 558 558 559 - static void xfrm_replay_timer_handler(unsigned long data); 559 + static void xfrm_replay_timer_handler(struct timer_list *t); 560 560 561 561 struct xfrm_state *xfrm_state_alloc(struct net *net) 562 562 { ··· 574 574 INIT_HLIST_NODE(&x->byspi); 575 575 tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, 576 576 CLOCK_BOOTTIME, HRTIMER_MODE_ABS); 577 - setup_timer(&x->rtimer, xfrm_replay_timer_handler, 578 - (unsigned long)x); 577 + timer_setup(&x->rtimer, xfrm_replay_timer_handler, 0); 579 578 x->curlft.add_time = get_seconds(); 580 579 x->lft.soft_byte_limit = XFRM_INF; 581 580 x->lft.soft_packet_limit = XFRM_INF; ··· 1878 1879 } 1879 1880 EXPORT_SYMBOL(xfrm_state_walk_done); 1880 1881 1881 - static void xfrm_replay_timer_handler(unsigned long data) 1882 + static void xfrm_replay_timer_handler(struct timer_list *t) 1882 1883 { 1883 - struct xfrm_state *x = (struct xfrm_state *)data; 1884 + struct xfrm_state *x = from_timer(x, t, rtimer); 1884 1885 1885 1886 spin_lock(&x->lock); 1886 1887
-277
scripts/coccinelle/api/setup_timer.cocci
··· 1 - /// Use setup_timer function instead of initializing timer with the function 2 - /// and data fields 3 - // Confidence: High 4 - // Copyright: (C) 2016 Vaishali Thakkar, Oracle. GPLv2 5 - // Copyright: (C) 2017 Kees Cook, Google. GPLv2 6 - // Options: --no-includes --include-headers 7 - // Keywords: init_timer, setup_timer 8 - 9 - virtual patch 10 - virtual context 11 - virtual org 12 - virtual report 13 - 14 - // Match the common cases first to avoid Coccinelle parsing loops with 15 - // "... when" clauses. 16 - 17 - @match_immediate_function_data_after_init_timer 18 - depends on patch && !context && !org && !report@ 19 - expression e, func, da; 20 - @@ 21 - 22 - -init_timer 23 - +setup_timer 24 - ( \(&e\|e\) 25 - +, func, da 26 - ); 27 - ( 28 - -\(e.function\|e->function\) = func; 29 - -\(e.data\|e->data\) = da; 30 - | 31 - -\(e.data\|e->data\) = da; 32 - -\(e.function\|e->function\) = func; 33 - ) 34 - 35 - @match_immediate_function_data_before_init_timer 36 - depends on patch && !context && !org && !report@ 37 - expression e, func, da; 38 - @@ 39 - 40 - ( 41 - -\(e.function\|e->function\) = func; 42 - -\(e.data\|e->data\) = da; 43 - | 44 - -\(e.data\|e->data\) = da; 45 - -\(e.function\|e->function\) = func; 46 - ) 47 - -init_timer 48 - +setup_timer 49 - ( \(&e\|e\) 50 - +, func, da 51 - ); 52 - 53 - @match_function_and_data_after_init_timer 54 - depends on patch && !context && !org && !report@ 55 - expression e, e2, e3, e4, e5, func, da; 56 - @@ 57 - 58 - -init_timer 59 - +setup_timer 60 - ( \(&e\|e\) 61 - +, func, da 62 - ); 63 - ... when != func = e2 64 - when != da = e3 65 - ( 66 - -e.function = func; 67 - ... when != da = e4 68 - -e.data = da; 69 - | 70 - -e->function = func; 71 - ... when != da = e4 72 - -e->data = da; 73 - | 74 - -e.data = da; 75 - ... when != func = e5 76 - -e.function = func; 77 - | 78 - -e->data = da; 79 - ... when != func = e5 80 - -e->function = func; 81 - ) 82 - 83 - @match_function_and_data_before_init_timer 84 - depends on patch && !context && !org && !report@ 85 - expression e, e2, e3, e4, e5, func, da; 86 - @@ 87 - ( 88 - -e.function = func; 89 - ... when != da = e4 90 - -e.data = da; 91 - | 92 - -e->function = func; 93 - ... when != da = e4 94 - -e->data = da; 95 - | 96 - -e.data = da; 97 - ... when != func = e5 98 - -e.function = func; 99 - | 100 - -e->data = da; 101 - ... when != func = e5 102 - -e->function = func; 103 - ) 104 - ... when != func = e2 105 - when != da = e3 106 - -init_timer 107 - +setup_timer 108 - ( \(&e\|e\) 109 - +, func, da 110 - ); 111 - 112 - @r1 exists@ 113 - expression t; 114 - identifier f; 115 - position p; 116 - @@ 117 - 118 - f(...) { ... when any 119 - init_timer@p(\(&t\|t\)) 120 - ... when any 121 - } 122 - 123 - @r2 exists@ 124 - expression r1.t; 125 - identifier g != r1.f; 126 - expression e8; 127 - @@ 128 - 129 - g(...) { ... when any 130 - \(t.data\|t->data\) = e8 131 - ... when any 132 - } 133 - 134 - // It is dangerous to use setup_timer if data field is initialized 135 - // in another function. 136 - 137 - @script:python depends on r2@ 138 - p << r1.p; 139 - @@ 140 - 141 - cocci.include_match(False) 142 - 143 - @r3 depends on patch && !context && !org && !report@ 144 - expression r1.t, func, e7; 145 - position r1.p; 146 - @@ 147 - 148 - ( 149 - -init_timer@p(&t); 150 - +setup_timer(&t, func, 0UL); 151 - ... when != func = e7 152 - -t.function = func; 153 - | 154 - -t.function = func; 155 - ... when != func = e7 156 - -init_timer@p(&t); 157 - +setup_timer(&t, func, 0UL); 158 - | 159 - -init_timer@p(t); 160 - +setup_timer(t, func, 0UL); 161 - ... when != func = e7 162 - -t->function = func; 163 - | 164 - -t->function = func; 165 - ... when != func = e7 166 - -init_timer@p(t); 167 - +setup_timer(t, func, 0UL); 168 - ) 169 - 170 - // ---------------------------------------------------------------------------- 171 - 172 - @match_immediate_function_data_after_init_timer_context 173 - depends on !patch && (context || org || report)@ 174 - expression da, e, func; 175 - position j0, j1, j2; 176 - @@ 177 - 178 - * init_timer@j0 (&e); 179 - ( 180 - * e@j1.function = func; 181 - * e@j2.data = da; 182 - | 183 - * e@j1.data = da; 184 - * e@j2.function = func; 185 - ) 186 - 187 - @match_function_and_data_after_init_timer_context 188 - depends on !patch && (context || org || report)@ 189 - expression a, b, e1, e2, e3, e4, e5; 190 - position j0 != match_immediate_function_data_after_init_timer_context.j0,j1,j2; 191 - @@ 192 - 193 - * init_timer@j0 (&e1); 194 - ... when != a = e2 195 - when != b = e3 196 - ( 197 - * e1@j1.function = a; 198 - ... when != b = e4 199 - * e1@j2.data = b; 200 - | 201 - * e1@j1.data = b; 202 - ... when != a = e5 203 - * e1@j2.function = a; 204 - ) 205 - 206 - @r3_context depends on !patch && (context || org || report)@ 207 - expression c, e6, e7; 208 - position r1.p; 209 - position j0 != 210 - {match_immediate_function_data_after_init_timer_context.j0, 211 - match_function_and_data_after_init_timer_context.j0}, j1; 212 - @@ 213 - 214 - * init_timer@j0@p (&e6); 215 - ... when != c = e7 216 - * e6@j1.function = c; 217 - 218 - // ---------------------------------------------------------------------------- 219 - 220 - @script:python match_immediate_function_data_after_init_timer_org 221 - depends on org@ 222 - j0 << match_immediate_function_data_after_init_timer_context.j0; 223 - j1 << match_immediate_function_data_after_init_timer_context.j1; 224 - j2 << match_immediate_function_data_after_init_timer_context.j2; 225 - @@ 226 - 227 - msg = "Use setup_timer function." 228 - coccilib.org.print_todo(j0[0], msg) 229 - coccilib.org.print_link(j1[0], "") 230 - coccilib.org.print_link(j2[0], "") 231 - 232 - @script:python match_function_and_data_after_init_timer_org depends on org@ 233 - j0 << match_function_and_data_after_init_timer_context.j0; 234 - j1 << match_function_and_data_after_init_timer_context.j1; 235 - j2 << match_function_and_data_after_init_timer_context.j2; 236 - @@ 237 - 238 - msg = "Use setup_timer function." 239 - coccilib.org.print_todo(j0[0], msg) 240 - coccilib.org.print_link(j1[0], "") 241 - coccilib.org.print_link(j2[0], "") 242 - 243 - @script:python r3_org depends on org@ 244 - j0 << r3_context.j0; 245 - j1 << r3_context.j1; 246 - @@ 247 - 248 - msg = "Use setup_timer function." 249 - coccilib.org.print_todo(j0[0], msg) 250 - coccilib.org.print_link(j1[0], "") 251 - 252 - // ---------------------------------------------------------------------------- 253 - 254 - @script:python match_immediate_function_data_after_init_timer_report 255 - depends on report@ 256 - j0 << match_immediate_function_data_after_init_timer_context.j0; 257 - j1 << match_immediate_function_data_after_init_timer_context.j1; 258 - @@ 259 - 260 - msg = "Use setup_timer function for function on line %s." % (j1[0].line) 261 - coccilib.report.print_report(j0[0], msg) 262 - 263 - @script:python match_function_and_data_after_init_timer_report depends on report@ 264 - j0 << match_function_and_data_after_init_timer_context.j0; 265 - j1 << match_function_and_data_after_init_timer_context.j1; 266 - @@ 267 - 268 - msg = "Use setup_timer function for function on line %s." % (j1[0].line) 269 - coccilib.report.print_report(j0[0], msg) 270 - 271 - @script:python r3_report depends on report@ 272 - j0 << r3_context.j0; 273 - j1 << r3_context.j1; 274 - @@ 275 - 276 - msg = "Use setup_timer function for function on line %s." % (j1[0].line) 277 - coccilib.report.print_report(j0[0], msg)
+2 -2
security/keys/gc.c
··· 29 29 /* 30 30 * Reaper for links from keyrings to dead keys. 31 31 */ 32 - static void key_gc_timer_func(unsigned long); 32 + static void key_gc_timer_func(struct timer_list *); 33 33 static DEFINE_TIMER(key_gc_timer, key_gc_timer_func); 34 34 35 35 static time64_t key_gc_next_run = TIME64_MAX; ··· 84 84 * Some key's cleanup time was met after it expired, so we need to get the 85 85 * reaper to go through a cycle finding expired keys. 86 86 */ 87 - static void key_gc_timer_func(unsigned long data) 87 + static void key_gc_timer_func(struct timer_list *unused) 88 88 { 89 89 kenter(""); 90 90 key_gc_next_run = TIME64_MAX;
+1 -1
sound/usb/line6/driver.c
··· 201 201 void line6_start_timer(struct timer_list *timer, unsigned long msecs, 202 202 void (*function)(struct timer_list *t)) 203 203 { 204 - timer->function = (TIMER_FUNC_TYPE)function; 204 + timer->function = function; 205 205 mod_timer(timer, jiffies + msecs_to_jiffies(msecs)); 206 206 } 207 207 EXPORT_SYMBOL_GPL(line6_start_timer);