[PATCH] ARM: dma-mapping: Use %zu for printing a size_t variable

Matthias Brugger matthias.bgg at gmail.com
Mon Jul 18 09:23:06 PDT 2016



On 07/18/2016 06:11 PM, Fabio Estevam wrote:
> On Mon, Jul 18, 2016 at 1:03 PM, Matthias Brugger
> <matthias.bgg at gmail.com> wrote:
>
>> size_t should be formated as %zu or %zx so %zx is fine here.
>
> We are printing memory size here, so we should better print it in
> decimal instead of hex.
>
> For example: let's suppose we want to print that 256kiB allocation failed.
>
> If we use %zu:
> DMA: failed to allocate 256KiB pool for atomic coherent allocation
>
> If we use %zx:
> DMA: failed to allocate 100KiB pool for atomic coherent allocation
>
> ,which is not really what we want.
>

Fair enough, didn't realize that.

Reviewed-by: Matthias Brugger <matthias.bgg at gmail.com>



More information about the linux-arm-kernel mailing list