Patch "remoteproc: stm32: use correct format strings on 64-bit" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    remoteproc: stm32: use correct format strings on 64-bit

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     remoteproc-stm32-use-correct-format-strings-on-64-bi.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 59e5406fd618a73501269fb96e9646d4fcad4484
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Fri Jun 9 12:45:42 2023 +0200

    remoteproc: stm32: use correct format strings on 64-bit
    
    [ Upstream commit 03bd158e1535e68bcd2b1e095b0ebcad7c84bd20 ]
    
    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: Arnaud Pouliquen <arnaud.pouliquen@xxxxxxxxxxx>
    Acked-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Tested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Stable-dep-of: 32381bbccba4 ("remoteproc: stm32: Fix incorrect type in assignment for va")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index 1660197866531..d93113b6ffaa1 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -313,7 +313,7 @@ config ST_SLIM_REMOTEPROC
 
 config STM32_RPROC
 	tristate "STM32 remoteproc support"
-	depends on ARCH_STM32
+	depends on ARCH_STM32 || COMPILE_TEST
 	depends on REMOTEPROC
 	select MAILBOX
 	help
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index 8746cbb1f168d..e432febf4337b 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -118,10 +118,10 @@ static int stm32_rproc_mem_alloc(struct rproc *rproc,
 	struct device *dev = rproc->dev.parent;
 	void *va;
 
-	dev_dbg(dev, "map memory: %pa+%x\n", &mem->dma, mem->len);
+	dev_dbg(dev, "map memory: %pad+%zx\n", &mem->dma, mem->len);
 	va = ioremap_wc(mem->dma, mem->len);
 	if (IS_ERR_OR_NULL(va)) {
-		dev_err(dev, "Unable to map memory region: %pa+%x\n",
+		dev_err(dev, "Unable to map memory region: %pad+0x%zx\n",
 			&mem->dma, mem->len);
 		return -ENOMEM;
 	}
@@ -627,7 +627,7 @@ stm32_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz)
 
 	ddata->rsc_va = devm_ioremap_wc(dev, rsc_pa, RSC_TBL_SIZE);
 	if (IS_ERR_OR_NULL(ddata->rsc_va)) {
-		dev_err(dev, "Unable to map memory region: %pa+%zx\n",
+		dev_err(dev, "Unable to map memory region: %pa+%x\n",
 			&rsc_pa, RSC_TBL_SIZE);
 		ddata->rsc_va = NULL;
 		return ERR_PTR(-ENOMEM);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux