Commit 06caeb53 authored by Po-Wen Kao's avatar Po-Wen Kao Committed by Martin K. Petersen

scsi: ufs: core: Rename symbol sizeof_utp_transfer_cmd_desc()

Naming the functions after standard operators like sizeof() may cause
confusion. Rename it to ufshcd_get_ucd_size().
Signed-off-by: default avatarPo-Wen Kao <powen.kao@mediatek.com>
Link: https://lore.kernel.org/r/20230504154454.26654-3-powen.kao@mediatek.comSuggested-by: default avatarManivannan Sadhasivam <mani@kernel.org>
Reviewed-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Reviewed-by: default avatarZiqi Chen <quic_ziqichen@quicinc.com>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5149452c
...@@ -265,7 +265,7 @@ static int ufshcd_mcq_get_tag(struct ufs_hba *hba, ...@@ -265,7 +265,7 @@ static int ufshcd_mcq_get_tag(struct ufs_hba *hba,
addr = (le64_to_cpu(cqe->command_desc_base_addr) & CQE_UCD_BA) - addr = (le64_to_cpu(cqe->command_desc_base_addr) & CQE_UCD_BA) -
hba->ucdl_dma_addr; hba->ucdl_dma_addr;
return div_u64(addr, sizeof_utp_transfer_cmd_desc(hba)); return div_u64(addr, ufshcd_get_ucd_size(hba));
} }
static void ufshcd_mcq_process_cqe(struct ufs_hba *hba, static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,
......
...@@ -2849,10 +2849,10 @@ static void ufshcd_map_queues(struct Scsi_Host *shost) ...@@ -2849,10 +2849,10 @@ static void ufshcd_map_queues(struct Scsi_Host *shost)
static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i) static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
{ {
struct utp_transfer_cmd_desc *cmd_descp = (void *)hba->ucdl_base_addr + struct utp_transfer_cmd_desc *cmd_descp = (void *)hba->ucdl_base_addr +
i * sizeof_utp_transfer_cmd_desc(hba); i * ufshcd_get_ucd_size(hba);
struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr; struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr;
dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr + dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr +
i * sizeof_utp_transfer_cmd_desc(hba); i * ufshcd_get_ucd_size(hba);
u16 response_offset = offsetof(struct utp_transfer_cmd_desc, u16 response_offset = offsetof(struct utp_transfer_cmd_desc,
response_upiu); response_upiu);
u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table); u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table);
...@@ -3761,7 +3761,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba) ...@@ -3761,7 +3761,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba)
size_t utmrdl_size, utrdl_size, ucdl_size; size_t utmrdl_size, utrdl_size, ucdl_size;
/* Allocate memory for UTP command descriptors */ /* Allocate memory for UTP command descriptors */
ucdl_size = sizeof_utp_transfer_cmd_desc(hba) * hba->nutrs; ucdl_size = ufshcd_get_ucd_size(hba) * hba->nutrs;
hba->ucdl_base_addr = dmam_alloc_coherent(hba->dev, hba->ucdl_base_addr = dmam_alloc_coherent(hba->dev,
ucdl_size, ucdl_size,
&hba->ucdl_dma_addr, &hba->ucdl_dma_addr,
...@@ -3861,7 +3861,7 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba) ...@@ -3861,7 +3861,7 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba)
prdt_offset = prdt_offset =
offsetof(struct utp_transfer_cmd_desc, prd_table); offsetof(struct utp_transfer_cmd_desc, prd_table);
cmd_desc_size = sizeof_utp_transfer_cmd_desc(hba); cmd_desc_size = ufshcd_get_ucd_size(hba);
cmd_desc_dma_addr = hba->ucdl_dma_addr; cmd_desc_dma_addr = hba->ucdl_dma_addr;
for (i = 0; i < hba->nutrs; i++) { for (i = 0; i < hba->nutrs; i++) {
...@@ -8452,7 +8452,7 @@ static void ufshcd_release_sdb_queue(struct ufs_hba *hba, int nutrs) ...@@ -8452,7 +8452,7 @@ static void ufshcd_release_sdb_queue(struct ufs_hba *hba, int nutrs)
{ {
size_t ucdl_size, utrdl_size; size_t ucdl_size, utrdl_size;
ucdl_size = sizeof_utp_transfer_cmd_desc(hba) * nutrs; ucdl_size = ufshcd_get_ucd_size(hba) * nutrs;
dmam_free_coherent(hba->dev, ucdl_size, hba->ucdl_base_addr, dmam_free_coherent(hba->dev, ucdl_size, hba->ucdl_base_addr,
hba->ucdl_dma_addr); hba->ucdl_dma_addr);
......
...@@ -1133,7 +1133,7 @@ static inline size_t ufshcd_sg_entry_size(const struct ufs_hba *hba) ...@@ -1133,7 +1133,7 @@ static inline size_t ufshcd_sg_entry_size(const struct ufs_hba *hba)
({ (void)(hba); BUILD_BUG_ON(sg_entry_size != sizeof(struct ufshcd_sg_entry)); }) ({ (void)(hba); BUILD_BUG_ON(sg_entry_size != sizeof(struct ufshcd_sg_entry)); })
#endif #endif
static inline size_t sizeof_utp_transfer_cmd_desc(const struct ufs_hba *hba) static inline size_t ufshcd_get_ucd_size(const struct ufs_hba *hba)
{ {
return sizeof(struct utp_transfer_cmd_desc) + SG_ALL * ufshcd_sg_entry_size(hba); return sizeof(struct utp_transfer_cmd_desc) + SG_ALL * ufshcd_sg_entry_size(hba);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment