Skip to contentSkip to conversation

scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed()

PATCH Applied Keoseong Park 4 participants 5 messages Jun 28, 2021 – Jul 24, 2021 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20210628055801epcms2p449fdffa1a6c801497d7e65bae2896b79@epcms2p4

#1 lore raw

PATCH v2 1/1 scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed()

Simplify if else statement to return statement,
and remove code related to CONFIG_SCSI_UFS_DWC that is not in use.

v1 -> v2
Remove code related to CONFIG_SCSI_UFS_DWC that is not in use.

---
 drivers/scsi/ufs/ufshcd.h | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/scsi/ufs/ufshcd.h +2 -10
index c98d540ac044..c9faca237290 100644
@@ -893,16 +893,8 @@ 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))
-		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)
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1
#3 lore raw
In reply to Keoseong Park
Quoted 23 lines · Keoseong Park

Simplify if else statement to return statement,
and remove code related to CONFIG_SCSI_UFS_DWC that is not in use.

v1 -> v2
Remove code related to CONFIG_SCSI_UFS_DWC that is not in use.

---
 drivers/scsi/ufs/ufshcd.h | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/scsi/ufs/ufshcd.h +0 -3
index c98d540ac044..c9faca237290 100644
@@ -893,16 +893,8 @@ 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) &&

drivers/scsi/ufs/ufshcd.h static inline bool ufshcd_is_rpm_autosuspend_allowed(struct ufs_hba *hba) · line 898

Quoted 10 lines
drivers/scsi/ufs/ufshcd.h +2 -7
-	    !(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR))
-		return true;
-	else
-		return false;
-#else
-return true;
-#endif
+	return (hba->caps & UFSHCD_CAP_INTR_AGGR) &&
+		!(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR);
 }
#4 lore raw
In reply to Keoseong Park

Keoseong,

Quoted 2 lines

Simplify if else statement to return statement, and remove code related to CONFIG_SCSI_UFS_DWC that is not in use.

Applied to 5.15/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#5 lore raw
In reply to Keoseong Park
Quoted 5 lines · Keoseong Park

Simplify if else statement to return statement,
and remove code related to CONFIG_SCSI_UFS_DWC that is not in use.

v1 -> v2
Remove code related to CONFIG_SCSI_UFS_DWC that is not in use.

Applied to 5.15/scsi-queue, thanks!

[1/1] scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed()

      https://git.kernel.org/mkp/scsi/c/1c0810e79cb3
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering