summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorManuel Schölling2014-09-03 18:55:58 +0200
committerChristoph Hellwig2014-09-16 18:10:06 +0200
commit0d4aec132d8ad6303981db08a52d64b0dbe59e97 (patch)
tree93e68f1aaf0090ef4a71abf7821f5544e6f9ffa4 /drivers/scsi
parentlpfc: use dma_zalloc_coherent (diff)
downloadkernel-qcow2-linux-0d4aec132d8ad6303981db08a52d64b0dbe59e97.tar.gz
kernel-qcow2-linux-0d4aec132d8ad6303981db08a52d64b0dbe59e97.tar.xz
kernel-qcow2-linux-0d4aec132d8ad6303981db08a52d64b0dbe59e97.zip
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> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 3c250e3e41ca..6094545883a3 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;
}