Skip to content

Commit 844056f

Browse files
committed
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: - The final conversion of timer wheel timers to timer_setup(). A few manual conversions and a large coccinelle assisted sweep and the removal of the old initialization mechanisms and the related code. - Remove the now unused VSYSCALL update code - Fix permissions of /proc/timer_list. I still need to get rid of that file completely - Rename a misnomed clocksource function and remove a stale declaration * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits) m68k/macboing: Fix missed timer callback assignment treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts timer: Remove redundant __setup_timer*() macros timer: Pass function down to initialization routines timer: Remove unused data arguments from macros timer: Switch callback prototype to take struct timer_list * argument timer: Pass timer_list pointer to callbacks unconditionally Coccinelle: Remove setup_timer.cocci timer: Remove setup_*timer() interface timer: Remove init_timer() interface treewide: setup_timer() -> timer_setup() (2 field) treewide: setup_timer() -> timer_setup() treewide: init_timer() -> setup_timer() treewide: Switch DEFINE_TIMER callbacks to struct timer_list * s390: cmm: Convert timers to use timer_setup() lightnvm: Convert timers to use timer_setup() drivers/net: cris: Convert timers to use timer_setup() drm/vc4: Convert timers to use timer_setup() block/laptop_mode: Convert timers to use timer_setup() net/atm/mpc: Avoid open-coded assignment of timer callback function ...
2 parents ca122fe + 54b8a23 commit 844056f

File tree

351 files changed

+1225
-1773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

351 files changed

+1225
-1773
lines changed

Documentation/core-api/local_ops.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,14 @@ Here is a sample module which implements a basic per cpu counter using
177177
printk("Read : CPU %d, count %ld\n", cpu,
178178
local_read(&per_cpu(counters, cpu)));
179179
}
180-
del_timer(&test_timer);
181-
test_timer.expires = jiffies + 1000;
182-
add_timer(&test_timer);
180+
mod_timer(&test_timer, jiffies + 1000);
183181
}
184182

185183
static int __init test_init(void)
186184
{
187185
/* initialize the timer that will increment the counter */
188-
init_timer(&test_timer);
189-
test_timer.function = do_test_timer;
190-
test_timer.expires = jiffies + 1;
191-
add_timer(&test_timer);
186+
timer_setup(&test_timer, do_test_timer, 0);
187+
mod_timer(&test_timer, jiffies + 1);
192188

193189
return 0;
194190
}

arch/alpha/kernel/srmcons.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ srmcons_do_receive_chars(struct tty_port *port)
6565
}
6666

6767
static void
68-
srmcons_receive_chars(unsigned long data)
68+
srmcons_receive_chars(struct timer_list *t)
6969
{
70-
struct srmcons_private *srmconsp = (struct srmcons_private *)data;
70+
struct srmcons_private *srmconsp = from_timer(srmconsp, t, timer);
7171
struct tty_port *port = &srmconsp->port;
7272
unsigned long flags;
7373
int incr = 10;
@@ -206,8 +206,7 @@ static const struct tty_operations srmcons_ops = {
206206
static int __init
207207
srmcons_init(void)
208208
{
209-
setup_timer(&srmcons_singleton.timer, srmcons_receive_chars,
210-
(unsigned long)&srmcons_singleton);
209+
timer_setup(&srmcons_singleton.timer, srmcons_receive_chars, 0);
211210
if (srm_is_registered_console) {
212211
struct tty_driver *driver;
213212
int err;

arch/arm/mach-iop32x/n2100.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static void n2100_restart(enum reboot_mode mode, const char *cmd)
305305

306306
static struct timer_list power_button_poll_timer;
307307

308-
static void power_button_poll(unsigned long dummy)
308+
static void power_button_poll(struct timer_list *unused)
309309
{
310310
if (gpio_get_value(N2100_POWER_BUTTON) == 0) {
311311
ctrl_alt_del();
@@ -336,8 +336,7 @@ static int __init n2100_request_gpios(void)
336336
pr_err("could not set power GPIO as input\n");
337337
}
338338
/* Set up power button poll timer */
339-
init_timer(&power_button_poll_timer);
340-
power_button_poll_timer.function = power_button_poll;
339+
timer_setup(&power_button_poll_timer, power_button_poll, 0);
341340
power_button_poll_timer.expires = jiffies + (HZ / 10);
342341
add_timer(&power_button_poll_timer);
343342
return 0;

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/arm/mach-orion5x/db88f5281-setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static struct platform_device db88f5281_nand_flash = {
172172
static void __iomem *db88f5281_7seg;
173173
static struct timer_list db88f5281_timer;
174174

175-
static void db88f5281_7seg_event(unsigned long data)
175+
static void db88f5281_7seg_event(struct timer_list *unused)
176176
{
177177
static int count = 0;
178178
writel(0, db88f5281_7seg + (count << 4));
@@ -189,7 +189,7 @@ static int __init db88f5281_7seg_init(void)
189189
printk(KERN_ERR "Failed to ioremap db88f5281_7seg\n");
190190
return -EIO;
191191
}
192-
setup_timer(&db88f5281_timer, db88f5281_7seg_event, 0);
192+
timer_setup(&db88f5281_timer, db88f5281_7seg_event, 0);
193193
mod_timer(&db88f5281_timer, jiffies + 2 * HZ);
194194
}
195195

arch/blackfin/kernel/nmi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int check_nmi_wdt_touched(void)
166166
return 1;
167167
}
168168

169-
static void nmi_wdt_timer(unsigned long data)
169+
static void nmi_wdt_timer(struct timer_list *unused)
170170
{
171171
if (check_nmi_wdt_touched())
172172
nmi_wdt_keepalive();
@@ -180,8 +180,7 @@ static int __init init_nmi_wdt(void)
180180
nmi_wdt_start();
181181
nmi_active = true;
182182

183-
init_timer(&ntimer);
184-
ntimer.function = nmi_wdt_timer;
183+
timer_setup(&ntimer, nmi_wdt_timer, 0);
185184
ntimer.expires = jiffies + NMI_CHECK_TIMEOUT;
186185
add_timer(&ntimer);
187186

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ 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 );
53-
static void mac_quadra_ring_bell( unsigned long );
53+
static void mac_quadra_ring_bell(struct timer_list *);
5454
static void mac_av_start_bell( unsigned int, unsigned int, unsigned int );
5555
static void ( *mac_special_bell )( unsigned int, unsigned int, unsigned int );
5656

@@ -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
}
@@ -270,7 +270,7 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig
270270
* already load the wave table, or at least call this one...
271271
* This piece keeps reloading the wave table until done.
272272
*/
273-
static void mac_quadra_ring_bell( unsigned long ignored )
273+
static void mac_quadra_ring_bell(struct timer_list *unused)
274274
{
275275
int i, count = mac_asc_samplespersec / HZ;
276276
unsigned long flags;

arch/mips/lasat/picvue_proc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static const struct file_operations pvc_scroll_proc_fops = {
156156
.write = pvc_scroll_proc_write,
157157
};
158158

159-
void pvc_proc_timerfunc(unsigned long data)
159+
void pvc_proc_timerfunc(struct timer_list *unused)
160160
{
161161
if (scroll_dir < 0)
162162
pvc_move(DISPLAY|RIGHT);
@@ -197,7 +197,7 @@ static int __init pvc_proc_init(void)
197197
if (proc_entry == NULL)
198198
goto error;
199199

200-
setup_timer(&timer, pvc_proc_timerfunc, 0UL);
200+
timer_setup(&timer, pvc_proc_timerfunc, 0);
201201

202202
return 0;
203203
error:

0 commit comments

Comments
 (0)