Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3598669pxj; Mon, 21 Jun 2021 02:19:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYujdpR9PeLCPvvpogX0s+x4uQglbLzaWNUnsFNYLYu4d/0G7F/esYpL5l++ST9CNkndxd X-Received: by 2002:aa7:da14:: with SMTP id r20mr18926084eds.36.1624267196658; Mon, 21 Jun 2021 02:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624267196; cv=none; d=google.com; s=arc-20160816; b=T+qVQUsv0CyQk2OH3t/tBp7877ZwVbKX5Hxi0yjQ8aFKThm1jtfOkLUnfkK7nyG5UP rvE/aAR9fjEABY30xD79iAxqyZrdYqernJ+3GlyEOjZiRZilUB6UAQ30/JGq6tjodLic N+uBAm8Aag1QvRcuMntum8Cw5AnzKUxrvuY5HOc2sT1Pmb1JlHMlM/Sl49eiRagW1i2K 7joyrVc8+k+apbR70U8PxLgoNGYFdx+TCospGx0EPVmmFAG1gO0mSDZgPV+IdvSrLjT3 EGyuzjZZ+jUo8OzlVbVQ5C7k1OAZ4AjCk3EUIhPkRkaEmWJ1TIXDu8NEgM8YLWmJV5Jw Plqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:content-transfer-encoding:date :message-id:to:from:sender:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=BkLKe4A7FHy8X5Pp4d78LtN0pOn1oXblP8uasI6bamk=; b=kG8ziOy8QcqdnwJeyRqrKq0TtBlhYAhKTka4B+3tixi+Z/VwuY881RyWiZ35Ojj2un eXRpb7ASpYEAkETiNgrBvLmDMuqUiCls4vks7WNjQvSgJFXtbY49F1ejva8XnW+FnEDs BY0F75cmUQl3KAk1zQLG232UwnEiztXio1ZYJIMetwNvAPQNUPlQyvE7pNp2OXjEsW9z travdUWQ3fvFjDAt0mxjQFyFXwskqHvJkJekY/xFbL9FUiE6E+sURJWwJ87BTLvRR3L5 orF1onh1wWuaScmndqdMaLrxSmvV2Kn531p6t3co6ft55g0QIBJk4UW11/1FF7go0DOT CYoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cGw0vsPB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si6227423ejl.264.2021.06.21.02.19.34; Mon, 21 Jun 2021 02:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cGw0vsPB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230318AbhFUJUS (ORCPT + 99 others); Mon, 21 Jun 2021 05:20:18 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:31944 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbhFUJUS (ORCPT ); Mon, 21 Jun 2021 05:20:18 -0400 Received: from epcas3p2.samsung.com (unknown [182.195.41.20]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210621091802epoutp045eda835644717c7ce84c00317e5bc502~Kjk5SAe1C1107811078epoutp04- for ; Mon, 21 Jun 2021 09:18:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210621091802epoutp045eda835644717c7ce84c00317e5bc502~Kjk5SAe1C1107811078epoutp04- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1624267082; bh=BkLKe4A7FHy8X5Pp4d78LtN0pOn1oXblP8uasI6bamk=; h=Subject:Reply-To:From:To:Date:References:From; b=cGw0vsPBp+r59+Hpm4FyvYSEa/Om3Wvf8ZRdY6f6GL5imA0V4KgLY5O5AevztdSlC QqrCMWAD1UsDoC3Oo+GLrvgTmPzzqNybcmKJjhCHxnGyX1zHk5OkqgcJTWrrjqMTNd awzTmk0E5/jL1AE0ZkBjRl8B8hgKfFPD+pLELO8A= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas3p2.samsung.com (KnoxPortal) with ESMTP id 20210621091801epcas3p297e4cb21fcb590a8f291978aab6a3f7d~Kjk4pjCQx3249532495epcas3p2i; Mon, 21 Jun 2021 09:18:01 +0000 (GMT) Received: from epcpadp4 (unknown [182.195.40.18]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4G7kTP6gcYz4x9QJ; Mon, 21 Jun 2021 09:18:01 +0000 (GMT) Mime-Version: 1.0 Subject: [PATCH] scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed() Reply-To: keosung.park@samsung.com Sender: Keoseong Park From: Keoseong Park To: "joe@perches.com" , ALIM AKHTAR , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "beanhuo@micron.com" , "asutoshd@codeaurora.org" , "adrian.hunter@intel.com" , Kiwoong Kim , "satyat@google.com" , "bvanassche@acm.org" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL 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: <1891546521.01624267081897.JavaMail.epsvc@epcpadp4> Date: Mon, 21 Jun 2021 17:51:58 +0900 X-CMS-MailID: 20210621085158epcms2p46170ba48174547df00b9720dbc843110 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20210621085158epcms2p46170ba48174547df00b9720dbc843110 References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change conditional compilation to IS_ENABLED macro, and simplify if else statement to return statement. No functional change. Signed-off-by: Keoseong Park --- drivers/scsi/ufs/ufshcd.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index c98d540ac044..6d239a855753 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -893,16 +893,15 @@ static inline bool ufshcd_is_rpm_autosuspend_allowed(struct ufs_hba *hba) static inline bool ufshcd_is_intr_aggr_allowed(struct ufs_hba *hba) { -/* DWC UFS Core has the Interrupt aggregation feature but is not detectable*/ -#ifndef CONFIG_SCSI_UFS_DWC - if ((hba->caps & UFSHCD_CAP_INTR_AGGR) && - !(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR)) + /* + * DWC UFS Core has the Interrupt aggregation feature + * but is not detectable. + */ + if (IS_ENABLED(CONFIG_SCSI_UFS_DWC)) return true; - else - return false; -#else -return true; -#endif + + return (hba->caps & UFSHCD_CAP_INTR_AGGR) && + !(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR); } static inline bool ufshcd_can_aggressive_pc(struct ufs_hba *hba) -- 2.17.1