Skip to contentSkip to conversation

lpfc 10.4.8000.0: Use time_after()

PATCH Applied James Smart 1 participant 1 message Sep 3, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/19 lpfc 10.4.8000.0: Use time_after()

Incorporating prior patch:
http://marc.info/?l=linux-scsi&m=140053378307936&w=2

[email protected]
[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.

---
 drivers/scsi/lpfc/lpfc_scsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/lpfc/lpfc_scsi.c +3 -1
index 3c250e3..6094545 100644
@@ -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;
 	}
Signature · 9 lines
1.7.11.7




--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html