From patchwork Thu Aug 4 07:49:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinyoung CHOI X-Patchwork-Id: 595445 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 814D4C19F2C for ; Thu, 4 Aug 2022 07:49:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239231AbiHDHtf (ORCPT ); Thu, 4 Aug 2022 03:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbiHDHtd (ORCPT ); Thu, 4 Aug 2022 03:49:33 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFA4061D90 for ; Thu, 4 Aug 2022 00:49:31 -0700 (PDT) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220804074930epoutp012473b8d9075737ae912e516a14331e2a~IFNWIPu511214812148epoutp01r for ; Thu, 4 Aug 2022 07:49:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220804074930epoutp012473b8d9075737ae912e516a14331e2a~IFNWIPu511214812148epoutp01r DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1659599370; bh=wVOPOUxiNLaJA3Ek+mRYptXK+j9kErlnygcOfRzp26c=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=uPKHVP3cHElmhaAXng6OFkJ6GbCHvrsi73VEOkUGMX+YYGLVrSwLT7d61pdJwUVMI JzmGv6urX6g7RRW6GUSXr08CsjinU1a70V2JyfffmBDa6a93nK9E8gpkyYdH2ckRA9 5YgK0fjHG5C6yrKEfplnCa0P1w+IXYU5qB61vHVg= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20220804074929epcas2p4b909a08e306a765d9d74bddb9f7ebe87~IFNVtEqkX2674526745epcas2p4g; Thu, 4 Aug 2022 07:49:29 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.98]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Lz18S728Lz4x9Pw; Thu, 4 Aug 2022 07:49:28 +0000 (GMT) X-AuditID: b6c32a48-9e1ff700000025be-46-62eb7a08a30a Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 33.F6.09662.80A7BE26; Thu, 4 Aug 2022 16:49:28 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v7 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" , "stanley.chu@mediatek.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220804074224epcms2p18f0ac2f92073aeed981718a9cab23866@epcms2p1> 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: <20220804074928epcms2p86582693a39597501b491400a28543a92@epcms2p8> Date: Thu, 04 Aug 2022 16:49:28 +0900 X-CMS-MailID: 20220804074928epcms2p86582693a39597501b491400a28543a92 X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y CMS-TYPE: 102P X-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jV+6w95d ljmU/enmwb9lS/jVRIMmGiquPWf4S+X+ElYD3ylr52V4bjl0RvR7S9Qj79kMR1u8yiV9JDKW Xvv1/NhdkbIlVc9ktl1rX54j2Xzi0LLP9vcn/RCcfSbP/zbLtJO2m9ycI/+41sYmbA3yVahO dMlRWZDWZbLDQjPKyLqXp85iaSn3TKHGJ9H6lS4Jl6dPV2Ipzkg01GIuKk4EADQvNCE5BAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220804074224epcms2p18f0ac2f92073aeed981718a9cab23866 References: <20220804074224epcms2p18f0ac2f92073aeed981718a9cab23866@epcms2p1> 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);