From patchwork Mon Feb 28 03:14:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qing Wang X-Patchwork-Id: 546934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B188EC433F5 for ; Mon, 28 Feb 2022 03:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232845AbiB1DP2 (ORCPT ); Sun, 27 Feb 2022 22:15:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232837AbiB1DP1 (ORCPT ); Sun, 27 Feb 2022 22:15:27 -0500 Received: from APC01-HK2-obe.outbound.protection.outlook.com (mail-eopbgr1300105.outbound.protection.outlook.com [40.107.130.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0433442A3A; Sun, 27 Feb 2022 19:14:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l/skoICyKsJklN6lpptYI0ThbIAQEjTUxka7HgTAzrbYFAR+43qxemHqM2YIFpkaOI2iqN9DFrT8jl1botpKz/a+PA+azavFPsTrEQn+Ahjj3kSWmvlT5wjZfBHVkiTgBSjborsN+5N90n6mqN6VU9urdHbCzGfnh/y8jzTZG8ed/j7cIqKRIHEVrb8S7PVXNxdd5h6bZoq0MnwjtvmtzVwrkH9pvvjJI/0bRRzoTSDbfnICjJ9iFrGpEeAz0wWBCTOpDNsfO7Iu504unHcS3aAnIkXWHQm1B0gnIbzPtqgf2P3hxH8Xoh1HJReSDXnkwTS2iUp9xQIJibah9fPWNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9DIunlOKZ7xnX+jKC9TibBPSsJYjDz2RS/GfaLBd/uI=; b=iykODSbERHuQfV11Kc8QC8m38RnIB30WK3y1fP8wArjG7Sh4zAktBraPKM6HWmFDmGEHQMOrnAr1OVEAwsAAYhENZ+IG5wvEelfjw9h8VKVzD0yWKUCzyajmWfOlq3I9ZYcdlkCTaEOvwP6TfzNmxILJqkU02ZAsEin7cEK/sd6DBO7zw8tyjy64U3CCBPPgy+BnSbgPAWCxwF4SffnE8j2/cwpYsLmHJt289s9G7ZhYShCJ5c6sOEm2UirC+9/JnpfHLTAl1wdADd1AvVsumlNENHsC4ESnL14iQ8KumfJW/zwfkzWqdUHpA+cMMc8Q2F1FUTP3zOWqE3OAsTB8EA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9DIunlOKZ7xnX+jKC9TibBPSsJYjDz2RS/GfaLBd/uI=; b=KmQE1yxiPcJpNlzdMxcPwJHGCbuSLDDmxSmAIXLetZS2fEUA6SwvYbEsJ4GAX7THwmDx+aMxyf1I4NkYXT8O1J+Y4TrGme6tb9kWR6yY/3nAY5JwLFS59KXhxpYBWKJhkqxNnJnn2iEFl1uWCdk5bRkz1Lmu8YjuYhq2S2MaZRo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) by PS2PR06MB2454.apcprd06.prod.outlook.com (2603:1096:300:45::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.23; Mon, 28 Feb 2022 03:14:47 +0000 Received: from SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::49ef:baa:8c3b:cb3d]) by SL2PR06MB3082.apcprd06.prod.outlook.com ([fe80::49ef:baa:8c3b:cb3d%5]) with mapi id 15.20.5017.026; Mon, 28 Feb 2022 03:14:47 +0000 From: Qing Wang To: Anil Gurumurthy , Sudarsana Kalluru , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] scsi: bfa: use time_is_before_jiffies() instead of open coding it Date: Sun, 27 Feb 2022 19:14:35 -0800 Message-Id: <1646018075-61321-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-ClientProxiedBy: SG2PR06CA0176.apcprd06.prod.outlook.com (2603:1096:1:1e::30) To SL2PR06MB3082.apcprd06.prod.outlook.com (2603:1096:100:37::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13b59f91-547b-4e6d-8480-08d9fa68796e X-MS-TrafficTypeDiagnostic: PS2PR06MB2454:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qpt1EaH0n4Zr3WisLTkbLJaeFY1gf6T+g7Dbv8sxKZed7Z1+CW/78aQ/Ex8AdwwUGb0vMYi8OXkHqGjEzNc9Wxk62j95Kn1dfXOMBo8KIaXQQtpzKH54TkuZPuN8r3MJdi7s391BqOCzAopbLpQb8QLu1ZYhYxc7ZQF3swFktZhIPZezCZZMoDqfHnZPvb2L+zzOQz4wg/fHSUDMZJhLWSSqowfKmcKS5pfjsOG6Q/N/K5TWkQlKbVE/l/F4Xeia81UOS2GFVpYzyskEKxaRbp9ffYEmuinu++V1DFIkCyD4V2RcB2JE6sBPKv3zD9bGpq+RfZNYjbuFVGsW+1kSlVM8cm4HbDEqB2haZkFkVD0FNO4Cspp9yQsq1Fb7hMTp1JY4gbQWKrCjJlvuR05rqpDkzbF+KADY5t7LDqLf4U8cGa+UrACvvGK56UdYZ3zBIDKdb7Y8D4lib+OovIcN2wXw3MIIsDLf82P+vLOXARdppfxVZVC4tj2PyVFSpfZ/ZHSfI6RybvJvV7IWW6J6oI7984k0aOgIAI/gVblx2DzCRX30QCH7WNhjszz89IIr1WP/yr/WWqAQ8ZsNrDweVPGsDjQAOE+0SOr+8UK3lunmRIz36d37NthCxZs2G3IR67wGUNlDefs02VWx5qQ7R9ESaCZkkT1KBOJt6DI/RIL3xxn/oQBbGylYfrKSaSHHghPA64rkGE6dXB6LKkzyGQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SL2PR06MB3082.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(5660300002)(66556008)(66476007)(66946007)(316002)(4326008)(2906002)(86362001)(38100700002)(38350700002)(8936002)(52116002)(6506007)(6512007)(8676002)(186003)(26005)(107886003)(2616005)(83380400001)(6666004)(110136005)(6486002)(508600001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VP26WbaaOyeqIpx/1lHRqZ4FTeApAQuujihtiKZMkqAjAAH1Bv/aKd5GxZiID/gVS4U/j4v3T6vEq4L74wMwnY2NwkMPxVnVN5U1KI/Q8SjZSxcPhh7Mhaug2xdpv66rMn8iGGhuVGlW70gD52PPr8sPlgp2YgAawiiGsBVaMwZVkd2TfdDHwtRCxdxiNIfvGUeiQqzqoWcOHLgthNBFHm4kFAjpUkj846TGOeO90y0seBKjmaRQD+/dEE2bSeJSpHC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0M2jUQd4Njb9p4HyiaVOkcgHcgBSARbtObkCpkLN/2vZF2Urnt9yXM6cC0g3AgGEs7GjkUM/biiYWeobddKgJHUBg3r+NV/rJlxPvjkv7p/vqHxW6cXTptGKmuxL7+45sCVcfXFpbW9UoV0n81F9NgkYUwYw9try72E+Om7b11BAFH8wVcG14pq90GeVUP7SN/k/ej/qVSnWLLL5upKgoKl/gx4ZfGKwe+JjJnw+D3fYfygp69b2JMVboBgxFDNz5/IfKwUiF8B2J/pjRWJePoVaFNZKBkHDI0+cEde5Ol8XLCWkwk0jFYQ= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13b59f91-547b-4e6d-8480-08d9fa68796e X-MS-Exchange-CrossTenant-AuthSource: SL2PR06MB3082.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2022 03:14:47.2339 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NWHRmduPfb5+LO9mjX0Vis0h+nfGplZClpB//D8eARTEBiCY9sq5KMFdDBMa967DyCR3RS5XP4Mq8kF0fvDN+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS2PR06MB2454 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Wang Qing Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing --- 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 +#include #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) {