aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-09-21 16:12:15 -0400
committerKees Cook <keescook@chromium.org>2017-10-27 05:22:00 -0400
commit13059106242bc96f8f5ab79c0f6cb15c7b756f40 (patch)
treed1e8a3c866b17d4b5b1c75b16e3d25de3f5a391a
parentaf53b89becdcee2f15c60e6a9e951bd96d382e1c (diff)
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: QLogic-Storage-Upstream@qlogic.com Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Johannes Thumshirn <jth@kernel.org> Cc: linux-scsi@vger.kernel.org Cc: fcoe-devel@open-fcoe.org Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Johannes Thumshirn <jth@kernel.org>
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c11
-rw-r--r--drivers/scsi/fcoe/fcoe.c2
-rw-r--r--drivers/scsi/fcoe/fcoe_transport.c6
-rw-r--r--include/scsi/libfcoe.h2
4 files changed, 11 insertions, 10 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 6844ba361616..e6b9de7d41ac 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -823,7 +823,7 @@ static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev)
823 823
824 skb_queue_head_init(&port->fcoe_pending_queue); 824 skb_queue_head_init(&port->fcoe_pending_queue);
825 port->fcoe_pending_queue_active = 0; 825 port->fcoe_pending_queue_active = 0;
826 setup_timer(&port->timer, fcoe_queue_timer, (unsigned long) lport); 826 timer_setup(&port->timer, fcoe_queue_timer, 0);
827 827
828 fcoe_link_speed_update(lport); 828 fcoe_link_speed_update(lport);
829 829
@@ -845,9 +845,9 @@ static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev)
845 return 0; 845 return 0;
846} 846}
847 847
848static void bnx2fc_destroy_timer(unsigned long data) 848static void bnx2fc_destroy_timer(struct timer_list *t)
849{ 849{
850 struct bnx2fc_hba *hba = (struct bnx2fc_hba *)data; 850 struct bnx2fc_hba *hba = from_timer(hba, t, destroy_timer);
851 851
852 printk(KERN_ERR PFX "ERROR:bnx2fc_destroy_timer - " 852 printk(KERN_ERR PFX "ERROR:bnx2fc_destroy_timer - "
853 "Destroy compl not received!!\n"); 853 "Destroy compl not received!!\n");
@@ -1946,11 +1946,10 @@ static void bnx2fc_fw_destroy(struct bnx2fc_hba *hba)
1946{ 1946{
1947 if (test_and_clear_bit(BNX2FC_FLAG_FW_INIT_DONE, &hba->flags)) { 1947 if (test_and_clear_bit(BNX2FC_FLAG_FW_INIT_DONE, &hba->flags)) {
1948 if (bnx2fc_send_fw_fcoe_destroy_msg(hba) == 0) { 1948 if (bnx2fc_send_fw_fcoe_destroy_msg(hba) == 0) {
1949 init_timer(&hba->destroy_timer); 1949 timer_setup(&hba->destroy_timer, bnx2fc_destroy_timer,
1950 0);
1950 hba->destroy_timer.expires = BNX2FC_FW_TIMEOUT + 1951 hba->destroy_timer.expires = BNX2FC_FW_TIMEOUT +
1951 jiffies; 1952 jiffies;
1952 hba->destroy_timer.function = bnx2fc_destroy_timer;
1953 hba->destroy_timer.data = (unsigned long)hba;
1954 add_timer(&hba->destroy_timer); 1953 add_timer(&hba->destroy_timer);
1955 wait_event_interruptible(hba->destroy_wait, 1954 wait_event_interruptible(hba->destroy_wait,
1956 test_bit(BNX2FC_FLAG_DESTROY_CMPL, 1955 test_bit(BNX2FC_FLAG_DESTROY_CMPL,
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 85f9a3eba387..5cc09dce4d25 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -754,7 +754,7 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)
754 754
755 skb_queue_head_init(&port->fcoe_pending_queue); 755 skb_queue_head_init(&port->fcoe_pending_queue);
756 port->fcoe_pending_queue_active = 0; 756 port->fcoe_pending_queue_active = 0;
757 setup_timer(&port->timer, fcoe_queue_timer, (unsigned long)lport); 757 timer_setup(&port->timer, fcoe_queue_timer, 0);
758 758
759 fcoe_link_speed_update(lport); 759 fcoe_link_speed_update(lport);
760 760
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index 375c536cbc68..1ba5f51713a3 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -455,9 +455,11 @@ EXPORT_SYMBOL_GPL(fcoe_check_wait_queue);
455 * 455 *
456 * Calls fcoe_check_wait_queue on timeout 456 * Calls fcoe_check_wait_queue on timeout
457 */ 457 */
458void fcoe_queue_timer(ulong lport) 458void fcoe_queue_timer(struct timer_list *t)
459{ 459{
460 fcoe_check_wait_queue((struct fc_lport *)lport, NULL); 460 struct fcoe_port *port = from_timer(port, t, timer);
461
462 fcoe_check_wait_queue(port->lport, NULL);
461} 463}
462EXPORT_SYMBOL_GPL(fcoe_queue_timer); 464EXPORT_SYMBOL_GPL(fcoe_queue_timer);
463 465
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 722d3264d3bf..cb8a273732cf 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -382,7 +382,7 @@ static inline struct net_device *fcoe_get_netdev(const struct fc_lport *lport)
382 382
383void fcoe_clean_pending_queue(struct fc_lport *); 383void fcoe_clean_pending_queue(struct fc_lport *);
384void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb); 384void fcoe_check_wait_queue(struct fc_lport *lport, struct sk_buff *skb);
385void fcoe_queue_timer(ulong lport); 385void fcoe_queue_timer(struct timer_list *t);
386int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen, 386int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen,
387 struct fcoe_percpu_s *fps); 387 struct fcoe_percpu_s *fps);
388 388