diff mbox series

scsi: bfa: Convert to use time_after macro

Message ID 20230706103705.79755-1-zhangzehao@vivo.com
State New
Headers show
Series scsi: bfa: Convert to use time_after macro | expand

Commit Message

Zehao Zhang July 6, 2023, 10:37 a.m. UTC
Use time_after macro instead of opening it for readability.

Signed-off-by: Zehao Zhang <zhangzehao@vivo.com>
---
 drivers/scsi/bfa/bfad_im.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index a9d3d8562d3c..c1a5f527b04c 100644
--- 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,10 +871,10 @@  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) >
-		BFA_QUEUE_FULL_RAMP_UP_TIME * HZ) &&
-		((jiffies - itnim->last_queue_full_time) >
-		BFA_QUEUE_FULL_RAMP_UP_TIME * HZ)) {
+	if ((time_after(jiffies, itnim->last_ramp_up_time +
+		 BFA_QUEUE_FULL_RAMP_UP_TIME * HZ)) &&
+		(time_after(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) {
 				if (tmp_sdev->id != sdev->id)