From patchwork Tue Aug 2 08:03:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung Choi X-Patchwork-Id: 12934365 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 7590DC00140 for ; Tue, 2 Aug 2022 08:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234777AbiHBIDv (ORCPT ); Tue, 2 Aug 2022 04:03:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233907AbiHBIDu (ORCPT ); Tue, 2 Aug 2022 04:03:50 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 489411208E for ; Tue, 2 Aug 2022 01:03:48 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220802080346epoutp013b1da5644cf0f125cf41f3e447d39dd3~HeHPeq2N32055220552epoutp01G for ; Tue, 2 Aug 2022 08:03:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220802080346epoutp013b1da5644cf0f125cf41f3e447d39dd3~HeHPeq2N32055220552epoutp01G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1659427426; bh=wVOPOUxiNLaJA3Ek+mRYptXK+j9kErlnygcOfRzp26c=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=Ek4jXdpXmKsPDHdmClONNcTDXXjdLK7Bbz4LLQAjkJ0gYocYF6yO3ZomBMW6/lC2d 0TlkpHk34tGNJKVFXo29VvF5bIMf8YUAmGWbnAWvodghFaDi3qvnDaH852BLYnip55 6TE4z+P3Exp9RcEjH665uI2jiLS3lPyxL9zgBpA4= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20220802080346epcas2p2b976ddc37fbfad80061bbd719912e8fd~HeHPC6OsW2861328613epcas2p2I; Tue, 2 Aug 2022 08:03:46 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.99]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4LxnYs5Sy4z4x9Py; Tue, 2 Aug 2022 08:03:45 +0000 (GMT) X-AuditID: b6c32a47-5e1ff700000025aa-65-62e8da618fae Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 59.D1.09642.16AD8E26; Tue, 2 Aug 2022 17:03:45 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v6 1/6] scsi: ufs: wb: Change wb_enabled condition test Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: ALIM AKHTAR , "avri.altman@wdc.com" , "bvanassche@acm.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "beanhuo@micron.com" , "adrian.hunter@intel.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stanley.chu@mediatek.com" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220802080146epcms2p24b86bfce3d3c09c79b91d861cb3b2cce@epcms2p2> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20220802080345epcms2p3c503408ed9064c87833922b8d7fca2a5@epcms2p3> Date: Tue, 02 Aug 2022 17:03:45 +0900 X-CMS-MailID: 20220802080345epcms2p3c503408ed9064c87833922b8d7fca2a5 X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CP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+/f8I1fcjkyQrbWdZykQuOeeydKp3+reeZ/V2fH4Z9+x qt1GEpyd8vU101ld1PZYK1x/UTnbJ6e7rLih+JPajQmHJrwyDJ+2ROvoc01LKxbu5IrEr3JT T23vX7kh6WbrHumaBcfPvXCsduF6NI9dvtmbWbibb9X2f0erk3Q3ye6Yv4Wj503WzdXZHn9a 717QWOxw89i1u8Zyv+bZiU7N+jeJqTtRcrXnFNdlZ+4f0P6hxFKckWioxVxUnAgAh0DelToE AAA= DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220802080146epcms2p24b86bfce3d3c09c79b91d861cb3b2cce References: <20220802080146epcms2p24b86bfce3d3c09c79b91d861cb3b2cce@epcms2p2> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Changed to improve readability. As implemented in ufshcd_wb_togle_flush(), the conditional test is modified in the same way. Reviewed-by: Avri Altman Reviewed-by: Bean Huo Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Jinyoung Choi --- drivers/ufs/core/ufshcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 0dc6437e956a..b7e7c0c4eb75 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5730,10 +5730,8 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable) { int ret; - if (!ufshcd_is_wb_allowed(hba)) - return 0; - - if (!(enable ^ hba->dev_info.wb_enabled)) + if (!ufshcd_is_wb_allowed(hba) || + hba->dev_info.wb_enabled == enable) return 0; ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_EN);