[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ed6d8c44-295e-aaa7-4b5f-7929c1c797d1@intel.com>
Date: Mon, 21 Jun 2021 12:29:58 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: keosung.park@...sung.com, "joe@...ches.com" <joe@...ches.com>,
ALIM AKHTAR <alim.akhtar@...sung.com>,
"avri.altman@....com" <avri.altman@....com>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
"cang@...eaurora.org" <cang@...eaurora.org>,
"beanhuo@...ron.com" <beanhuo@...ron.com>,
"asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
Kiwoong Kim <kwmad.kim@...sung.com>,
"satyat@...gle.com" <satyat@...gle.com>,
"bvanassche@....org" <bvanassche@....org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed()
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 <keosung.park@...sung.com>
> ---
> 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?
> 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)
>
Powered by blists - more mailing lists