• Arnd Bergmann's avatar
    remoteproc: stm32: use correct format strings on 64-bit · 03bd158e
    Arnd Bergmann authored
    With CONFIG_ARCH_STM32 making it into arch/arm64, a couple of format
    strings no longer work, since they rely on size_t being compatible
    with %x, or they print an 'int' using %z:
    
    drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_mem_alloc':
    drivers/remoteproc/stm32_rproc.c:122:22: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
    drivers/remoteproc/stm32_rproc.c:122:40: note: format string is defined here
      122 |         dev_dbg(dev, "map memory: %pa+%x\n", &mem->dma, mem->len);
          |                                       ~^
          |                                        |
          |                                        unsigned int
          |                                       %lx
    drivers/remoteproc/stm32_rproc.c:125:30: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=]
    drivers/remoteproc/stm32_rproc.c:125:65: note: format string is defined here
      125 |                 dev_err(dev, "Unable to map memory region: %pa+%x\n",
          |                                                                ~^
          |                                                                 |
          |                                                                 unsigned int
          |                                                                %lx
    drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_get_loaded_rsc_table':
    drivers/remoteproc/stm32_rproc.c:646:30: error: format '%zx' expects argument of type 'size_t', but argument 4 has type 'int' [-Werror=format=]
    drivers/remoteproc/stm32_rproc.c:646:66: note: format string is defined here
      646 |                 dev_err(dev, "Unable to map memory region: %pa+%zx\n",
          |                                                                ~~^
          |                                                                  |
          |                                                                  long unsigned int
          |                                                                %x
    
    Fix up all three instances to work across architectures, and enable
    compile testing for this driver to ensure it builds everywhere.
    Reviewed-by: default avatarArnaud Pouliquen <arnaud.pouliquen@foss.st.com>
    Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    03bd158e
Kconfig 11.3 KB