Skip to content

Commit 06caeb5

Browse files
powen-kao-mtkmartinkpetersen
authored andcommitted
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: Po-Wen Kao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Suggested-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Stanley Chu <[email protected]> Reviewed-by: Ziqi Chen <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 5149452 commit 06caeb5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

drivers/ufs/core/ufs-mcq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int ufshcd_mcq_get_tag(struct ufs_hba *hba,
265265
addr = (le64_to_cpu(cqe->command_desc_base_addr) & CQE_UCD_BA) -
266266
hba->ucdl_dma_addr;
267267

268-
return div_u64(addr, sizeof_utp_transfer_cmd_desc(hba));
268+
return div_u64(addr, ufshcd_get_ucd_size(hba));
269269
}
270270

271271
static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,

drivers/ufs/core/ufshcd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,10 +2849,10 @@ static void ufshcd_map_queues(struct Scsi_Host *shost)
28492849
static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
28502850
{
28512851
struct utp_transfer_cmd_desc *cmd_descp = (void *)hba->ucdl_base_addr +
2852-
i * sizeof_utp_transfer_cmd_desc(hba);
2852+
i * ufshcd_get_ucd_size(hba);
28532853
struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr;
28542854
dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr +
2855-
i * sizeof_utp_transfer_cmd_desc(hba);
2855+
i * ufshcd_get_ucd_size(hba);
28562856
u16 response_offset = offsetof(struct utp_transfer_cmd_desc,
28572857
response_upiu);
28582858
u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table);
@@ -3761,7 +3761,7 @@ static int ufshcd_memory_alloc(struct ufs_hba *hba)
37613761
size_t utmrdl_size, utrdl_size, ucdl_size;
37623762

37633763
/* Allocate memory for UTP command descriptors */
3764-
ucdl_size = sizeof_utp_transfer_cmd_desc(hba) * hba->nutrs;
3764+
ucdl_size = ufshcd_get_ucd_size(hba) * hba->nutrs;
37653765
hba->ucdl_base_addr = dmam_alloc_coherent(hba->dev,
37663766
ucdl_size,
37673767
&hba->ucdl_dma_addr,
@@ -3861,7 +3861,7 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba)
38613861
prdt_offset =
38623862
offsetof(struct utp_transfer_cmd_desc, prd_table);
38633863

3864-
cmd_desc_size = sizeof_utp_transfer_cmd_desc(hba);
3864+
cmd_desc_size = ufshcd_get_ucd_size(hba);
38653865
cmd_desc_dma_addr = hba->ucdl_dma_addr;
38663866

38673867
for (i = 0; i < hba->nutrs; i++) {
@@ -8452,7 +8452,7 @@ static void ufshcd_release_sdb_queue(struct ufs_hba *hba, int nutrs)
84528452
{
84538453
size_t ucdl_size, utrdl_size;
84548454

8455-
ucdl_size = sizeof_utp_transfer_cmd_desc(hba) * nutrs;
8455+
ucdl_size = ufshcd_get_ucd_size(hba) * nutrs;
84568456
dmam_free_coherent(hba->dev, ucdl_size, hba->ucdl_base_addr,
84578457
hba->ucdl_dma_addr);
84588458

include/ufs/ufshcd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ static inline size_t ufshcd_sg_entry_size(const struct ufs_hba *hba)
11331133
({ (void)(hba); BUILD_BUG_ON(sg_entry_size != sizeof(struct ufshcd_sg_entry)); })
11341134
#endif
11351135

1136-
static inline size_t sizeof_utp_transfer_cmd_desc(const struct ufs_hba *hba)
1136+
static inline size_t ufshcd_get_ucd_size(const struct ufs_hba *hba)
11371137
{
11381138
return sizeof(struct utp_transfer_cmd_desc) + SG_ALL * ufshcd_sg_entry_size(hba);
11391139
}

0 commit comments

Comments
 (0)