2019-12-05 11:59:02

by Piotr Sroka

[permalink] [raw]
Subject: [PATCH -next] mtd: rawnand: cadence: Change types of function parameters keeping DMA address

It was changed to avoid compilation warnings during type casting.

Signed-off-by: Piotr Sroka <[email protected]>
Reported-by: kbuild test robot <[email protected]>
---
drivers/mtd/nand/raw/cadence-nand-controller.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

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) {
--
2.4.5


2020-01-09 20:46:13

by Miquel Raynal

[permalink] [raw]
Subject: Re: [PATCH -next] mtd: rawnand: cadence: Change types of function parameters keeping DMA address

Hi Piotr,

Piotr Sroka <[email protected]> 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 <[email protected]>
> Reported-by: kbuild test robot <[email protected]>
> ---

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

2020-01-10 09:49:12

by Piotr Sroka

[permalink] [raw]
Subject: Re: [PATCH -next] mtd: rawnand: cadence: Change types of function parameters keeping DMA address

The 01/09/2020 20:20, Miquel Raynal wrote:

Hi Miquel

>
>Hi Piotr,
>
>Piotr Sroka <[email protected]> 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 <[email protected]>
>> Reported-by: kbuild test robot <[email protected]>
>> ---
>
>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