Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp336322pxj; Wed, 23 Jun 2021 23:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd4A9TfucX2nfmOSztrgt3gx9gn4LQyKpg88uDa7X+PrEW7QrEDCzTz5gFlwSXxfsY/XIX X-Received: by 2002:a05:6402:d06:: with SMTP id eb6mr4909807edb.337.1624517505082; Wed, 23 Jun 2021 23:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624517505; cv=none; d=google.com; s=arc-20160816; b=oeZzVQO99DwvSf5AuE6GwHN9O2mnOyPKibKQAEwtzzGTw2cd6byquMFd+mJzlyiBT3 gHtEgGbYNOJvL77aMPW1Kaz2oQ1FfxXHrHlPsyNQ4C9iMe9xMV0DTebdZ0zqwUKfmFn+ g+z2vnIxtjwdnyJGvFIAIiiM8/5rMUkr0AOspyujdoTKbhy0gV8TsdEA2l2lXaZI2+fk gcfx44vB6fhMpELiUn3x4kmpBwXQmKgEbgRr9GpBkVqznvqauNZXEv+7dmCV6TDqjG/Z CfAnb0GESwBHWNR66/IhyGJ3t1E9cP0+ZnHRFfP9cjTBKP8hoy0uZXtvNK7UsxZo19Gl 1bug== 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:in-reply-to:to:from:sender:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=QIcr6Oc41EqkBdEds/yY4VF9Nkh1nPuSWQc5lqgGKhg=; b=0Hzpu/zQIvu/2AQzhe8sI3aAinLY8v4owIZ96b37UfO8OqwRSLpi5u0FxlX7a6fPGj tiHyPj8LscrpdUL37io+OmDfEfJKX7eihPriRviQCcxXzsq+4xdlyvtPpPMyo8Q2RfWu 3mEO8wSV7ZIgkHov3D3BL+8XDcYu5HwZc/xgfNN72nfqnmb4g3g0cVtABl9zG7sTTKUd aIW4GKlKrYfctyJgfDK0rysLK07Z/bOGxHGcUtXGYhyqWuM+9pJ61tBWdb5bjukgzyu6 r9dHURjpHpjkCOzvrYGgVTU8u7+F06EajngvvhxDIjasLpRIhOOy9oq4xwJbqGherU2q HmRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=P14oXzdb; 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 w10si2049919ejf.364.2021.06.23.23.51.21; Wed, 23 Jun 2021 23:51:45 -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=P14oXzdb; 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 S231349AbhFXGuX (ORCPT + 99 others); Thu, 24 Jun 2021 02:50:23 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:33012 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231261AbhFXGuX (ORCPT ); Thu, 24 Jun 2021 02:50:23 -0400 Received: from epcas3p3.samsung.com (unknown [182.195.41.21]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210624064803epoutp023f83db4e0536b10d7ff8ba235d915280~LcdylPG6X1066910669epoutp02H for ; Thu, 24 Jun 2021 06:48:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210624064803epoutp023f83db4e0536b10d7ff8ba235d915280~LcdylPG6X1066910669epoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1624517283; bh=QIcr6Oc41EqkBdEds/yY4VF9Nkh1nPuSWQc5lqgGKhg=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=P14oXzdb6twjGMxlqz/GQTv+cUHzwf4XAex+DHlY9gHZ2Hsi6ohWWZwhBKYOgdiqx a/ZPCPpNsB1Yj16eVTggZw7T0RL3AlWAU8BsrvIeQbaztq61M4z+8WKSkR6z1Gdkdm de6k1yXspgh9tbW5nfr/A3YqO33asWKN+BwTOSCo= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas3p3.samsung.com (KnoxPortal) with ESMTP id 20210624064802epcas3p3d8d9feae68fc3877e0c93c5ce8b03ab0~Lcdx_PYFp1683716837epcas3p3Z; Thu, 24 Jun 2021 06:48:02 +0000 (GMT) Received: from epcpadp4 (unknown [182.195.40.18]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4G9W0y2l05z4x9QR; Thu, 24 Jun 2021 06:48:02 +0000 (GMT) Mime-Version: 1.0 Subject: RE: Re: [PATCH] scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed() Reply-To: keosung.park@samsung.com Sender: Keoseong Park From: Keoseong Park To: Adrian Hunter , Keoseong Park , "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" , 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 In-Reply-To: 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: <37380050.31624517282371.JavaMail.epsvc@epcpadp4> Date: Thu, 24 Jun 2021 15:41:08 +0900 X-CMS-MailID: 20210624064108epcms2p11f1f3c58d9fbcecf9d3fec5b4ae01d71 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: <1891546521.01624267081897.JavaMail.epsvc@epcpadp4> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >On 21/06/21 11:51 am, Keoseong Park wrote: >> 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)) > >Why is this needed? It seems like you could just set UFSHCD_CAP_INTR_AGGR >and clear UFSHCD_QUIRK_BROKEN_INTR_AGGR instead? Hello Adrian, Sorry for late reply. The code that returns true when CONFIG_SCSI_UFS_DWC is set in the original code is only changed using the IS_ENABLED macro. (Linux kernel coding style, 21) Conditional Compilation) When CONFIG_SCSI_UFS_DWC is not defined, the code for checking quirk and caps has been moved to the newly added return statement below. Thanks, Keoseong > >> 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) >> >