[U-Boot] [PATCH] spi: cadence_qspi: Fix warning cast from pointer to integer of different size

Ley Foon Tan lftan.linux at gmail.com
Fri Jun 1 08:24:33 UTC 2018


On Fri, Jun 1, 2018 at 4:07 PM, Marek Vasut <marek.vasut at gmail.com> wrote:
> On 05/07/2018 11:42 AM, Ley Foon Tan wrote:
>> Cast to ulong data type.
>>
>> Compilation warning as below:
>>
>>   CC      spl/drivers/spi/cadence_qspi_apb.o
>>   LD      spl/lib/built-in.o
>> drivers/spi/cadence_qspi_apb.c: In function ‘cadence_qspi_apb_indirect_write_setup’:
>> drivers/spi/cadence_qspi_apb.c:696:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>>           cmdlen, (unsigned int)cmdbuf);
>>
>> Signed-off-by: Ley Foon Tan <ley.foon.tan at intel.com>
>> ---
>>  drivers/spi/cadence_qspi_apb.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/spi/cadence_qspi_apb.c b/drivers/spi/cadence_qspi_apb.c
>> index aa3a9ff..5bef0ae 100644
>> --- a/drivers/spi/cadence_qspi_apb.c
>> +++ b/drivers/spi/cadence_qspi_apb.c
>> @@ -692,8 +692,8 @@ int cadence_qspi_apb_indirect_write_setup(struct cadence_spi_platdata *plat,
>>       unsigned int addr_bytes = cmdlen > 4 ? 4 : 3;
>>
>>       if (cmdlen < 4 || cmdbuf == NULL) {
>> -             printf("QSPI: iInvalid input argument, len %d cmdbuf 0x%08x\n",
>> -                    cmdlen, (unsigned int)cmdbuf);
>> +             printf("QSPI: Invalid input argument, len %d cmdbuf 0x%08lx\n",
>> +                    cmdlen, (unsigned long)cmdbuf);
>
> %p ?
Yes, can use %p.
>
>>               return -EINVAL;
>>       }
>>       /* Setup the indirect trigger address */
>>
>
>

Regards
Ley Foon


More information about the U-Boot mailing list