[-next] mtd: rawnand: cadence: Change types of function parameters keeping DMA address
diff mbox series

Message ID 1575546963-436-1-git-send-email-piotrs@cadence.com
State Superseded
Delegated to: Miquel Raynal
Headers show
Series
  • [-next] mtd: rawnand: cadence: Change types of function parameters keeping DMA address
Related show

Commit Message

Piotr Sroka Dec. 5, 2019, 11:55 a.m. UTC
It was changed to avoid compilation warnings during type casting.

Signed-off-by: Piotr Sroka <piotrs@cadence.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 drivers/mtd/nand/raw/cadence-nand-controller.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Miquel Raynal Jan. 9, 2020, 7:20 p.m. UTC | #1
Hi Piotr,

Piotr Sroka <piotrs@cadence.com> wrote on Thu, 5 Dec 2019 12:55:58
+0100:

> It was changed to avoid compilation warnings during type casting.
> 
> Signed-off-by: Piotr Sroka <piotrs@cadence.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> ---

I just realized that I received three patches for the same issue about
a month ago, yours was totally valid but I choose to apply the one from
someone not contributing a lot to encourage him, hope you don't mind :)

Cheers,
Miquèl
Piotr Sroka Jan. 10, 2020, 9:45 a.m. UTC | #2
The 01/09/2020 20:20, Miquel Raynal wrote:

Hi Miquel

>
>Hi Piotr,
>
>Piotr Sroka <piotrs@cadence.com> wrote on Thu, 5 Dec 2019 12:55:58
>+0100:
>
>> It was changed to avoid compilation warnings during type casting.
>>
>> Signed-off-by: Piotr Sroka <piotrs@cadence.com>
>> Reported-by: kbuild test robot <lkp@intel.com>
>> ---
>
>I just realized that I received three patches for the same issue about
>a month ago, yours was totally valid but I choose to apply the one from
>someone not contributing a lot to encourage him, hope you don't mind :)
>
>Cheers,
>Miquèl
>

I don't mind :), most importantly it's fixed.

Thanks
Piotr

Patch
diff mbox series

diff --git a/drivers/mtd/nand/raw/cadence-nand-controller.c b/drivers/mtd/nand/raw/cadence-nand-controller.c
index 3a36285..222a5fb 100644
--- a/drivers/mtd/nand/raw/cadence-nand-controller.c
+++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
@@ -914,8 +914,8 @@  static void cadence_nand_get_caps(struct cdns_nand_ctrl *cdns_ctrl)
 /* Prepare CDMA descriptor. */
 static void
 cadence_nand_cdma_desc_prepare(struct cdns_nand_ctrl *cdns_ctrl,
-			       char nf_mem, u32 flash_ptr, char *mem_ptr,
-			       char *ctrl_data_ptr, u16 ctype)
+			       char nf_mem, u32 flash_ptr, dma_addr_t data,
+			       dma_addr_t ctrl_data, u16 ctype)
 {
 	struct cadence_nand_cdma_desc *cdma_desc = cdns_ctrl->cdma_desc;
 
@@ -931,13 +931,13 @@  cadence_nand_cdma_desc_prepare(struct cdns_nand_ctrl *cdns_ctrl,
 	cdma_desc->command_flags |= CDMA_CF_DMA_MASTER;
 	cdma_desc->command_flags  |= CDMA_CF_INT;
 
-	cdma_desc->memory_pointer = (uintptr_t)mem_ptr;
+	cdma_desc->memory_pointer = (u64)data;
 	cdma_desc->status = 0;
 	cdma_desc->sync_flag_pointer = 0;
 	cdma_desc->sync_arguments = 0;
 
 	cdma_desc->command_type = ctype;
-	cdma_desc->ctrl_data_ptr = (uintptr_t)ctrl_data_ptr;
+	cdma_desc->ctrl_data_ptr = (u64)ctrl_data;
 }
 
 static u8 cadence_nand_check_desc_error(struct cdns_nand_ctrl *cdns_ctrl,
@@ -1280,8 +1280,7 @@  cadence_nand_cdma_transfer(struct cdns_nand_ctrl *cdns_ctrl, u8 chip_nr,
 	}
 
 	cadence_nand_cdma_desc_prepare(cdns_ctrl, chip_nr, page,
-				       (void *)dma_buf, (void *)dma_ctrl_dat,
-				       ctype);
+				       dma_buf, dma_ctrl_dat, ctype);
 
 	status = cadence_nand_cdma_send_and_wait(cdns_ctrl, thread_nr);
 
@@ -1360,7 +1359,7 @@  static int cadence_nand_erase(struct nand_chip *chip, u32 page)
 
 	cadence_nand_cdma_desc_prepare(cdns_ctrl,
 				       cdns_chip->cs[chip->cur_cs],
-				       page, NULL, NULL,
+				       page, 0, 0,
 				       CDMA_CT_ERASE);
 	status = cadence_nand_cdma_send_and_wait(cdns_ctrl, thread_nr);
 	if (status) {