* [PATCH 6/19] lpfc 10.4.8000.0: Use time_after()
@ 2014-09-03 16:55 James Smart
0 siblings, 0 replies; only message in thread
From: James Smart @ 2014-09-03 16:55 UTC (permalink / raw)
To: linux-scsi
Incorporating prior patch:
http://marc.info/?l=linux-scsi&m=140053378307936&w=2
manuel.schoelling@gmx.de
[PATCH] lpfc: Use time_after()
To be future-proof and for better readability the time comparisons
are modified to use time_after() instead of plain, error-prone math.
Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Reviewed-by: James Smart <james.smart@emulex.com>
---
drivers/scsi/lpfc/lpfc_scsi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 3c250e3..6094545 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -380,12 +380,14 @@ lpfc_rampdown_queue_depth(struct lpfc_hba *phba)
{
unsigned long flags;
uint32_t evt_posted;
+ unsigned long expires;
spin_lock_irqsave(&phba->hbalock, flags);
atomic_inc(&phba->num_rsrc_err);
phba->last_rsrc_error_time = jiffies;
- if ((phba->last_ramp_down_time + QUEUE_RAMP_DOWN_INTERVAL) > jiffies) {
+ expires = phba->last_ramp_down_time + QUEUE_RAMP_DOWN_INTERVAL;
+ if (time_after(expires, jiffies)) {
spin_unlock_irqrestore(&phba->hbalock, flags);
return;
}
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-09-03 16:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03 16:55 [PATCH 6/19] lpfc 10.4.8000.0: Use time_after() James Smart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox