scsi: fcoe: Convert timers to use timer_setup()
PATCH 1/1 scsi: fcoe: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly.
Cc "James E.J. Bottomley" <[email protected]>
Cc "Martin K. Petersen" <[email protected]>
Cc Johannes Thumshirn <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Kees Cook <[email protected]>
---
This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone.
--- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 11 +++++------ drivers/scsi/fcoe/fcoe.c | 2 +- drivers/scsi/fcoe/fcoe_transport.c | 6 ++++-- include/scsi/libfcoe.h | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-)
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +5 -6
@@ -823,7 +823,7 @@ static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev)skb_queue_head_init (&port->fcoe_pending_queue); port->fcoe_pending_queue_active =0 ; -setup_timer (&port->timer, fcoe_queue_timer, (unsigned long ) lport); +timer_setup (&port->timer, fcoe_queue_timer,0 );fcoe_link_speed_update (lport);
@@ -845,9 +845,9 @@ static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev)return 0 ; } -static void bnx2fc_destroy_timer (unsigned long data) +static void bnx2fc_destroy_timer (struct timer_list *t) { -struct bnx2fc_hba *hba = (struct bnx2fc_hba *)data; +struct bnx2fc_hba *hba =from_timer (hba, t, destroy_timer); printk(KERN_ERR PFX "ERROR:bnx2fc_destroy_timer - " "Destroy compl not received!!\n");
@@ -1946,11 +1946,10 @@ static void bnx2fc_fw_destroy(struct bnx2fc_hba *hba) {if (test_and_clear_bit (BNX2FC_FLAG_FW_INIT_DONE , &hba->flags)) {if (bnx2fc_send_fw_fcoe_destroy_msg (hba) ==0 ) { -init_timer (&hba->destroy_timer); +timer_setup (&hba->destroy_timer, bnx2fc_destroy_timer, +0 ); hba->destroy_timer.expires =BNX2FC_FW_TIMEOUT + jiffies; - hba->destroy_timer.function = bnx2fc_destroy_timer; - hba->destroy_timer.data = (unsigned long )hba;add_timer (&hba->destroy_timer); wait_event_interruptible(hba->destroy_wait, test_bit(BNX2FC_FLAG_DESTROY_CMPL,
drivers/scsi/fcoe/fcoe.c +1 -1
@@ -754,7 +754,7 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)skb_queue_head_init (&port->fcoe_pending_queue); port->fcoe_pending_queue_active =0 ; -setup_timer (&port->timer, fcoe_queue_timer, (unsigned long )lport); +timer_setup (&port->timer, fcoe_queue_timer,0 );fcoe_link_speed_update (lport);
drivers/scsi/fcoe/fcoe_transport.c +4 -2
@@ -455,9 +455,11 @@ EXPORT_SYMBOL_GPL(fcoe_check_wait_queue);* * Calls fcoe_check_wait_queue on timeout */ -void fcoe_queue_timer (ulong lport) +void fcoe_queue_timer (struct timer_list *t) { -fcoe_check_wait_queue ((struct fc_lport *)lport,NULL ); +struct fcoe_port *port =from_timer (port, t, timer); + +fcoe_check_wait_queue (port->lport,NULL ); }EXPORT_SYMBOL_GPL (fcoe_queue_timer);
include/scsi/libfcoe.h +1 -1
@@ -382,7 +382,7 @@ static inline struct net_device *fcoe_get_netdev(const struct fc_lport *lport)void fcoe_clean_pending_queue (struct fc_lport *);void fcoe_check_wait_queue (struct fc_lport *lport,struct sk_buff *skb); -void fcoe_queue_timer (ulong lport); +void fcoe_queue_timer (struct timer_list *t);int fcoe_get_paged_crc_eof (struct sk_buff *skb,int tlen,struct fcoe_percpu_s *fps);
Signature · 6 lines
2.7.4 -- Kees Cook Pixel Security
Looks good,
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850