OSDN Git Service

lpfc: use time_after()
authorManuel Schölling <manuel.schoelling@gmx.de>
Wed, 3 Sep 2014 16:55:58 +0000 (12:55 -0400)
committerChristoph Hellwig <hch@lst.de>
Tue, 16 Sep 2014 16:10:06 +0000 (09:10 -0700)
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>
drivers/scsi/lpfc/lpfc_scsi.c

index 3c250e3..6094545 100644 (file)
@@ -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;
        }