scsi: ufs: core: Remove three superfluous casts
authorBart Van Assche <bvanassche@acm.org>
Wed, 20 Oct 2021 21:40:22 +0000 (14:40 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 27 Oct 2021 03:24:50 +0000 (23:24 -0400)
Casting an int explicitly to u16 when passed as an argument to a function
is not necessary.

Since prd_table and ucd_prdt_ptr both have type struct ufshcd_sg_entry *,
remove the casts from assignments of these two to each other.

This patch does not change any functionality.

Link: https://lore.kernel.org/r/20211020214024.2007615-9-bvanassche@acm.org
Acked-by: Avri Altman <Avri.Altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index 0739aa566725d663c61b3838424cb925bd07956f..7ea0588247b0e6a804797478a38988a83485525c 100644 (file)
@@ -2374,9 +2374,9 @@ static int ufshcd_map_sg(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
                                        sizeof(struct ufshcd_sg_entry)));
                else
                        lrbp->utr_descriptor_ptr->prd_table_length =
-                               cpu_to_le16((u16) (sg_segments));
+                               cpu_to_le16(sg_segments);
 
-               prd_table = (struct ufshcd_sg_entry *)lrbp->ucd_prdt_ptr;
+               prd_table = lrbp->ucd_prdt_ptr;
 
                scsi_for_each_sg(cmd, sg, sg_segments, i) {
                        prd_table[i].size  =
@@ -2668,7 +2668,7 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
        lrb->ucd_req_dma_addr = cmd_desc_element_addr;
        lrb->ucd_rsp_ptr = (struct utp_upiu_rsp *)cmd_descp[i].response_upiu;
        lrb->ucd_rsp_dma_addr = cmd_desc_element_addr + response_offset;
-       lrb->ucd_prdt_ptr = (struct ufshcd_sg_entry *)cmd_descp[i].prd_table;
+       lrb->ucd_prdt_ptr = cmd_descp[i].prd_table;
        lrb->ucd_prdt_dma_addr = cmd_desc_element_addr + prdt_offset;
 }