Skip to content

Commit 1c10bbe

Browse files
committed
Merge tag 'timers-conversion-next4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into timers/core
Pull the 4th timer conversion batch from Kees Cook - A couple fixes for less common build configurations - More stragglers that have either been reviewed or gone long enough on list
2 parents c7c2f3d + 5ea2208 commit 1c10bbe

File tree

16 files changed

+47
-78
lines changed

16 files changed

+47
-78
lines changed

arch/arm/mach-footbridge/dc21285.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void dc21285_enable_error(struct timer_list *timer)
141141
del_timer(timer);
142142

143143
if (timer == &serr_timer)
144-
enable_irq(IRQ_PCI_SERR)
144+
enable_irq(IRQ_PCI_SERR);
145145
else if (timer == &perr_timer)
146146
enable_irq(IRQ_PCI_PERR);
147147
}

drivers/block/aoe/aoemain.c

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,19 @@ MODULE_AUTHOR("Sam Hopkins <sah@coraid.com>");
1515
MODULE_DESCRIPTION("AoE block/char driver for 2.6.2 and newer 2.6 kernels");
1616
MODULE_VERSION(VERSION);
1717

18-
enum { TINIT, TRUN, TKILL };
18+
static struct timer_list timer;
1919

20-
static void
21-
discover_timer(ulong vp)
20+
static void discover_timer(struct timer_list *t)
2221
{
23-
static struct timer_list t;
24-
static volatile ulong die;
25-
static spinlock_t lock;
26-
ulong flags;
27-
enum { DTIMERTICK = HZ * 60 }; /* one minute */
28-
29-
switch (vp) {
30-
case TINIT:
31-
init_timer(&t);
32-
spin_lock_init(&lock);
33-
t.data = TRUN;
34-
t.function = discover_timer;
35-
die = 0;
36-
case TRUN:
37-
spin_lock_irqsave(&lock, flags);
38-
if (!die) {
39-
t.expires = jiffies + DTIMERTICK;
40-
add_timer(&t);
41-
}
42-
spin_unlock_irqrestore(&lock, flags);
43-
44-
aoecmd_cfg(0xffff, 0xff);
45-
return;
46-
case TKILL:
47-
spin_lock_irqsave(&lock, flags);
48-
die = 1;
49-
spin_unlock_irqrestore(&lock, flags);
22+
mod_timer(t, jiffies + HZ * 60); /* one minute */
5023

51-
del_timer_sync(&t);
52-
default:
53-
return;
54-
}
24+
aoecmd_cfg(0xffff, 0xff);
5525
}
5626

5727
static void
5828
aoe_exit(void)
5929
{
60-
discover_timer(TKILL);
30+
del_timer_sync(&timer);
6131

6232
aoenet_exit();
6333
unregister_blkdev(AOE_MAJOR, DEVICE_NAME);
@@ -93,7 +63,9 @@ aoe_init(void)
9363
goto blkreg_fail;
9464
}
9565
printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION);
96-
discover_timer(TINIT);
66+
67+
timer_setup(&timer, discover_timer, 0);
68+
discover_timer(&timer);
9769
return 0;
9870
blkreg_fail:
9971
aoecmd_exit();

drivers/block/drbd/drbd_int.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,8 @@ extern int w_restart_disk_io(struct drbd_work *, int);
15511551
extern int w_send_out_of_sync(struct drbd_work *, int);
15521552
extern int w_start_resync(struct drbd_work *, int);
15531553

1554-
extern void resync_timer_fn(unsigned long data);
1555-
extern void start_resync_timer_fn(unsigned long data);
1554+
extern void resync_timer_fn(struct timer_list *t);
1555+
extern void start_resync_timer_fn(struct timer_list *t);
15561556

15571557
extern void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req);
15581558

drivers/block/drbd/drbd_main.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
static DEFINE_MUTEX(drbd_main_mutex);
6565
static int drbd_open(struct block_device *bdev, fmode_t mode);
6666
static void drbd_release(struct gendisk *gd, fmode_t mode);
67-
static void md_sync_timer_fn(unsigned long data);
67+
static void md_sync_timer_fn(struct timer_list *t);
6868
static int w_bitmap_io(struct drbd_work *w, int unused);
6969

7070
MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, "
@@ -2023,14 +2023,10 @@ void drbd_init_set_defaults(struct drbd_device *device)
20232023
device->unplug_work.cb = w_send_write_hint;
20242024
device->bm_io_work.w.cb = w_bitmap_io;
20252025

2026-
setup_timer(&device->resync_timer, resync_timer_fn,
2027-
(unsigned long)device);
2028-
setup_timer(&device->md_sync_timer, md_sync_timer_fn,
2029-
(unsigned long)device);
2030-
setup_timer(&device->start_resync_timer, start_resync_timer_fn,
2031-
(unsigned long)device);
2032-
setup_timer(&device->request_timer, request_timer_fn,
2033-
(unsigned long)device);
2026+
timer_setup(&device->resync_timer, resync_timer_fn, 0);
2027+
timer_setup(&device->md_sync_timer, md_sync_timer_fn, 0);
2028+
timer_setup(&device->start_resync_timer, start_resync_timer_fn, 0);
2029+
timer_setup(&device->request_timer, request_timer_fn, 0);
20342030

20352031
init_waitqueue_head(&device->misc_wait);
20362032
init_waitqueue_head(&device->state_wait);
@@ -3721,9 +3717,9 @@ int drbd_md_test_flag(struct drbd_backing_dev *bdev, int flag)
37213717
return (bdev->md.flags & flag) != 0;
37223718
}
37233719

3724-
static void md_sync_timer_fn(unsigned long data)
3720+
static void md_sync_timer_fn(struct timer_list *t)
37253721
{
3726-
struct drbd_device *device = (struct drbd_device *) data;
3722+
struct drbd_device *device = from_timer(device, t, md_sync_timer);
37273723
drbd_device_post_work(device, MD_SYNC);
37283724
}
37293725

drivers/block/drbd/drbd_receiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5056,7 +5056,7 @@ static int drbd_disconnected(struct drbd_peer_device *peer_device)
50565056
wake_up(&device->misc_wait);
50575057

50585058
del_timer_sync(&device->resync_timer);
5059-
resync_timer_fn((unsigned long)device);
5059+
resync_timer_fn(&device->resync_timer);
50605060

50615061
/* wait for all w_e_end_data_req, w_e_end_rsdata_req, w_send_barrier,
50625062
* w_make_resync_request etc. which may still be on the worker queue

drivers/block/drbd/drbd_req.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,9 +1714,9 @@ static bool net_timeout_reached(struct drbd_request *net_req,
17141714
* to expire twice (worst case) to become effective. Good enough.
17151715
*/
17161716

1717-
void request_timer_fn(unsigned long data)
1717+
void request_timer_fn(struct timer_list *t)
17181718
{
1719-
struct drbd_device *device = (struct drbd_device *) data;
1719+
struct drbd_device *device = from_timer(device, t, request_timer);
17201720
struct drbd_connection *connection = first_peer_device(device)->connection;
17211721
struct drbd_request *req_read, *req_write, *req_peer; /* oldest request */
17221722
struct net_conf *nc;

drivers/block/drbd/drbd_req.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ extern int __req_mod(struct drbd_request *req, enum drbd_req_event what,
294294
struct bio_and_error *m);
295295
extern void complete_master_bio(struct drbd_device *device,
296296
struct bio_and_error *m);
297-
extern void request_timer_fn(unsigned long data);
297+
extern void request_timer_fn(struct timer_list *t);
298298
extern void tl_restart(struct drbd_connection *connection, enum drbd_req_event what);
299299
extern void _tl_restart(struct drbd_connection *connection, enum drbd_req_event what);
300300
extern void tl_abort_disk_io(struct drbd_device *device);

drivers/block/drbd/drbd_worker.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ int w_resync_timer(struct drbd_work *w, int cancel)
457457
return 0;
458458
}
459459

460-
void resync_timer_fn(unsigned long data)
460+
void resync_timer_fn(struct timer_list *t)
461461
{
462-
struct drbd_device *device = (struct drbd_device *) data;
462+
struct drbd_device *device = from_timer(device, t, resync_timer);
463463

464464
drbd_queue_work_if_unqueued(
465465
&first_peer_device(device)->connection->sender_work,
@@ -1705,9 +1705,9 @@ void drbd_rs_controller_reset(struct drbd_device *device)
17051705
rcu_read_unlock();
17061706
}
17071707

1708-
void start_resync_timer_fn(unsigned long data)
1708+
void start_resync_timer_fn(struct timer_list *t)
17091709
{
1710-
struct drbd_device *device = (struct drbd_device *) data;
1710+
struct drbd_device *device = from_timer(device, t, start_resync_timer);
17111711
drbd_device_post_work(device, RS_START);
17121712
}
17131713

drivers/crypto/axis/artpec6_crypto.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,9 +2074,9 @@ static void artpec6_crypto_process_queue(struct artpec6_crypto *ac)
20742074
del_timer(&ac->timer);
20752075
}
20762076

2077-
static void artpec6_crypto_timeout(unsigned long data)
2077+
static void artpec6_crypto_timeout(struct timer_list *t)
20782078
{
2079-
struct artpec6_crypto *ac = (struct artpec6_crypto *) data;
2079+
struct artpec6_crypto *ac = from_timer(ac, t, timer);
20802080

20812081
dev_info_ratelimited(artpec6_crypto_dev, "timeout\n");
20822082

@@ -3063,7 +3063,7 @@ static int artpec6_crypto_probe(struct platform_device *pdev)
30633063
spin_lock_init(&ac->queue_lock);
30643064
INIT_LIST_HEAD(&ac->queue);
30653065
INIT_LIST_HEAD(&ac->pending);
3066-
setup_timer(&ac->timer, artpec6_crypto_timeout, (unsigned long) ac);
3066+
timer_setup(&ac->timer, artpec6_crypto_timeout, 0);
30673067

30683068
ac->base = base;
30693069

drivers/crypto/mv_cesa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ struct mv_req_hash_ctx {
149149
int count_add;
150150
};
151151

152-
static void mv_completion_timer_callback(unsigned long unused)
152+
static void mv_completion_timer_callback(struct timer_list *unused)
153153
{
154154
int active = readl(cpg->reg + SEC_ACCEL_CMD) & SEC_CMD_EN_SEC_ACCL0;
155155

@@ -167,7 +167,7 @@ static void mv_completion_timer_callback(unsigned long unused)
167167

168168
static void mv_setup_timer(void)
169169
{
170-
setup_timer(&cpg->completion_timer, &mv_completion_timer_callback, 0);
170+
timer_setup(&cpg->completion_timer, mv_completion_timer_callback, 0);
171171
mod_timer(&cpg->completion_timer,
172172
jiffies + msecs_to_jiffies(MV_CESA_EXPIRE));
173173
}

drivers/crypto/picoxcell_crypto.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,9 @@ static irqreturn_t spacc_spacc_irq(int irq, void *dev)
11251125
return IRQ_HANDLED;
11261126
}
11271127

1128-
static void spacc_packet_timeout(unsigned long data)
1128+
static void spacc_packet_timeout(struct timer_list *t)
11291129
{
1130-
struct spacc_engine *engine = (struct spacc_engine *)data;
1130+
struct spacc_engine *engine = from_timer(engine, t, packet_timeout);
11311131

11321132
spacc_process_done(engine);
11331133
}
@@ -1714,8 +1714,7 @@ static int spacc_probe(struct platform_device *pdev)
17141714
writel(SPA_IRQ_EN_STAT_EN | SPA_IRQ_EN_GLBL_EN,
17151715
engine->regs + SPA_IRQ_EN_REG_OFFSET);
17161716

1717-
setup_timer(&engine->packet_timeout, spacc_packet_timeout,
1718-
(unsigned long)engine);
1717+
timer_setup(&engine->packet_timeout, spacc_packet_timeout, 0);
17191718

17201719
INIT_LIST_HEAD(&engine->pending);
17211720
INIT_LIST_HEAD(&engine->completed);

drivers/ide/ide-io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,9 @@ static int drive_is_ready(ide_drive_t *drive)
611611
* logic that wants cleaning up.
612612
*/
613613

614-
void ide_timer_expiry (unsigned long data)
614+
void ide_timer_expiry (struct timer_list *t)
615615
{
616-
ide_hwif_t *hwif = (ide_hwif_t *)data;
616+
ide_hwif_t *hwif = from_timer(hwif, t, timer);
617617
ide_drive_t *uninitialized_var(drive);
618618
ide_handler_t *handler;
619619
unsigned long flags;

drivers/ide/ide-probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ static void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
11841184

11851185
spin_lock_init(&hwif->lock);
11861186

1187-
setup_timer(&hwif->timer, &ide_timer_expiry, (unsigned long)hwif);
1187+
timer_setup(&hwif->timer, ide_timer_expiry, 0);
11881188

11891189
init_completion(&hwif->gendev_rel_comp);
11901190

drivers/mailbox/mailbox-altera.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct altera_mbox {
5757

5858
/* If the controller supports only RX polling mode */
5959
struct timer_list rxpoll_timer;
60+
struct mbox_chan *chan;
6061
};
6162

6263
static struct altera_mbox *mbox_chan_to_altera_mbox(struct mbox_chan *chan)
@@ -138,12 +139,11 @@ static void altera_mbox_rx_data(struct mbox_chan *chan)
138139
}
139140
}
140141

141-
static void altera_mbox_poll_rx(unsigned long data)
142+
static void altera_mbox_poll_rx(struct timer_list *t)
142143
{
143-
struct mbox_chan *chan = (struct mbox_chan *)data;
144-
struct altera_mbox *mbox = mbox_chan_to_altera_mbox(chan);
144+
struct altera_mbox *mbox = from_timer(mbox, t, rxpoll_timer);
145145

146-
altera_mbox_rx_data(chan);
146+
altera_mbox_rx_data(mbox->chan);
147147

148148
mod_timer(&mbox->rxpoll_timer,
149149
jiffies + msecs_to_jiffies(MBOX_POLLING_MS));
@@ -206,8 +206,8 @@ static int altera_mbox_startup_receiver(struct mbox_chan *chan)
206206

207207
polling:
208208
/* Setup polling timer */
209-
setup_timer(&mbox->rxpoll_timer, altera_mbox_poll_rx,
210-
(unsigned long)chan);
209+
mbox->chan = chan;
210+
timer_setup(&mbox->rxpoll_timer, altera_mbox_poll_rx, 0);
211211
mod_timer(&mbox->rxpoll_timer,
212212
jiffies + msecs_to_jiffies(MBOX_POLLING_MS));
213213

drivers/pcmcia/omap_cf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ static void omap_cf_timer(struct timer_list *t)
102102
*/
103103
static irqreturn_t omap_cf_irq(int irq, void *_cf)
104104
{
105-
omap_cf_timer(&_cf->timer);
105+
struct omap_cf_socket *cf = (struct omap_cf_socket *)_cf;
106+
107+
omap_cf_timer(&cf->timer);
106108
return IRQ_HANDLED;
107109
}
108110

include/linux/ide.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout);
12111211

12121212
extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
12131213

1214-
extern void ide_timer_expiry(unsigned long);
1214+
extern void ide_timer_expiry(struct timer_list *t);
12151215
extern irqreturn_t ide_intr(int irq, void *dev_id);
12161216
extern void do_ide_request(struct request_queue *);
12171217
extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq);

0 commit comments

Comments
 (0)