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

treewide: setup_timer() -> timer_setup()

This converts all remaining cases of the old setup_timer() API into using
timer_setup(), where the callback argument is the structure already
holding the struct timer_list. These should have no behavioral changes,
since they just change which pointer is passed into the callback with
the same available pointers after conversion. It handles the following
examples, in addition to some other variations.

Casting from unsigned long:

void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
setup_timer(&ptr->my_timer, my_callback, ptr);

and forced object casts:

void my_callback(struct something *ptr)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);

become:

void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);

Direct function assignments:

void my_callback(unsigned long data)
{
struct something *ptr = (struct something *)data;
...
}
...
ptr->my_timer.function = my_callback;

have a temporary cast added, along with converting the args:

void my_callback(struct timer_list *t)
{
struct something *ptr = from_timer(ptr, t, my_timer);
...
}
...
ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;

And finally, callbacks without a data assignment:

void my_callback(unsigned long data)
{
...
}
...
setup_timer(&ptr->my_timer, my_callback, 0);

have their argument renamed to verify they're unused during conversion:

void my_callback(struct timer_list *unused)
{
...
}
...
timer_setup(&ptr->my_timer, my_callback, 0);

The conversion is done with the following Coccinelle script:

spatch --very-quiet --all-includes --include-headers \
-I ./arch/x86/include -I ./arch/x86/include/generated \
-I ./include -I ./arch/x86/include/uapi \
-I ./arch/x86/include/generated/uapi -I ./include/uapi \
-I ./include/generated/uapi --include ./include/linux/kconfig.h \
--dir . \
--cocci-file ~/src/data/timer_setup.cocci

@fix_address_of@
expression e;
@@

setup_timer(
-&(e)
+&e
, ...)

// Update any raw setup_timer() usages that have a NULL callback, but
// would otherwise match change_timer_function_usage, since the latter
// will update all function assignments done in the face of a NULL
// function initialization in setup_timer().
@change_timer_function_usage_NULL@
expression _E;
identifier _timer;
type _cast_data;
@@

(
-setup_timer(&_E->_timer, NULL, _E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E->_timer, NULL, (_cast_data)_E);
+timer_setup(&_E->_timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, &_E);
+timer_setup(&_E._timer, NULL, 0);
|
-setup_timer(&_E._timer, NULL, (_cast_data)&_E);
+timer_setup(&_E._timer, NULL, 0);
)

@change_timer_function_usage@
expression _E;
identifier _timer;
struct timer_list _stl;
identifier _callback;
type _cast_func, _cast_data;
@@

(
-setup_timer(&_E->_timer, _callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, &_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, _E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, &_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);
+timer_setup(&_E._timer, _callback, 0);
|
_E->_timer@_stl.function = _callback;
|
_E->_timer@_stl.function = &_callback;
|
_E->_timer@_stl.function = (_cast_func)_callback;
|
_E->_timer@_stl.function = (_cast_func)&_callback;
|
_E._timer@_stl.function = _callback;
|
_E._timer@_stl.function = &_callback;
|
_E._timer@_stl.function = (_cast_func)_callback;
|
_E._timer@_stl.function = (_cast_func)&_callback;
)

// callback(unsigned long arg)
@change_callback_handle_cast
depends on change_timer_function_usage@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
identifier _handle;
@@

void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
(
... when != _origarg
_handletype *_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(_handletype *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
|
... when != _origarg
_handletype *_handle;
... when != _handle
_handle =
-(void *)_origarg;
+from_timer(_handle, t, _timer);
... when != _origarg
)
}

// callback(unsigned long arg) without existing variable
@change_callback_handle_cast_no_arg
depends on change_timer_function_usage &&
!change_callback_handle_cast@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _origtype;
identifier _origarg;
type _handletype;
@@

void _callback(
-_origtype _origarg
+struct timer_list *t
)
{
+ _handletype *_origarg = from_timer(_origarg, t, _timer);
+
... when != _origarg
- (_handletype *)_origarg
+ _origarg
... when != _origarg
}

// Avoid already converted callbacks.
@match_callback_converted
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier t;
@@

void _callback(struct timer_list *t)
{ ... }

// callback(struct something *handle)
@change_callback_handle_arg
depends on change_timer_function_usage &&
!match_callback_converted &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
@@

void _callback(
-_handletype *_handle
+struct timer_list *t
)
{
+ _handletype *_handle = from_timer(_handle, t, _timer);
...
}

// If change_callback_handle_arg ran on an empty function, remove
// the added handler.
@unchange_callback_handle_arg
depends on change_timer_function_usage &&
change_callback_handle_arg@
identifier change_timer_function_usage._callback;
identifier change_timer_function_usage._timer;
type _handletype;
identifier _handle;
identifier t;
@@

void _callback(struct timer_list *t)
{
- _handletype *_handle = from_timer(_handle, t, _timer);
}

// We only want to refactor the setup_timer() data argument if we've found
// the matching callback. This undoes changes in change_timer_function_usage.
@unchange_timer_function_usage
depends on change_timer_function_usage &&
!change_callback_handle_cast &&
!change_callback_handle_cast_no_arg &&
!change_callback_handle_arg@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type change_timer_function_usage._cast_data;
@@

(
-timer_setup(&_E->_timer, _callback, 0);
+setup_timer(&_E->_timer, _callback, (_cast_data)_E);
|
-timer_setup(&_E._timer, _callback, 0);
+setup_timer(&_E._timer, _callback, (_cast_data)&_E);
)

// If we fixed a callback from a .function assignment, fix the
// assignment cast now.
@change_timer_function_assignment
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression change_timer_function_usage._E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_func;
typedef TIMER_FUNC_TYPE;
@@

(
_E->_timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E->_timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-&_callback;
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)_callback
+(TIMER_FUNC_TYPE)_callback
;
|
_E._timer.function =
-(_cast_func)&_callback
+(TIMER_FUNC_TYPE)_callback
;
)

// Sometimes timer functions are called directly. Replace matched args.
@change_timer_function_calls
depends on change_timer_function_usage &&
(change_callback_handle_cast ||
change_callback_handle_cast_no_arg ||
change_callback_handle_arg)@
expression _E;
identifier change_timer_function_usage._timer;
identifier change_timer_function_usage._callback;
type _cast_data;
@@

_callback(
(
-(_cast_data)_E
+&_E->_timer
|
-(_cast_data)&_E
+&_E._timer
|
-_E
+&_E->_timer
)
)

// If a timer has been configured without a data argument, it can be
// converted without regard to the callback argument, since it is unused.
@match_timer_function_unused_data@
expression _E;
identifier _timer;
identifier _callback;
@@

(
-setup_timer(&_E->_timer, _callback, 0);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0L);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E->_timer, _callback, 0UL);
+timer_setup(&_E->_timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0L);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_E._timer, _callback, 0UL);
+timer_setup(&_E._timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0L);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(&_timer, _callback, 0UL);
+timer_setup(&_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0L);
+timer_setup(_timer, _callback, 0);
|
-setup_timer(_timer, _callback, 0UL);
+timer_setup(_timer, _callback, 0);
)

@change_callback_unused_data
depends on match_timer_function_unused_data@
identifier match_timer_function_unused_data._callback;
type _origtype;
identifier _origarg;
@@

void _callback(
-_origtype _origarg
+struct timer_list *unused
)
{
... when != _origarg
}

Signed-off-by: Kees Cook <keescook@chromium.org>

+824 -937
+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 -2
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 - setup_timer(&power_button_poll_timer, power_button_poll, 0UL); 339 + timer_setup(&power_button_poll_timer, power_button_poll, 0); 340 340 power_button_poll_timer.expires = jiffies + (HZ / 10); 341 341 add_timer(&power_button_poll_timer); 342 342 return 0;
+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 -2
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 - setup_timer(&ntimer, nmi_wdt_timer, 0UL); 183 + timer_setup(&ntimer, nmi_wdt_timer, 0); 184 184 ntimer.expires = jiffies + NMI_CHECK_TIMEOUT; 185 185 add_timer(&ntimer); 186 186
+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/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
+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 -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 -8
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 - setup_timer(&hose->err_timer, pcibios_enable_err, 110 - (unsigned long)hose); 109 + timer_setup(&hose->err_timer, pcibios_enable_err, 0); 111 110 } 112 111 113 112 if (hose->serr_irq) { 114 - setup_timer(&hose->serr_timer, pcibios_enable_serr, 115 - (unsigned long)hose); 113 + timer_setup(&hose->serr_timer, pcibios_enable_serr, 0); 116 114 } 117 115 } 118 116
+3 -3
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 - setup_timer(&psw->debounce, switch_timer, (unsigned long)psw); 81 + timer_setup(&psw->debounce, switch_timer, 0); 82 82 83 83 /* Workqueue API brain-damage */ 84 84 psw->pdev = pdev;
+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 -3
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 - setup_timer (&dev->timer, fs_poll, (unsigned long)dev); 1888 + timer_setup(&dev->timer, fs_poll, 0); 1889 1889 dev->timer.expires = jiffies + FS_POLL_FREQ; 1890 1890 add_timer (&dev->timer); 1891 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:
+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);
+3 -3
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 - setup_timer(&lanai->timer, lanai_timed_poll, (unsigned long)lanai); 1793 + timer_setup(&lanai->timer, lanai_timed_poll, 0); 1794 1794 lanai->timer.expires = jiffies + LANAI_POLL_PERIOD; 1795 1795 add_timer(&lanai->timer); 1796 1796 }
+3 -3
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 - setup_timer(&ns_timer, ns_poll, 0UL); 287 + timer_setup(&ns_timer, ns_poll, 0); 288 288 ns_timer.expires = jiffies + NS_POLL_PERIOD; 289 289 add_timer(&ns_timer); 290 290 } ··· 2679 2679 } 2680 2680 #endif /* EXTRA_DEBUG */ 2681 2681 2682 - static void ns_poll(unsigned long arg) 2682 + static void ns_poll(struct timer_list *unused) 2683 2683 { 2684 2684 int i; 2685 2685 ns_dev *card;
+4 -4
drivers/block/DAC960.c
··· 3079 3079 /* 3080 3080 Initialize the Monitoring Timer. 3081 3081 */ 3082 - setup_timer(&Controller->MonitoringTimer, 3083 - DAC960_MonitoringTimerFunction, (unsigned long)Controller); 3082 + timer_setup(&Controller->MonitoringTimer, 3083 + DAC960_MonitoringTimerFunction, 0); 3084 3084 Controller->MonitoringTimer.expires = 3085 3085 jiffies + DAC960_MonitoringTimerInterval; 3086 3086 add_timer(&Controller->MonitoringTimer); ··· 5619 5619 the status of DAC960 Controllers. 5620 5620 */ 5621 5621 5622 - static void DAC960_MonitoringTimerFunction(unsigned long TimerData) 5622 + static void DAC960_MonitoringTimerFunction(struct timer_list *t) 5623 5623 { 5624 - DAC960_Controller_T *Controller = (DAC960_Controller_T *) TimerData; 5624 + DAC960_Controller_T *Controller = from_timer(Controller, t, MonitoringTimer); 5625 5625 DAC960_Command_T *Command; 5626 5626 unsigned long flags; 5627 5627
+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 *);
+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
+2 -2
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 - setup_timer(&battery_timer, check_all_batteries, 0UL); 741 + timer_setup(&battery_timer, check_all_batteries, 0); 742 742 battery_timer.expires = jiffies + (HZ * 60); 743 743 add_timer(&battery_timer); 744 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
+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);
+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;
+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 -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 -2
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 - setup_timer(&dsi->te_timer, dsi_te_timeout, 0); 5452 + timer_setup(&dsi->te_timer, dsi_te_timeout, 0); 5453 5453 #endif 5454 5454 5455 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 -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 -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 /*
+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)
+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;
+2 -3
drivers/isdn/hardware/mISDN/hfcpci.c
··· 1241 1241 * timer callback for D-chan busy resolution. Currently no function 1242 1242 */ 1243 1243 static void 1244 - hfcpci_dbusy_timer(struct hfc_pci *hc) 1244 + hfcpci_dbusy_timer(struct timer_list *t) 1245 1245 { 1246 1246 } 1247 1247 ··· 1717 1717 inithfcpci(struct hfc_pci *hc) 1718 1718 { 1719 1719 printk(KERN_DEBUG "inithfcpci: entered\n"); 1720 - setup_timer(&hc->dch.timer, (void *)hfcpci_dbusy_timer, 1721 - (long)&hc->dch); 1720 + timer_setup(&hc->dch.timer, hfcpci_dbusy_timer, 0); 1722 1721 hc->chanlimit = 2; 1723 1722 mode_hfcpci(&hc->bch[0], 1, -1); 1724 1723 mode_hfcpci(&hc->bch[1], 2, -1);
+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 -2
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 - setup_timer(&dev->timer, isdn_timer_funct, 0UL); 2297 + timer_setup(&dev->timer, isdn_timer_funct, 0); 2298 2298 spin_lock_init(&dev->lock); 2299 2299 spin_lock_init(&dev->timerlock); 2300 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 - setup_timer(&lp->cisco_timer, 1619 - isdn_net_ciscohdlck_slarp_send_keepalive, 1620 - (unsigned long)lp); 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);
+3 -4
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 - setup_timer(&dev->watchdog_timer, s5p_mfc_watchdog, 1318 - (unsigned long)dev); 1317 + timer_setup(&dev->watchdog_timer, s5p_mfc_watchdog, 0); 1319 1318 1320 1319 ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev); 1321 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 -4
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 - setup_timer(&dev->bulk_timeout, au0828_bulk_timeout, 652 - (unsigned long)dev); 651 + timer_setup(&dev->bulk_timeout, au0828_bulk_timeout, 0); 653 652 654 653 return 0; 655 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);
+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)
+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;
+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);
+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;
+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)
+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 -3
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 - setup_timer(&sta->timer, ap_handle_timer, (unsigned long)sta); 1192 + timer_setup(&sta->timer, ap_handle_timer, 0); 1193 1193 sta->timer.expires = jiffies + ap->max_inactivity; 1194 1194 if (!ap->local->hostapd) 1195 1195 add_timer(&sta->timer);
+6 -8
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 - setup_timer(&local->passive_scan_timer, hostap_passive_scan, 3229 - (unsigned long)local); 3230 - setup_timer(&local->tick_timer, hostap_tick_timer, 3231 - (unsigned long)local); 3228 + timer_setup(&local->passive_scan_timer, hostap_passive_scan, 0); 3229 + timer_setup(&local->tick_timer, hostap_tick_timer, 0); 3232 3230 local->tick_timer.expires = jiffies + 2 * HZ; 3233 3231 add_timer(&local->tick_timer); 3234 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/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);
+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/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 - setup_timer(&priv->listen_timer, pn533_listen_mode_timer, 2636 - (unsigned long)priv); 2635 + timer_setup(&priv->listen_timer, pn533_listen_mode_timer, 0); 2637 2636 2638 2637 skb_queue_head_init(&priv->resp_q); 2639 2638 skb_queue_head_init(&priv->fragment_skb);
+6 -6
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 - setup_timer(&ndlc->t1_timer, ndlc_t1_timeout, (unsigned long)ndlc); 286 - setup_timer(&ndlc->t2_timer, ndlc_t2_timeout, (unsigned long)ndlc); 285 + timer_setup(&ndlc->t1_timer, ndlc_t1_timeout, 0); 286 + timer_setup(&ndlc->t2_timer, ndlc_t2_timeout, 0); 287 287 288 288 skb_queue_head_init(&ndlc->rcv_q); 289 289 skb_queue_head_init(&ndlc->send_q);
+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 -9
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 - setup_timer(&device->timer, dasd_device_timeout, 123 - (unsigned long)device); 122 + timer_setup(&device->timer, dasd_device_timeout, 0); 124 123 INIT_WORK(&device->kick_work, do_kick_device); 125 124 INIT_WORK(&device->restore_device, do_restore_device); 126 125 INIT_WORK(&device->reload_device, do_reload_device); ··· 161 162 (unsigned long) block); 162 163 INIT_LIST_HEAD(&block->ccw_queue); 163 164 spin_lock_init(&block->queue_lock); 164 - setup_timer(&block->timer, dasd_block_timeout, (unsigned long)block); 165 + timer_setup(&block->timer, dasd_block_timeout, 0); 165 166 spin_lock_init(&block->profile.lock); 166 167 167 168 return block; ··· 1556 1557 * The head of the ccw queue will have status DASD_CQR_IN_IO for 1), 1557 1558 * DASD_CQR_QUEUED for 2) and 3). 1558 1559 */ 1559 - static void dasd_device_timeout(unsigned long ptr) 1560 + static void dasd_device_timeout(struct timer_list *t) 1560 1561 { 1561 1562 unsigned long flags; 1562 1563 struct dasd_device *device; 1563 1564 1564 - device = (struct dasd_device *) ptr; 1565 + device = from_timer(device, t, timer); 1565 1566 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); 1566 1567 /* re-activate request queue */ 1567 1568 dasd_device_remove_stop_bits(device, DASD_STOPPED_PENDING); ··· 2624 2625 * is waiting for something that may not come reliably, (e.g. a state 2625 2626 * change interrupt) 2626 2627 */ 2627 - static void dasd_block_timeout(unsigned long ptr) 2628 + static void dasd_block_timeout(struct timer_list *t) 2628 2629 { 2629 2630 unsigned long flags; 2630 2631 struct dasd_block *block; 2631 2632 2632 - block = (struct dasd_block *) ptr; 2633 + block = from_timer(block, t, timer); 2633 2634 spin_lock_irqsave(get_ccwdev_lock(block->base->cdev), flags); 2634 2635 /* re-activate request queue */ 2635 2636 dasd_device_remove_stop_bits(block->base, DASD_STOPPED_PENDING);
+5 -4
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); ··· 147 146 printk(KERN_DEBUG "fsm(%s): Create timer %p\n", fi->name, 148 147 this); 149 148 #endif 150 - setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this); 149 + timer_setup(&this->tl, fsm_expire_timer, 0); 151 150 } 152 151 153 152 void ··· 169 168 this->fi->name, this, millisec); 170 169 #endif 171 170 172 - setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this); 171 + timer_setup(&this->tl, fsm_expire_timer, 0); 173 172 this->expire_event = event; 174 173 this->event_arg = arg; 175 174 this->tl.expires = jiffies + (millisec * HZ) / 1000; ··· 188 187 #endif 189 188 190 189 del_timer(&this->tl); 191 - setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this); 190 + timer_setup(&this->tl, fsm_expire_timer, 0); 192 191 this->expire_event = event; 193 192 this->event_arg = arg; 194 193 this->tl.expires = jiffies + (millisec * HZ) / 1000;
+5 -7
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 - setup_timer(&acb->eternal_timer, &arcmsr_request_device_map, 841 - (unsigned long)acb); 840 + timer_setup(&acb->eternal_timer, arcmsr_request_device_map, 0); 842 841 acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); 843 842 add_timer(&acb->eternal_timer); 844 843 if(arcmsr_alloc_sysfs_attr(acb)) ··· 928 929 atomic_set(&acb->rq_map_token, 16); 929 930 atomic_set(&acb->ante_token_value, 16); 930 931 acb->fw_flag = FW_NORMAL; 931 - setup_timer(&acb->eternal_timer, &arcmsr_request_device_map, 932 - (unsigned long)acb); 932 + timer_setup(&acb->eternal_timer, arcmsr_request_device_map, 0); 933 933 acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); 934 934 add_timer(&acb->eternal_timer); 935 935 return 0; ··· 3455 3457 } 3456 3458 } 3457 3459 3458 - static void arcmsr_request_device_map(unsigned long pacb) 3460 + static void arcmsr_request_device_map(struct timer_list *t) 3459 3461 { 3460 - struct AdapterControlBlock *acb = (struct AdapterControlBlock *)pacb; 3462 + struct AdapterControlBlock *acb = from_timer(acb, t, eternal_timer); 3461 3463 switch (acb->adapter_type) { 3462 3464 case ACB_ADAPTER_TYPE_A: { 3463 3465 arcmsr_hbaA_request_device_map(acb);
+3 -3
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 - setup_timer(&info->eh_timer, fas216_eh_timer, (unsigned long)info); 2852 + timer_setup(&info->eh_timer, fas216_eh_timer, 0); 2853 2853 2854 2854 spin_lock_init(&info->host_lock); 2855 2855
+3 -3
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 - setup_timer(&bfad->hal_tmo, bfad_bfa_tmo, (unsigned long)bfad); 722 + timer_setup(&bfad->hal_tmo, bfad_bfa_tmo, 0); 723 723 724 724 mod_timer(&bfad->hal_tmo, 725 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(
+4 -4
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 - setup_timer(&a->timer, esas2r_timer_callback, (unsigned long)a); 1638 + timer_setup(&a->timer, esas2r_timer_callback, 0); 1639 1639 1640 1640 a->timer.expires = jiffies + 1641 1641 msecs_to_jiffies(100); ··· 1643 1643 add_timer(&a->timer); 1644 1644 } 1645 1645 1646 - static void esas2r_timer_callback(unsigned long context) 1646 + static void esas2r_timer_callback(struct timer_list *t) 1647 1647 { 1648 - struct esas2r_adapter *a = (struct esas2r_adapter *)context; 1648 + struct esas2r_adapter *a = from_timer(a, t, timer); 1649 1649 1650 1650 set_bit(AF2_TIMER_TICK, &a->flags2); 1651 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++) {
+3 -3
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 - setup_timer(&np->timer, ncr53c8xx_timeout, (unsigned long)np); 8360 + timer_setup(&np->timer, ncr53c8xx_timeout, 0); 8361 8361 8362 8362 /* Try to map the controller chip to virtual and physical memory. */ 8363 8363
+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;
+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.
+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
··· 1044 1044 return 0; 1045 1045 } 1046 1046 1047 - static void tcmu_device_timedout(unsigned long data) 1047 + static void tcmu_device_timedout(struct timer_list *t) 1048 1048 { 1049 - struct tcmu_dev *udev = (struct tcmu_dev *)data; 1049 + struct tcmu_dev *udev = from_timer(udev, t, timeout); 1050 1050 unsigned long flags; 1051 1051 1052 1052 spin_lock_irqsave(&udev->commands_lock, flags); ··· 1106 1106 idr_init(&udev->commands); 1107 1107 spin_lock_init(&udev->commands_lock); 1108 1108 1109 - setup_timer(&udev->timeout, tcmu_device_timedout, 1110 - (unsigned long)udev); 1109 + timer_setup(&udev->timeout, tcmu_device_timedout, 0); 1111 1110 1112 1111 init_waitqueue_head(&udev->nl_cmd_wq); 1113 1112 spin_lock_init(&udev->nl_cmd_lock);
+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
+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/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
+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 -3
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 - setup_timer(&ep->timer, pio_out_timer, (unsigned long)ep); 2545 + timer_setup(&ep->timer, pio_out_timer, 0); 2546 2546 } 2547 2547 if (addr) 2548 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);
+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)) {
+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
+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");
+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()) -
+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);
+2 -2
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 - setup_timer(&watchdog_timer, clocksource_watchdog, 0UL); 293 + timer_setup(&watchdog_timer, clocksource_watchdog, 0); 294 294 watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL; 295 295 add_timer_on(&watchdog_timer, cpumask_first(cpu_online_mask)); 296 296 watchdog_running = 1;
+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
+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;
+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
+2 -2
net/decnet/dn_route.c
··· 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; ··· 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
+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 }
+3 -5
net/ncsi/ncsi-manage.c
··· 529 529 return NULL; 530 530 } 531 531 532 - static void ncsi_request_timeout(unsigned long data) 532 + static void ncsi_request_timeout(struct timer_list *t) 533 533 { 534 - struct ncsi_request *nr = (struct ncsi_request *)data; 534 + struct ncsi_request *nr = from_timer(nr, t, timer); 535 535 struct ncsi_dev_priv *ndp = nr->ndp; 536 536 unsigned long flags; 537 537 ··· 1577 1577 for (i = 0; i < ARRAY_SIZE(ndp->requests); i++) { 1578 1578 ndp->requests[i].id = i; 1579 1579 ndp->requests[i].ndp = ndp; 1580 - setup_timer(&ndp->requests[i].timer, 1581 - ncsi_request_timeout, 1582 - (unsigned long)&ndp->requests[i]); 1580 + timer_setup(&ndp->requests[i].timer, ncsi_request_timeout, 0); 1583 1581 } 1584 1582 1585 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
+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);
+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);
+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);
+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;
+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