diff options
author | Kees Cook <keescook@chromium.org> | 2017-09-02 02:21:24 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-10-27 05:22:00 -0400 |
commit | b0a2dc66152aa409860e02804169b0007244ebd7 (patch) | |
tree | 025474155e15f628c09530928c28df10ac43c272 /drivers/scsi/isci | |
parent | 7932589f47d5d5eaa9948bd479b42819b6b10509 (diff) |
scsi: isci: 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: Intel SCU Linux support <intel-linux-scu@intel.com>
Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r-- | drivers/scsi/isci/host.c | 12 | ||||
-rw-r--r-- | drivers/scsi/isci/isci.h | 6 | ||||
-rw-r--r-- | drivers/scsi/isci/phy.c | 4 | ||||
-rw-r--r-- | drivers/scsi/isci/port.c | 4 | ||||
-rw-r--r-- | drivers/scsi/isci/port_config.c | 8 |
5 files changed, 16 insertions, 18 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index 609dafd661d1..13b37cdffa8e 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c | |||
@@ -958,9 +958,9 @@ static enum sci_status sci_controller_start_next_phy(struct isci_host *ihost) | |||
958 | return status; | 958 | return status; |
959 | } | 959 | } |
960 | 960 | ||
961 | static void phy_startup_timeout(unsigned long data) | 961 | static void phy_startup_timeout(struct timer_list *t) |
962 | { | 962 | { |
963 | struct sci_timer *tmr = (struct sci_timer *)data; | 963 | struct sci_timer *tmr = from_timer(tmr, t, timer); |
964 | struct isci_host *ihost = container_of(tmr, typeof(*ihost), phy_timer); | 964 | struct isci_host *ihost = container_of(tmr, typeof(*ihost), phy_timer); |
965 | unsigned long flags; | 965 | unsigned long flags; |
966 | enum sci_status status; | 966 | enum sci_status status; |
@@ -1592,9 +1592,9 @@ static const struct sci_base_state sci_controller_state_table[] = { | |||
1592 | [SCIC_FAILED] = {} | 1592 | [SCIC_FAILED] = {} |
1593 | }; | 1593 | }; |
1594 | 1594 | ||
1595 | static void controller_timeout(unsigned long data) | 1595 | static void controller_timeout(struct timer_list *t) |
1596 | { | 1596 | { |
1597 | struct sci_timer *tmr = (struct sci_timer *)data; | 1597 | struct sci_timer *tmr = from_timer(tmr, t, timer); |
1598 | struct isci_host *ihost = container_of(tmr, typeof(*ihost), timer); | 1598 | struct isci_host *ihost = container_of(tmr, typeof(*ihost), timer); |
1599 | struct sci_base_state_machine *sm = &ihost->sm; | 1599 | struct sci_base_state_machine *sm = &ihost->sm; |
1600 | unsigned long flags; | 1600 | unsigned long flags; |
@@ -1737,9 +1737,9 @@ static u8 max_spin_up(struct isci_host *ihost) | |||
1737 | MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT); | 1737 | MAX_CONCURRENT_DEVICE_SPIN_UP_COUNT); |
1738 | } | 1738 | } |
1739 | 1739 | ||
1740 | static void power_control_timeout(unsigned long data) | 1740 | static void power_control_timeout(struct timer_list *t) |
1741 | { | 1741 | { |
1742 | struct sci_timer *tmr = (struct sci_timer *)data; | 1742 | struct sci_timer *tmr = from_timer(tmr, t, timer); |
1743 | struct isci_host *ihost = container_of(tmr, typeof(*ihost), power_control.timer); | 1743 | struct isci_host *ihost = container_of(tmr, typeof(*ihost), power_control.timer); |
1744 | struct isci_phy *iphy; | 1744 | struct isci_phy *iphy; |
1745 | unsigned long flags; | 1745 | unsigned long flags; |
diff --git a/drivers/scsi/isci/isci.h b/drivers/scsi/isci/isci.h index 234ab46fce33..680e30947671 100644 --- a/drivers/scsi/isci/isci.h +++ b/drivers/scsi/isci/isci.h | |||
@@ -498,12 +498,10 @@ struct sci_timer { | |||
498 | }; | 498 | }; |
499 | 499 | ||
500 | static inline | 500 | static inline |
501 | void sci_init_timer(struct sci_timer *tmr, void (*fn)(unsigned long)) | 501 | void sci_init_timer(struct sci_timer *tmr, void (*fn)(struct timer_list *t)) |
502 | { | 502 | { |
503 | tmr->timer.function = fn; | ||
504 | tmr->timer.data = (unsigned long) tmr; | ||
505 | tmr->cancel = 0; | 503 | tmr->cancel = 0; |
506 | init_timer(&tmr->timer); | 504 | timer_setup(&tmr->timer, fn, 0); |
507 | } | 505 | } |
508 | 506 | ||
509 | static inline void sci_mod_timer(struct sci_timer *tmr, unsigned long msec) | 507 | static inline void sci_mod_timer(struct sci_timer *tmr, unsigned long msec) |
diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index cb87b2ef7c92..1deca8c5a94f 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isci/phy.c | |||
@@ -315,9 +315,9 @@ sci_phy_link_layer_initialization(struct isci_phy *iphy, | |||
315 | return SCI_SUCCESS; | 315 | return SCI_SUCCESS; |
316 | } | 316 | } |
317 | 317 | ||
318 | static void phy_sata_timeout(unsigned long data) | 318 | static void phy_sata_timeout(struct timer_list *t) |
319 | { | 319 | { |
320 | struct sci_timer *tmr = (struct sci_timer *)data; | 320 | struct sci_timer *tmr = from_timer(tmr, t, timer); |
321 | struct isci_phy *iphy = container_of(tmr, typeof(*iphy), sata_timer); | 321 | struct isci_phy *iphy = container_of(tmr, typeof(*iphy), sata_timer); |
322 | struct isci_host *ihost = iphy->owning_port->owning_controller; | 322 | struct isci_host *ihost = iphy->owning_port->owning_controller; |
323 | unsigned long flags; | 323 | unsigned long flags; |
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c index a4dd5c91508c..1df45f028ea7 100644 --- a/drivers/scsi/isci/port.c +++ b/drivers/scsi/isci/port.c | |||
@@ -769,9 +769,9 @@ bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy) | |||
769 | return true; | 769 | return true; |
770 | } | 770 | } |
771 | 771 | ||
772 | static void port_timeout(unsigned long data) | 772 | static void port_timeout(struct timer_list *t) |
773 | { | 773 | { |
774 | struct sci_timer *tmr = (struct sci_timer *)data; | 774 | struct sci_timer *tmr = from_timer(tmr, t, timer); |
775 | struct isci_port *iport = container_of(tmr, typeof(*iport), timer); | 775 | struct isci_port *iport = container_of(tmr, typeof(*iport), timer); |
776 | struct isci_host *ihost = iport->owning_controller; | 776 | struct isci_host *ihost = iport->owning_controller; |
777 | unsigned long flags; | 777 | unsigned long flags; |
diff --git a/drivers/scsi/isci/port_config.c b/drivers/scsi/isci/port_config.c index ac879745ef80..edb7be786c65 100644 --- a/drivers/scsi/isci/port_config.c +++ b/drivers/scsi/isci/port_config.c | |||
@@ -319,10 +319,10 @@ sci_mpc_agent_validate_phy_configuration(struct isci_host *ihost, | |||
319 | return sci_port_configuration_agent_validate_ports(ihost, port_agent); | 319 | return sci_port_configuration_agent_validate_ports(ihost, port_agent); |
320 | } | 320 | } |
321 | 321 | ||
322 | static void mpc_agent_timeout(unsigned long data) | 322 | static void mpc_agent_timeout(struct timer_list *t) |
323 | { | 323 | { |
324 | u8 index; | 324 | u8 index; |
325 | struct sci_timer *tmr = (struct sci_timer *)data; | 325 | struct sci_timer *tmr = from_timer(tmr, t, timer); |
326 | struct sci_port_configuration_agent *port_agent; | 326 | struct sci_port_configuration_agent *port_agent; |
327 | struct isci_host *ihost; | 327 | struct isci_host *ihost; |
328 | unsigned long flags; | 328 | unsigned long flags; |
@@ -654,10 +654,10 @@ static void sci_apc_agent_link_down( | |||
654 | } | 654 | } |
655 | 655 | ||
656 | /* configure the phys into ports when the timer fires */ | 656 | /* configure the phys into ports when the timer fires */ |
657 | static void apc_agent_timeout(unsigned long data) | 657 | static void apc_agent_timeout(struct timer_list *t) |
658 | { | 658 | { |
659 | u32 index; | 659 | u32 index; |
660 | struct sci_timer *tmr = (struct sci_timer *)data; | 660 | struct sci_timer *tmr = from_timer(tmr, t, timer); |
661 | struct sci_port_configuration_agent *port_agent; | 661 | struct sci_port_configuration_agent *port_agent; |
662 | struct isci_host *ihost; | 662 | struct isci_host *ihost; |
663 | unsigned long flags; | 663 | unsigned long flags; |