summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinwoo Im <minwoo.im@samsung.com>2024-05-20 01:14:57 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2024-05-31 03:45:39 +0300
commite8a1d87b7983b461d1d625e2973cdaadc0bd8ff5 (patch)
treedf293d681153dc993f824a0d3c2d032fc7287ff9 /include
parent2fc39848952dfb91a9233563cc1444669b8e79c3 (diff)
downloadlinux-e8a1d87b7983b461d1d625e2973cdaadc0bd8ff5.tar.xz
scsi: ufs: mcq: Convert MCQ_CFG_n to an inline function
Inline functions are preferred over macros. Convert the MCQ_CFG_n macro to an inline function. Signed-off-by: Minwoo Im <minwoo.im@samsung.com> Link: https://lore.kernel.org/r/20240519221457.772346-3-minwoo.im@samsung.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/ufs/ufshcd.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 1150b86e9355..df68fb1d4f3f 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1130,6 +1130,8 @@ struct ufs_hw_queue {
struct mutex sq_mutex;
};
+#define MCQ_QCFG_SIZE 0x40
+
static inline bool is_mcq_enabled(struct ufs_hba *hba)
{
return hba->mcq_enabled;
@@ -1141,6 +1143,11 @@ static inline unsigned int ufshcd_mcq_opr_offset(struct ufs_hba *hba,
return hba->mcq_opr[opr].offset + hba->mcq_opr[opr].stride * idx;
}
+static inline unsigned int ufshcd_mcq_cfg_offset(unsigned int reg, int idx)
+{
+ return reg + MCQ_QCFG_SIZE * idx;
+}
+
#ifdef CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE
static inline size_t ufshcd_sg_entry_size(const struct ufs_hba *hba)
{