aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-11 19:15:26 -0400
committerKees Cook <keescook@chromium.org>2017-10-27 05:22:00 -0400
commitb386eec6b0af30c947bf439bfabffb8fd6ab5fc0 (patch)
tree897e6d23f7393a3a296a4a0cdb0882965a46891c
parent30199bee2d8da237086f7e8067e31814967e3d04 (diff)
scsi: be2iscsi: 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: Subbu Seetharaman <subbu.seetharaman@broadcom.com> Cc: Ketan Mukadam <ketan.mukadam@broadcom.com> Cc: Jitendra Bhivare <jitendra.bhivare@broadcom.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: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/be2iscsi/be_main.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index b4542e7e2ad5..d8bd6f2c9c83 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -5230,12 +5230,11 @@ static void beiscsi_eqd_update_work(struct work_struct *work)
5230 msecs_to_jiffies(BEISCSI_EQD_UPDATE_INTERVAL)); 5230 msecs_to_jiffies(BEISCSI_EQD_UPDATE_INTERVAL));
5231} 5231}
5232 5232
5233static void beiscsi_hw_tpe_check(unsigned long ptr) 5233static void beiscsi_hw_tpe_check(struct timer_list *t)
5234{ 5234{
5235 struct beiscsi_hba *phba; 5235 struct beiscsi_hba *phba = from_timer(phba, t, hw_check);
5236 u32 wait; 5236 u32 wait;
5237 5237
5238 phba = (struct beiscsi_hba *)ptr;
5239 /* if not TPE, do nothing */ 5238 /* if not TPE, do nothing */
5240 if (!beiscsi_detect_tpe(phba)) 5239 if (!beiscsi_detect_tpe(phba))
5241 return; 5240 return;
@@ -5248,11 +5247,10 @@ static void beiscsi_hw_tpe_check(unsigned long ptr)
5248 msecs_to_jiffies(wait)); 5247 msecs_to_jiffies(wait));
5249} 5248}
5250 5249
5251static void beiscsi_hw_health_check(unsigned long ptr) 5250static void beiscsi_hw_health_check(struct timer_list *t)
5252{ 5251{
5253 struct beiscsi_hba *phba; 5252 struct beiscsi_hba *phba = from_timer(phba, t, hw_check);
5254 5253
5255 phba = (struct beiscsi_hba *)ptr;
5256 beiscsi_detect_ue(phba); 5254 beiscsi_detect_ue(phba);
5257 if (beiscsi_detect_ue(phba)) { 5255 if (beiscsi_detect_ue(phba)) {
5258 __beiscsi_log(phba, KERN_ERR, 5256 __beiscsi_log(phba, KERN_ERR,
@@ -5264,7 +5262,7 @@ static void beiscsi_hw_health_check(unsigned long ptr)
5264 if (!test_bit(BEISCSI_HBA_UER_SUPP, &phba->state)) 5262 if (!test_bit(BEISCSI_HBA_UER_SUPP, &phba->state))
5265 return; 5263 return;
5266 /* modify this timer to check TPE */ 5264 /* modify this timer to check TPE */
5267 phba->hw_check.function = beiscsi_hw_tpe_check; 5265 phba->hw_check.function = (TIMER_FUNC_TYPE)beiscsi_hw_tpe_check;
5268 } 5266 }
5269 5267
5270 mod_timer(&phba->hw_check, 5268 mod_timer(&phba->hw_check,
@@ -5351,7 +5349,7 @@ static int beiscsi_enable_port(struct beiscsi_hba *phba)
5351 * Timer function gets modified for TPE detection. 5349 * Timer function gets modified for TPE detection.
5352 * Always reinit to do health check first. 5350 * Always reinit to do health check first.
5353 */ 5351 */
5354 phba->hw_check.function = beiscsi_hw_health_check; 5352 phba->hw_check.function = (TIMER_FUNC_TYPE)beiscsi_hw_health_check;
5355 mod_timer(&phba->hw_check, 5353 mod_timer(&phba->hw_check,
5356 jiffies + msecs_to_jiffies(BEISCSI_UE_DETECT_INTERVAL)); 5354 jiffies + msecs_to_jiffies(BEISCSI_UE_DETECT_INTERVAL));
5357 return 0; 5355 return 0;
@@ -5708,9 +5706,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
5708 * Start UE detection here. UE before this will cause stall in probe 5706 * Start UE detection here. UE before this will cause stall in probe
5709 * and eventually fail the probe. 5707 * and eventually fail the probe.
5710 */ 5708 */
5711 init_timer(&phba->hw_check); 5709 timer_setup(&phba->hw_check, beiscsi_hw_health_check, 0);
5712 phba->hw_check.function = beiscsi_hw_health_check;
5713 phba->hw_check.data = (unsigned long)phba;
5714 mod_timer(&phba->hw_check, 5710 mod_timer(&phba->hw_check,
5715 jiffies + msecs_to_jiffies(BEISCSI_UE_DETECT_INTERVAL)); 5711 jiffies + msecs_to_jiffies(BEISCSI_UE_DETECT_INTERVAL));
5716 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, 5712 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,