Skip to content

Commit b9eaf18

Browse files
committed
treewide: init_timer() -> setup_timer()
This mechanically converts all remaining cases of ancient open-coded timer setup with the old setup_timer() API, which is the first step in timer conversions. This has no behavioral changes, since it ultimately just changes the order of assignment to fields of struct timer_list when finding variations of: init_timer(&t); f.function = timer_callback; t.data = timer_callback_arg; to be converted into: setup_timer(&t, timer_callback, timer_callback_arg); The conversion is done with the following Coccinelle script, which is an improved version of scripts/cocci/api/setup_timer.cocci, in the following ways: - assignments-before-init_timer() cases - limit the .data case removal to the specific struct timer_list instance - handling calls by dereference (timer->field vs timer.field) 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/setup_timer.cocci @fix_address_of@ expression e; @@ init_timer( -&(e) +&e , ...) // Match the common cases first to avoid Coccinelle parsing loops with // "... when" clauses. @match_immediate_function_data_after_init_timer@ expression e, func, da; @@ -init_timer +setup_timer ( \(&e\|e\) +, func, da ); ( -\(e.function\|e->function\) = func; -\(e.data\|e->data\) = da; | -\(e.data\|e->data\) = da; -\(e.function\|e->function\) = func; ) @match_immediate_function_data_before_init_timer@ expression e, func, da; @@ ( -\(e.function\|e->function\) = func; -\(e.data\|e->data\) = da; | -\(e.data\|e->data\) = da; -\(e.function\|e->function\) = func; ) -init_timer +setup_timer ( \(&e\|e\) +, func, da ); @match_function_and_data_after_init_timer@ expression e, e2, e3, e4, e5, func, da; @@ -init_timer +setup_timer ( \(&e\|e\) +, func, da ); ... when != func = e2 when != da = e3 ( -e.function = func; ... when != da = e4 -e.data = da; | -e->function = func; ... when != da = e4 -e->data = da; | -e.data = da; ... when != func = e5 -e.function = func; | -e->data = da; ... when != func = e5 -e->function = func; ) @match_function_and_data_before_init_timer@ expression e, e2, e3, e4, e5, func, da; @@ ( -e.function = func; ... when != da = e4 -e.data = da; | -e->function = func; ... when != da = e4 -e->data = da; | -e.data = da; ... when != func = e5 -e.function = func; | -e->data = da; ... when != func = e5 -e->function = func; ) ... when != func = e2 when != da = e3 -init_timer +setup_timer ( \(&e\|e\) +, func, da ); @r1 exists@ expression t; identifier f; position p; @@ f(...) { ... when any init_timer@p(\(&t\|t\)) ... when any } @r2 exists@ expression r1.t; identifier g != r1.f; expression e8; @@ g(...) { ... when any \(t.data\|t->data\) = e8 ... when any } // It is dangerous to use setup_timer if data field is initialized // in another function. @script:python depends on r2@ p << r1.p; @@ cocci.include_match(False) @r3@ expression r1.t, func, e7; position r1.p; @@ ( -init_timer@p(&t); +setup_timer(&t, func, 0UL); ... when != func = e7 -t.function = func; | -t.function = func; ... when != func = e7 -init_timer@p(&t); +setup_timer(&t, func, 0UL); | -init_timer@p(t); +setup_timer(t, func, 0UL); ... when != func = e7 -t->function = func; | -t->function = func; ... when != func = e7 -init_timer@p(t); +setup_timer(t, func, 0UL); ) Signed-off-by: Kees Cook <[email protected]>
1 parent 24ed960 commit b9eaf18

File tree

31 files changed

+55
-113
lines changed

31 files changed

+55
-113
lines changed

arch/arm/mach-iop32x/n2100.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
setup_timer(&power_button_poll_timer, power_button_poll, 0UL);
341340
power_button_poll_timer.expires = jiffies + (HZ / 10);
342341
add_timer(&power_button_poll_timer);
343342
return 0;

arch/blackfin/kernel/nmi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
setup_timer(&ntimer, nmi_wdt_timer, 0UL);
185184
ntimer.expires = jiffies + NMI_CHECK_TIMEOUT;
186185
add_timer(&ntimer);
187186

arch/sh/drivers/pci/common.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,13 @@ static void pcibios_enable_serr(unsigned long __data)
106106
void pcibios_enable_timers(struct pci_channel *hose)
107107
{
108108
if (hose->err_irq) {
109-
init_timer(&hose->err_timer);
110-
hose->err_timer.data = (unsigned long)hose;
111-
hose->err_timer.function = pcibios_enable_err;
109+
setup_timer(&hose->err_timer, pcibios_enable_err,
110+
(unsigned long)hose);
112111
}
113112

114113
if (hose->serr_irq) {
115-
init_timer(&hose->serr_timer);
116-
hose->serr_timer.data = (unsigned long)hose;
117-
hose->serr_timer.function = pcibios_enable_serr;
114+
setup_timer(&hose->serr_timer, pcibios_enable_serr,
115+
(unsigned long)hose);
118116
}
119117
}
120118

arch/sh/drivers/push-switch.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ static int switch_drv_probe(struct platform_device *pdev)
7878
}
7979

8080
INIT_WORK(&psw->work, switch_work_handler);
81-
init_timer(&psw->debounce);
82-
83-
psw->debounce.function = switch_timer;
84-
psw->debounce.data = (unsigned long)psw;
81+
setup_timer(&psw->debounce, switch_timer, (unsigned long)psw);
8582

8683
/* Workqueue API brain-damage */
8784
psw->pdev = pdev;

drivers/atm/firestream.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,9 +1885,7 @@ static int fs_init(struct fs_dev *dev)
18851885
}
18861886

18871887
#ifdef FS_POLL_FREQ
1888-
init_timer (&dev->timer);
1889-
dev->timer.data = (unsigned long) dev;
1890-
dev->timer.function = fs_poll;
1888+
setup_timer (&dev->timer, fs_poll, (unsigned long)dev);
18911889
dev->timer.expires = jiffies + FS_POLL_FREQ;
18921890
add_timer (&dev->timer);
18931891
#endif

drivers/atm/lanai.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,10 +1790,8 @@ static void lanai_timed_poll(unsigned long arg)
17901790

17911791
static inline void lanai_timed_poll_start(struct lanai_dev *lanai)
17921792
{
1793-
init_timer(&lanai->timer);
1793+
setup_timer(&lanai->timer, lanai_timed_poll, (unsigned long)lanai);
17941794
lanai->timer.expires = jiffies + LANAI_POLL_PERIOD;
1795-
lanai->timer.data = (unsigned long) lanai;
1796-
lanai->timer.function = lanai_timed_poll;
17971795
add_timer(&lanai->timer);
17981796
}
17991797

drivers/atm/nicstar.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,8 @@ static int __init nicstar_init(void)
284284
XPRINTK("nicstar: nicstar_init() returned.\n");
285285

286286
if (!error) {
287-
init_timer(&ns_timer);
287+
setup_timer(&ns_timer, ns_poll, 0UL);
288288
ns_timer.expires = jiffies + NS_POLL_PERIOD;
289-
ns_timer.data = 0UL;
290-
ns_timer.function = ns_poll;
291289
add_timer(&ns_timer);
292290
}
293291

drivers/block/DAC960.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,11 +3079,10 @@ DAC960_InitializeController(DAC960_Controller_T *Controller)
30793079
/*
30803080
Initialize the Monitoring Timer.
30813081
*/
3082-
init_timer(&Controller->MonitoringTimer);
3082+
setup_timer(&Controller->MonitoringTimer,
3083+
DAC960_MonitoringTimerFunction, (unsigned long)Controller);
30833084
Controller->MonitoringTimer.expires =
30843085
jiffies + DAC960_MonitoringTimerInterval;
3085-
Controller->MonitoringTimer.data = (unsigned long) Controller;
3086-
Controller->MonitoringTimer.function = DAC960_MonitoringTimerFunction;
30873086
add_timer(&Controller->MonitoringTimer);
30883087
Controller->ControllerInitialized = true;
30893088
return true;

drivers/block/umem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,7 @@ static void check_all_batteries(unsigned long ptr)
738738

739739
static void init_battery_timer(void)
740740
{
741-
init_timer(&battery_timer);
742-
battery_timer.function = check_all_batteries;
741+
setup_timer(&battery_timer, check_all_batteries, 0UL);
743742
battery_timer.expires = jiffies + (HZ * 60);
744743
add_timer(&battery_timer);
745744
}

drivers/gpu/drm/omapdrm/dss/dsi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5449,9 +5449,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
54495449
dsi_framedone_timeout_work_callback);
54505450

54515451
#ifdef DSI_CATCH_MISSING_TE
5452-
init_timer(&dsi->te_timer);
5453-
dsi->te_timer.function = dsi_te_timeout;
5454-
dsi->te_timer.data = 0;
5452+
setup_timer(&dsi->te_timer, dsi_te_timeout, 0);
54555453
#endif
54565454

54575455
dsi_mem = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto");

drivers/infiniband/hw/mthca/mthca_catas.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
149149
{
150150
phys_addr_t addr;
151151

152-
init_timer(&dev->catas_err.timer);
152+
setup_timer(&dev->catas_err.timer, poll_catas, (unsigned long)dev);
153153
dev->catas_err.map = NULL;
154154

155155
addr = pci_resource_start(dev->pdev, 0) +
@@ -164,8 +164,6 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
164164
return;
165165
}
166166

167-
dev->catas_err.timer.data = (unsigned long) dev;
168-
dev->catas_err.timer.function = poll_catas;
169167
dev->catas_err.timer.expires = jiffies + MTHCA_CATAS_POLL_INTERVAL;
170168
INIT_LIST_HEAD(&dev->catas_err.list);
171169
add_timer(&dev->catas_err.timer);

drivers/isdn/i4l/isdn_common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,8 +2294,7 @@ static int __init isdn_init(void)
22942294
printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
22952295
return -EIO;
22962296
}
2297-
init_timer(&dev->timer);
2298-
dev->timer.function = isdn_timer_funct;
2297+
setup_timer(&dev->timer, isdn_timer_funct, 0UL);
22992298
spin_lock_init(&dev->lock);
23002299
spin_lock_init(&dev->timerlock);
23012300
#ifdef MODULE

drivers/isdn/i4l/isdn_net.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,9 +1615,9 @@ isdn_net_ciscohdlck_connected(isdn_net_local *lp)
16151615
/* send slarp request because interface/seq.no.s reset */
16161616
isdn_net_ciscohdlck_slarp_send_request(lp);
16171617

1618-
init_timer(&lp->cisco_timer);
1619-
lp->cisco_timer.data = (unsigned long) lp;
1620-
lp->cisco_timer.function = isdn_net_ciscohdlck_slarp_send_keepalive;
1618+
setup_timer(&lp->cisco_timer,
1619+
isdn_net_ciscohdlck_slarp_send_keepalive,
1620+
(unsigned long)lp);
16211621
lp->cisco_timer.expires = jiffies + lp->cisco_keepalive_period * HZ;
16221622
add_timer(&lp->cisco_timer);
16231623
}

drivers/media/platform/s5p-mfc/s5p_mfc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,9 +1314,8 @@ static int s5p_mfc_probe(struct platform_device *pdev)
13141314
dev->hw_lock = 0;
13151315
INIT_WORK(&dev->watchdog_work, s5p_mfc_watchdog_worker);
13161316
atomic_set(&dev->watchdog_cnt, 0);
1317-
init_timer(&dev->watchdog_timer);
1318-
dev->watchdog_timer.data = (unsigned long)dev;
1319-
dev->watchdog_timer.function = s5p_mfc_watchdog;
1317+
setup_timer(&dev->watchdog_timer, s5p_mfc_watchdog,
1318+
(unsigned long)dev);
13201319

13211320
ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
13221321
if (ret)

drivers/media/usb/au0828/au0828-dvb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,8 @@ int au0828_dvb_register(struct au0828_dev *dev)
648648
return ret;
649649
}
650650

651-
dev->bulk_timeout.function = au0828_bulk_timeout;
652-
dev->bulk_timeout.data = (unsigned long) dev;
653-
init_timer(&dev->bulk_timeout);
651+
setup_timer(&dev->bulk_timeout, au0828_bulk_timeout,
652+
(unsigned long)dev);
654653

655654
return 0;
656655
}

drivers/net/wireless/intersil/hostap/hostap_ap.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,10 +1189,8 @@ static struct sta_info * ap_add_sta(struct ap_data *ap, u8 *addr)
11891189
}
11901190

11911191
#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
1192-
init_timer(&sta->timer);
1192+
setup_timer(&sta->timer, ap_handle_timer, (unsigned long)sta);
11931193
sta->timer.expires = jiffies + ap->max_inactivity;
1194-
sta->timer.data = (unsigned long) sta;
1195-
sta->timer.function = ap_handle_timer;
11961194
if (!ap->local->hostapd)
11971195
add_timer(&sta->timer);
11981196
#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */

drivers/net/wireless/intersil/hostap/hostap_hw.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,13 +3225,10 @@ while (0)
32253225

32263226
lib80211_crypt_info_init(&local->crypt_info, dev->name, &local->lock);
32273227

3228-
init_timer(&local->passive_scan_timer);
3229-
local->passive_scan_timer.data = (unsigned long) local;
3230-
local->passive_scan_timer.function = hostap_passive_scan;
3231-
3232-
init_timer(&local->tick_timer);
3233-
local->tick_timer.data = (unsigned long) local;
3234-
local->tick_timer.function = hostap_tick_timer;
3228+
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);
32353232
local->tick_timer.expires = jiffies + 2 * HZ;
32363233
add_timer(&local->tick_timer);
32373234

drivers/nfc/pn533/pn533.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,9 +2632,8 @@ struct pn533 *pn533_register_device(u32 device_type,
26322632
if (priv->wq == NULL)
26332633
goto error;
26342634

2635-
init_timer(&priv->listen_timer);
2636-
priv->listen_timer.data = (unsigned long) priv;
2637-
priv->listen_timer.function = pn533_listen_mode_timer;
2635+
setup_timer(&priv->listen_timer, pn533_listen_mode_timer,
2636+
(unsigned long)priv);
26382637

26392638
skb_queue_head_init(&priv->resp_q);
26402639
skb_queue_head_init(&priv->fragment_skb);

drivers/nfc/st-nci/ndlc.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,8 @@ int ndlc_probe(void *phy_id, struct nfc_phy_ops *phy_ops, struct device *dev,
282282
*ndlc_id = ndlc;
283283

284284
/* initialize timers */
285-
init_timer(&ndlc->t1_timer);
286-
ndlc->t1_timer.data = (unsigned long)ndlc;
287-
ndlc->t1_timer.function = ndlc_t1_timeout;
288-
289-
init_timer(&ndlc->t2_timer);
290-
ndlc->t2_timer.data = (unsigned long)ndlc;
291-
ndlc->t2_timer.function = ndlc_t2_timeout;
285+
setup_timer(&ndlc->t1_timer, ndlc_t1_timeout, (unsigned long)ndlc);
286+
setup_timer(&ndlc->t2_timer, ndlc_t2_timeout, (unsigned long)ndlc);
292287

293288
skb_queue_head_init(&ndlc->rcv_q);
294289
skb_queue_head_init(&ndlc->send_q);

drivers/nfc/st-nci/se.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -725,15 +725,12 @@ int st_nci_se_init(struct nci_dev *ndev, struct st_nci_se_status *se_status)
725725

726726
init_completion(&info->se_info.req_completion);
727727
/* initialize timers */
728-
init_timer(&info->se_info.bwi_timer);
729-
info->se_info.bwi_timer.data = (unsigned long)info;
730-
info->se_info.bwi_timer.function = st_nci_se_wt_timeout;
728+
setup_timer(&info->se_info.bwi_timer, st_nci_se_wt_timeout,
729+
(unsigned long)info);
731730
info->se_info.bwi_active = false;
732731

733-
init_timer(&info->se_info.se_active_timer);
734-
info->se_info.se_active_timer.data = (unsigned long)info;
735-
info->se_info.se_active_timer.function =
736-
st_nci_se_activation_timeout;
732+
setup_timer(&info->se_info.se_active_timer,
733+
st_nci_se_activation_timeout, (unsigned long)info);
737734
info->se_info.se_active = false;
738735

739736
info->se_info.xch_error = false;

drivers/nfc/st21nfca/se.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,12 @@ void st21nfca_se_init(struct nfc_hci_dev *hdev)
392392

393393
init_completion(&info->se_info.req_completion);
394394
/* initialize timers */
395-
init_timer(&info->se_info.bwi_timer);
396-
info->se_info.bwi_timer.data = (unsigned long)info;
397-
info->se_info.bwi_timer.function = st21nfca_se_wt_timeout;
395+
setup_timer(&info->se_info.bwi_timer, st21nfca_se_wt_timeout,
396+
(unsigned long)info);
398397
info->se_info.bwi_active = false;
399398

400-
init_timer(&info->se_info.se_active_timer);
401-
info->se_info.se_active_timer.data = (unsigned long)info;
402-
info->se_info.se_active_timer.function = st21nfca_se_activation_timeout;
399+
setup_timer(&info->se_info.se_active_timer,
400+
st21nfca_se_activation_timeout, (unsigned long)info);
403401
info->se_info.se_active = false;
404402

405403
info->se_info.count_pipes = 0;

drivers/s390/block/dasd.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ struct dasd_device *dasd_alloc_device(void)
119119
(void (*)(unsigned long)) dasd_device_tasklet,
120120
(unsigned long) device);
121121
INIT_LIST_HEAD(&device->ccw_queue);
122-
init_timer(&device->timer);
123-
device->timer.function = dasd_device_timeout;
124-
device->timer.data = (unsigned long) device;
122+
setup_timer(&device->timer, dasd_device_timeout,
123+
(unsigned long)device);
125124
INIT_WORK(&device->kick_work, do_kick_device);
126125
INIT_WORK(&device->restore_device, do_restore_device);
127126
INIT_WORK(&device->reload_device, do_reload_device);
@@ -163,9 +162,7 @@ struct dasd_block *dasd_alloc_block(void)
163162
(unsigned long) block);
164163
INIT_LIST_HEAD(&block->ccw_queue);
165164
spin_lock_init(&block->queue_lock);
166-
init_timer(&block->timer);
167-
block->timer.function = dasd_block_timeout;
168-
block->timer.data = (unsigned long) block;
165+
setup_timer(&block->timer, dasd_block_timeout, (unsigned long)block);
169166
spin_lock_init(&block->profile.lock);
170167

171168
return block;

drivers/s390/net/fsm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,11 @@ void
142142
fsm_settimer(fsm_instance *fi, fsm_timer *this)
143143
{
144144
this->fi = fi;
145-
this->tl.function = (void *)fsm_expire_timer;
146-
this->tl.data = (long)this;
147145
#if FSM_TIMER_DEBUG
148146
printk(KERN_DEBUG "fsm(%s): Create timer %p\n", fi->name,
149147
this);
150148
#endif
151-
init_timer(&this->tl);
149+
setup_timer(&this->tl, (void *)fsm_expire_timer, (long)this);
152150
}
153151

154152
void

drivers/scsi/arcmsr/arcmsr_hba.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,9 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
837837
atomic_set(&acb->rq_map_token, 16);
838838
atomic_set(&acb->ante_token_value, 16);
839839
acb->fw_flag = FW_NORMAL;
840-
init_timer(&acb->eternal_timer);
840+
setup_timer(&acb->eternal_timer, &arcmsr_request_device_map,
841+
(unsigned long)acb);
841842
acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ);
842-
acb->eternal_timer.data = (unsigned long) acb;
843-
acb->eternal_timer.function = &arcmsr_request_device_map;
844843
add_timer(&acb->eternal_timer);
845844
if(arcmsr_alloc_sysfs_attr(acb))
846845
goto out_free_sysfs;
@@ -930,10 +929,9 @@ static int arcmsr_resume(struct pci_dev *pdev)
930929
atomic_set(&acb->rq_map_token, 16);
931930
atomic_set(&acb->ante_token_value, 16);
932931
acb->fw_flag = FW_NORMAL;
933-
init_timer(&acb->eternal_timer);
932+
setup_timer(&acb->eternal_timer, &arcmsr_request_device_map,
933+
(unsigned long)acb);
934934
acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ);
935-
acb->eternal_timer.data = (unsigned long) acb;
936-
acb->eternal_timer.function = &arcmsr_request_device_map;
937935
add_timer(&acb->eternal_timer);
938936
return 0;
939937
controller_stop:

drivers/scsi/arm/fas216.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,9 +2849,7 @@ int fas216_init(struct Scsi_Host *host)
28492849
info->rst_dev_status = -1;
28502850
info->rst_bus_status = -1;
28512851
init_waitqueue_head(&info->eh_wait);
2852-
init_timer(&info->eh_timer);
2853-
info->eh_timer.data = (unsigned long)info;
2854-
info->eh_timer.function = fas216_eh_timer;
2852+
setup_timer(&info->eh_timer, fas216_eh_timer, (unsigned long)info);
28552853

28562854
spin_lock_init(&info->host_lock);
28572855

drivers/scsi/bfa/bfad.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,7 @@ bfad_bfa_tmo(unsigned long data)
719719
void
720720
bfad_init_timer(struct bfad_s *bfad)
721721
{
722-
init_timer(&bfad->hal_tmo);
723-
bfad->hal_tmo.function = bfad_bfa_tmo;
724-
bfad->hal_tmo.data = (unsigned long)bfad;
722+
setup_timer(&bfad->hal_tmo, bfad_bfa_tmo, (unsigned long)bfad);
725723

726724
mod_timer(&bfad->hal_tmo,
727725
jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));

drivers/scsi/esas2r/esas2r_main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,10 +1635,8 @@ static void esas2r_timer_callback(unsigned long context);
16351635

16361636
void esas2r_kickoff_timer(struct esas2r_adapter *a)
16371637
{
1638-
init_timer(&a->timer);
1638+
setup_timer(&a->timer, esas2r_timer_callback, (unsigned long)a);
16391639

1640-
a->timer.function = esas2r_timer_callback;
1641-
a->timer.data = (unsigned long)a;
16421640
a->timer.expires = jiffies +
16431641
msecs_to_jiffies(100);
16441642

drivers/scsi/ncr53c8xx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8357,9 +8357,7 @@ struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt,
83578357
if (!np->scripth0)
83588358
goto attach_error;
83598359

8360-
init_timer(&np->timer);
8361-
np->timer.data = (unsigned long) np;
8362-
np->timer.function = ncr53c8xx_timeout;
8360+
setup_timer(&np->timer, ncr53c8xx_timeout, (unsigned long)np);
83638361

83648362
/* Try to map the controller chip to virtual and physical memory. */
83658363

0 commit comments

Comments
 (0)