[PATCH 1/2] powerpc/4xx/ocm: Fix phys_addr_t printf warnings

Michael Ellerman mpe at ellerman.id.au
Wed Jan 2 22:12:52 AEDT 2019


LEROY Christophe <christophe.leroy at c-s.fr> writes:

> Michael Ellerman <mpe at ellerman.id.au> a écrit :
>
>> Currently the code produces several warnings, eg:
>>
>>   arch/powerpc/platforms/4xx/ocm.c:240:38: error: format '%llx'
>>   expects argument of type 'long long unsigned int', but argument 3
>>   has type 'phys_addr_t {aka unsigned int}'
>>      seq_printf(m, "PhysAddr     : 0x%llx\n", ocm->phys);
>>                                    ~~~^     ~~~~~~~~~
>>
>> Fix it by using the special %pa[p] format for printing phys_addr_t.
>> Note we need to pass the value by reference for the special specifier
>> to work.
>
> When I fixed the same problem in prom.c, you suggested to simply cast  
> it to unsigned long long. Is this a better solution ?

Did I?

Oh you mean here:
  https://patchwork.ozlabs.org/patch/1012875/


Yeah I was just commenting on the ifdef, I didn't actually realise it
was a phys_addr_t that was the cause of the problem.

So yeah I guess it is preferable to use %pa[p] in prom.c as well.

cheers


More information about the Linuxppc-dev mailing list