Commit 0d4aec13 authored by Manuel Schölling's avatar Manuel Schölling Committed by Christoph Hellwig

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: default avatarManuel Schölling <manuel.schoelling@gmx.de>
Reviewed-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 1aee383d
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment