From: Qing Wang <wangqing@vivo.com>
To: Anil Gurumurthy <anil.gurumurthy@qlogic.com>,
Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Wang Qing <wangqing@vivo.com>
Subject: [PATCH] scsi: bfa: use time_is_before_jiffies() instead of open coding it
Date: Sun, 27 Feb 2022 19:14:35 -0800 [thread overview]
Message-ID: <1646018075-61321-1-git-send-email-wangqing@vivo.com> (raw)
From: Wang Qing <wangqing@vivo.com>
Use the helper function time_is_{before,after}_jiffies() to improve
code readability.
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
drivers/scsi/bfa/bfad_im.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 759d2bb..41f49f5f
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -13,6 +13,7 @@
*/
#include <linux/export.h>
+#include <linux/jiffies.h>
#include "bfad_drv.h"
#include "bfad_im.h"
@@ -870,9 +871,9 @@ bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
{
struct scsi_device *tmp_sdev;
- if (((jiffies - itnim->last_ramp_up_time) >
+ if (time_is_before_jiffies(itnim->last_ramp_up_time +
BFA_QUEUE_FULL_RAMP_UP_TIME * HZ) &&
- ((jiffies - itnim->last_queue_full_time) >
+ time_is_before_jiffies(itnim->last_queue_full_time +
BFA_QUEUE_FULL_RAMP_UP_TIME * HZ)) {
shost_for_each_device(tmp_sdev, sdev->host) {
if (bfa_lun_queue_depth > tmp_sdev->queue_depth) {
--
2.7.4
reply other threads:[~2022-02-28 3:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1646018075-61321-1-git-send-email-wangqing@vivo.com \
--to=wangqing@vivo.com \
--cc=anil.gurumurthy@qlogic.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sudarsana.kalluru@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®