Skip to content

Commit 24ed960

Browse files
committed
treewide: Switch DEFINE_TIMER callbacks to struct timer_list *
This changes all DEFINE_TIMER() callbacks to use a struct timer_list pointer instead of unsigned long. Since the data argument has already been removed, none of these callbacks are using their argument currently, so this renames the argument to "unused". Done using the following semantic patch: @match_define_timer@ declarer name DEFINE_TIMER; identifier _timer, _callback; @@ DEFINE_TIMER(_timer, _callback); @change_callback depends on match_define_timer@ identifier match_define_timer._callback; type _origtype; identifier _origarg; @@ void -_callback(_origtype _origarg) +_callback(struct timer_list *unused) { ... } Signed-off-by: Kees Cook <[email protected]>
1 parent 6cc73a0 commit 24ed960

File tree

39 files changed

+82
-82
lines changed

39 files changed

+82
-82
lines changed

arch/arm/mach-ixp4xx/dsmg600-setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ static int power_button_countdown;
179179
/* Must hold the button down for at least this many counts to be processed */
180180
#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
181181

182-
static void dsmg600_power_handler(unsigned long data);
182+
static void dsmg600_power_handler(struct timer_list *unused);
183183
static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler);
184184

185-
static void dsmg600_power_handler(unsigned long data)
185+
static void dsmg600_power_handler(struct timer_list *unused)
186186
{
187187
/* This routine is called twice per second to check the
188188
* state of the power button.

arch/arm/mach-ixp4xx/nas100d-setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ static int power_button_countdown;
202202
/* Must hold the button down for at least this many counts to be processed */
203203
#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
204204

205-
static void nas100d_power_handler(unsigned long data);
205+
static void nas100d_power_handler(struct timer_list *unused);
206206
static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler);
207207

208-
static void nas100d_power_handler(unsigned long data)
208+
static void nas100d_power_handler(struct timer_list *unused)
209209
{
210210
/* This routine is called twice per second to check the
211211
* state of the power button.

arch/m68k/amiga/amisound.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void __init amiga_init_sound(void)
6565
#endif
6666
}
6767

68-
static void nosound( unsigned long ignored );
68+
static void nosound(struct timer_list *unused);
6969
static DEFINE_TIMER(sound_timer, nosound);
7070

7171
void amiga_mksound( unsigned int hz, unsigned int ticks )
@@ -107,7 +107,7 @@ void amiga_mksound( unsigned int hz, unsigned int ticks )
107107
}
108108

109109

110-
static void nosound( unsigned long ignored )
110+
static void nosound(struct timer_list *unused)
111111
{
112112
/* turn off DMA for audio channel 2 */
113113
custom.dmacon = DMAF_AUD2;

arch/m68k/mac/macboing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static unsigned long mac_bell_phasepersample;
4848
* some function protos
4949
*/
5050
static void mac_init_asc( void );
51-
static void mac_nosound( unsigned long );
51+
static void mac_nosound(struct timer_list *);
5252
static void mac_quadra_start_bell( unsigned int, unsigned int, unsigned int );
5353
static void mac_quadra_ring_bell( unsigned long );
5454
static void mac_av_start_bell( unsigned int, unsigned int, unsigned int );
@@ -216,7 +216,7 @@ void mac_mksound( unsigned int freq, unsigned int length )
216216
/*
217217
* regular ASC: stop whining ..
218218
*/
219-
static void mac_nosound( unsigned long ignored )
219+
static void mac_nosound(struct timer_list *unused)
220220
{
221221
mac_asc_regs[ ASC_ENABLE ] = 0;
222222
}

arch/mips/mti-malta/malta-display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ void mips_display_message(const char *str)
3636
}
3737
}
3838

39-
static void scroll_display_message(unsigned long unused);
39+
static void scroll_display_message(struct timer_list *unused);
4040
static DEFINE_TIMER(mips_scroll_timer, scroll_display_message);
4141

42-
static void scroll_display_message(unsigned long unused)
42+
static void scroll_display_message(struct timer_list *unused)
4343
{
4444
mips_display_message(&display_string[display_count++]);
4545
if (display_count == max_display_count)

arch/parisc/kernel/pdc_cons.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static int pdc_console_setup(struct console *co, char *options)
9191

9292
#define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
9393

94-
static void pdc_console_poll(unsigned long unused);
94+
static void pdc_console_poll(struct timer_list *unused);
9595
static DEFINE_TIMER(pdc_console_timer, pdc_console_poll);
9696
static struct tty_port tty_port;
9797

@@ -135,7 +135,7 @@ static const struct tty_operations pdc_console_tty_ops = {
135135
.chars_in_buffer = pdc_console_tty_chars_in_buffer,
136136
};
137137

138-
static void pdc_console_poll(unsigned long unused)
138+
static void pdc_console_poll(struct timer_list *unused)
139139
{
140140
int data, count = 0;
141141

drivers/atm/idt77105.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ static DEFINE_SPINLOCK(idt77105_priv_lock);
4545
#define PUT(val,reg) dev->ops->phy_put(dev,val,IDT77105_##reg)
4646
#define GET(reg) dev->ops->phy_get(dev,IDT77105_##reg)
4747

48-
static void idt77105_stats_timer_func(unsigned long);
49-
static void idt77105_restart_timer_func(unsigned long);
48+
static void idt77105_stats_timer_func(struct timer_list *);
49+
static void idt77105_restart_timer_func(struct timer_list *);
5050

5151

5252
static DEFINE_TIMER(stats_timer, idt77105_stats_timer_func);
@@ -80,7 +80,7 @@ static u16 get_counter(struct atm_dev *dev, int counter)
8080
* a separate copy of the stats allows implementation of
8181
* an ioctl which gathers the stats *without* zero'ing them.
8282
*/
83-
static void idt77105_stats_timer_func(unsigned long dummy)
83+
static void idt77105_stats_timer_func(struct timer_list *unused)
8484
{
8585
struct idt77105_priv *walk;
8686
struct atm_dev *dev;
@@ -109,7 +109,7 @@ static void idt77105_stats_timer_func(unsigned long dummy)
109109
* interrupts need to be disabled when the cable is pulled out
110110
* to avoid lots of spurious cell error interrupts.
111111
*/
112-
static void idt77105_restart_timer_func(unsigned long dummy)
112+
static void idt77105_restart_timer_func(struct timer_list *unused)
113113
{
114114
struct idt77105_priv *walk;
115115
struct atm_dev *dev;

drivers/atm/iphase.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void desc_dbg(IADEV *iadev);
7575
static IADEV *ia_dev[8];
7676
static struct atm_dev *_ia_dev[8];
7777
static int iadev_count;
78-
static void ia_led_timer(unsigned long arg);
78+
static void ia_led_timer(struct timer_list *unused);
7979
static DEFINE_TIMER(ia_timer, ia_led_timer);
8080
static int IA_TX_BUF = DFL_TX_BUFFERS, IA_TX_BUF_SZ = DFL_TX_BUF_SZ;
8181
static int IA_RX_BUF = DFL_RX_BUFFERS, IA_RX_BUF_SZ = DFL_RX_BUF_SZ;
@@ -2432,7 +2432,7 @@ static void ia_update_stats(IADEV *iadev) {
24322432
return;
24332433
}
24342434

2435-
static void ia_led_timer(unsigned long arg) {
2435+
static void ia_led_timer(struct timer_list *unused) {
24362436
unsigned long flags;
24372437
static u_char blinking[8] = {0, 0, 0, 0, 0, 0, 0, 0};
24382438
u_char i;

drivers/block/ataflop.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ static int NeedSeek = 0;
342342
static void fd_select_side( int side );
343343
static void fd_select_drive( int drive );
344344
static void fd_deselect( void );
345-
static void fd_motor_off_timer( unsigned long dummy );
346-
static void check_change( unsigned long dummy );
345+
static void fd_motor_off_timer(struct timer_list *unused);
346+
static void check_change(struct timer_list *unused);
347347
static irqreturn_t floppy_irq (int irq, void *dummy);
348348
static void fd_error( void );
349349
static int do_format(int drive, int type, struct atari_format_descr *desc);
@@ -353,12 +353,12 @@ static void fd_calibrate_done( int status );
353353
static void fd_seek( void );
354354
static void fd_seek_done( int status );
355355
static void fd_rwsec( void );
356-
static void fd_readtrack_check( unsigned long dummy );
356+
static void fd_readtrack_check(struct timer_list *unused);
357357
static void fd_rwsec_done( int status );
358358
static void fd_rwsec_done1(int status);
359359
static void fd_writetrack( void );
360360
static void fd_writetrack_done( int status );
361-
static void fd_times_out( unsigned long dummy );
361+
static void fd_times_out(struct timer_list *unused);
362362
static void finish_fdc( void );
363363
static void finish_fdc_done( int dummy );
364364
static void setup_req_params( int drive );
@@ -479,7 +479,7 @@ static void fd_deselect( void )
479479
* counts the index signals, which arrive only if one drive is selected.
480480
*/
481481

482-
static void fd_motor_off_timer( unsigned long dummy )
482+
static void fd_motor_off_timer(struct timer_list *unused)
483483
{
484484
unsigned char status;
485485

@@ -515,7 +515,7 @@ static void fd_motor_off_timer( unsigned long dummy )
515515
* as possible) and keep track of the current state of the write protection.
516516
*/
517517

518-
static void check_change( unsigned long dummy )
518+
static void check_change(struct timer_list *unused)
519519
{
520520
static int drive = 0;
521521

@@ -966,7 +966,7 @@ static void fd_rwsec( void )
966966
}
967967

968968

969-
static void fd_readtrack_check( unsigned long dummy )
969+
static void fd_readtrack_check(struct timer_list *unused)
970970
{
971971
unsigned long flags, addr, addr2;
972972

@@ -1237,7 +1237,7 @@ static void fd_writetrack_done( int status )
12371237
fd_error();
12381238
}
12391239

1240-
static void fd_times_out( unsigned long dummy )
1240+
static void fd_times_out(struct timer_list *unused)
12411241
{
12421242
atari_disable_irq( IRQ_MFP_FDC );
12431243
if (!FloppyIRQHandler) goto end; /* int occurred after timer was fired, but

drivers/char/dtlk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
#endif /* TRACING */
7575

7676
static DEFINE_MUTEX(dtlk_mutex);
77-
static void dtlk_timer_tick(unsigned long data);
77+
static void dtlk_timer_tick(struct timer_list *unused);
7878

7979
static int dtlk_major;
8080
static int dtlk_port_lpc;
@@ -259,7 +259,7 @@ static unsigned int dtlk_poll(struct file *file, poll_table * wait)
259259
return mask;
260260
}
261261

262-
static void dtlk_timer_tick(unsigned long data)
262+
static void dtlk_timer_tick(struct timer_list *unused)
263263
{
264264
TRACE_TEXT(" dtlk_timer_tick");
265265
wake_up_interruptible(&dtlk_process_list);

drivers/char/hangcheck-timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ __setup("hcheck_dump_tasks", hangcheck_parse_dump_tasks);
122122
/* Last time scheduled */
123123
static unsigned long long hangcheck_tsc, hangcheck_tsc_margin;
124124

125-
static void hangcheck_fire(unsigned long);
125+
static void hangcheck_fire(struct timer_list *);
126126

127127
static DEFINE_TIMER(hangcheck_ticktock, hangcheck_fire);
128128

129-
static void hangcheck_fire(unsigned long data)
129+
static void hangcheck_fire(struct timer_list *unused)
130130
{
131131
unsigned long long cur_tsc, tsc_diff;
132132

drivers/char/nwbutton.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define __NWBUTTON_C /* Tell the header file who we are */
2424
#include "nwbutton.h"
2525

26-
static void button_sequence_finished (unsigned long parameters);
26+
static void button_sequence_finished(struct timer_list *unused);
2727

2828
static int button_press_count; /* The count of button presses */
2929
/* Times for the end of a sequence */
@@ -127,7 +127,7 @@ static void button_consume_callbacks (int bpcount)
127127
* any matching registered function callbacks, initiate reboot, etc.).
128128
*/
129129

130-
static void button_sequence_finished (unsigned long parameters)
130+
static void button_sequence_finished(struct timer_list *unused)
131131
{
132132
if (IS_ENABLED(CONFIG_NWBUTTON_REBOOT) &&
133133
button_press_count == reboot_count)

drivers/char/nwbutton.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct button_callback {
2525

2626
/* Function prototypes: */
2727

28-
static void button_sequence_finished (unsigned long parameters);
28+
static void button_sequence_finished(struct timer_list *unused);
2929
static irqreturn_t button_handler (int irq, void *dev_id);
3030
int button_init (void);
3131
int button_add_callback (void (*callback) (void), int count);

drivers/char/rtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static struct fasync_struct *rtc_async_queue;
135135
static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
136136

137137
#ifdef RTC_IRQ
138-
static void rtc_dropped_irq(unsigned long data);
138+
static void rtc_dropped_irq(struct timer_list *unused);
139139

140140
static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq);
141141
#endif
@@ -1171,7 +1171,7 @@ module_exit(rtc_exit);
11711171
* for something that requires a steady > 1KHz signal anyways.)
11721172
*/
11731173

1174-
static void rtc_dropped_irq(unsigned long data)
1174+
static void rtc_dropped_irq(struct timer_list *unused)
11751175
{
11761176
unsigned long freq;
11771177

drivers/input/touchscreen/s3c2410_ts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static inline bool get_down(unsigned long data0, unsigned long data1)
102102
!(data1 & S3C2410_ADCDAT0_UPDOWN));
103103
}
104104

105-
static void touch_timer_fire(unsigned long data)
105+
static void touch_timer_fire(struct timer_list *unused)
106106
{
107107
unsigned long data0;
108108
unsigned long data1;

drivers/net/wireless/atmel/at76c50x-usb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,11 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
518518

519519
/* LED trigger */
520520
static int tx_activity;
521-
static void at76_ledtrig_tx_timerfunc(unsigned long data);
521+
static void at76_ledtrig_tx_timerfunc(struct timer_list *unused);
522522
static DEFINE_TIMER(ledtrig_tx_timer, at76_ledtrig_tx_timerfunc);
523523
DEFINE_LED_TRIGGER(ledtrig_tx);
524524

525-
static void at76_ledtrig_tx_timerfunc(unsigned long data)
525+
static void at76_ledtrig_tx_timerfunc(struct timer_list *unused)
526526
{
527527
static int tx_lastactivity;
528528

drivers/staging/speakup/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ static void spkup_write(const u16 *in_buf, int count)
11641164
static const int NUM_CTL_LABELS = (MSG_CTL_END - MSG_CTL_START + 1);
11651165

11661166
static void read_all_doc(struct vc_data *vc);
1167-
static void cursor_done(u_long data);
1167+
static void cursor_done(struct timer_list *unused);
11681168
static DEFINE_TIMER(cursor_timer, cursor_done);
11691169

11701170
static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag)
@@ -1682,7 +1682,7 @@ static int speak_highlight(struct vc_data *vc)
16821682
return 0;
16831683
}
16841684

1685-
static void cursor_done(u_long data)
1685+
static void cursor_done(struct timer_list *unused)
16861686
{
16871687
struct vc_data *vc = vc_cons[cursor_con].d;
16881688
unsigned long flags;

drivers/staging/speakup/synth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ int spk_synth_is_alive_restart(struct spk_synth *synth)
153153
}
154154
EXPORT_SYMBOL_GPL(spk_synth_is_alive_restart);
155155

156-
static void thread_wake_up(u_long data)
156+
static void thread_wake_up(struct timer_list *unused)
157157
{
158158
wake_up_interruptible_all(&speakup_event);
159159
}

drivers/tty/cyclades.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static unsigned detect_isa_irq(void __iomem *);
279279
#endif /* CONFIG_ISA */
280280

281281
#ifndef CONFIG_CYZ_INTR
282-
static void cyz_poll(unsigned long);
282+
static void cyz_poll(struct timer_list *);
283283

284284
/* The Cyclades-Z polling cycle is defined by this variable */
285285
static long cyz_polling_cycle = CZ_DEF_POLL;
@@ -1214,7 +1214,7 @@ static void cyz_rx_restart(struct timer_list *t)
12141214

12151215
#else /* CONFIG_CYZ_INTR */
12161216

1217-
static void cyz_poll(unsigned long arg)
1217+
static void cyz_poll(struct timer_list *unused)
12181218
{
12191219
struct cyclades_card *cinfo;
12201220
struct cyclades_port *info;

drivers/tty/isicom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static struct pci_driver isicom_driver = {
170170
static int prev_card = 3; /* start servicing isi_card[0] */
171171
static struct tty_driver *isicom_normal;
172172

173-
static void isicom_tx(unsigned long _data);
173+
static void isicom_tx(struct timer_list *unused);
174174
static void isicom_start(struct tty_struct *tty);
175175

176176
static DEFINE_TIMER(tx, isicom_tx);
@@ -394,7 +394,7 @@ static inline int __isicom_paranoia_check(struct isi_port const *port,
394394
* will do the rest of the work for us.
395395
*/
396396

397-
static void isicom_tx(unsigned long _data)
397+
static void isicom_tx(struct timer_list *unused)
398398
{
399399
unsigned long flags, base;
400400
unsigned int retries;

drivers/tty/moxa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void moxa_hangup(struct tty_struct *);
198198
static int moxa_tiocmget(struct tty_struct *tty);
199199
static int moxa_tiocmset(struct tty_struct *tty,
200200
unsigned int set, unsigned int clear);
201-
static void moxa_poll(unsigned long);
201+
static void moxa_poll(struct timer_list *);
202202
static void moxa_set_tty_param(struct tty_struct *, struct ktermios *);
203203
static void moxa_shutdown(struct tty_port *);
204204
static int moxa_carrier_raised(struct tty_port *);
@@ -1429,7 +1429,7 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
14291429
return 0;
14301430
}
14311431

1432-
static void moxa_poll(unsigned long ignored)
1432+
static void moxa_poll(struct timer_list *unused)
14331433
{
14341434
struct moxa_board_conf *brd;
14351435
u16 __iomem *ip;

0 commit comments

Comments
 (0)