Skip to contentSkip to conversation

remoteproc/mediatek: fix sparse errors

PATCH Applied Tzung-Bi Shih 4 participants 8 messages Nov 16, 2020 – Nov 24, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover remoteproc/mediatek: fix sparse errors

Changes from v1:
(https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/)
- separate into 2 patches
- provide the line numbers in commit messages

The series bases on https://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git/log/?h=for-next

Tzung-Bi Shih (2):
remoteproc/mediatek: fix sparse errors on sram power on and off remoteproc/mediatek: fix sparse errors on dma_alloc and dma_free

 drivers/remoteproc/mtk_common.h | 2 +-
 drivers/remoteproc/mtk_scp.c    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
Signature · 7 lines
2.29.2.299.gdc1121823c-goog


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#1 lore raw

PATCH v2 1/2 remoteproc/mediatek: fix sparse errors on sram power on and off

Fixes the following sparse errors on sram power on and off:

On drivers/remoteproc/mtk_scp.c:306:17:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:307:9:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:314:9:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:316:17:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

---
 drivers/remoteproc/mtk_scp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/mtk_scp.c +2 -2
index 577cbd5d421e..8ed89ea1eb78 100644
@@ -298,7 +298,7 @@ static int mt8183_scp_before_load(struct mtk_scp *scp)
 	return 0;
 }
 
-static void mt8192_power_on_sram(void *addr)
+static void mt8192_power_on_sram(void __iomem *addr)
 {
 	int i;
 
@@ -307,7 +307,7 @@ static void mt8192_power_on_sram(void *addr)
 	writel(0, addr);
 }
 
-static void mt8192_power_off_sram(void *addr)
+static void mt8192_power_off_sram(void __iomem *addr)
 {
 	int i;
 
Signature · 7 lines
2.29.2.299.gdc1121823c-goog


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] remoteproc/mediatek: fix sparse errors on sram power on and off

Quoted 18 lines · Tzung-Bi Shih

Fixes the following sparse errors on sram power on and off:

On drivers/remoteproc/mtk_scp.c:306:17:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:307:9:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:314:9:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

Quoted 4 lines

On drivers/remoteproc/mtk_scp.c:316:17:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

Quoted 29 lines
---
 drivers/remoteproc/mtk_scp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/mtk_scp.c +2 -3
index 577cbd5d421e..8ed89ea1eb78 100644
@@ -298,7 +298,7 @@ static int mt8183_scp_before_load(struct mtk_scp *scp)
        return 0;
 }
 
-static void mt8192_power_on_sram(void *addr)
+static void mt8192_power_on_sram(void __iomem *addr)
 {
        int i;
 
@@ -307,7 +307,7 @@ static void mt8192_power_on_sram(void *addr)
        writel(0, addr);
 }
 
-static void mt8192_power_off_sram(void *addr)
+static void mt8192_power_off_sram(void __iomem *addr)
 {
        int i;
 
--
Quoted 2 lines

2.29.2.299.gdc1121823c-goog

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

maintainer Reviewed-by on v2 1/2
#3 lore raw

Re: [PATCH v2 1/2] remoteproc/mediatek: fix sparse errors on sram power on and off

In reply to Tzung-Bi Shih
Quoted 42 lines · Tzung-Bi Shih

Fixes the following sparse errors on sram power on and off:

On drivers/remoteproc/mtk_scp.c:306:17:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:307:9:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:314:9:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

On drivers/remoteproc/mtk_scp.c:316:17:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] __iomem *addr
got void *addr

---
 drivers/remoteproc/mtk_scp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/mtk_scp.c +1 -1
index 577cbd5d421e..8ed89ea1eb78 100644
@@ -298,7 +298,7 @@ static int mt8183_scp_before_load(struct mtk_scp *scp)
 	return 0;
 }
 
-static void mt8192_power_on_sram(void *addr)
+static void mt8192_power_on_sram(void __iomem *addr)
 {
 	int i;
 

drivers/remoteproc/mtk_scp.c static void mt8192_power_on_sram(void *addr) · line 310

Quoted 5 lines
drivers/remoteproc/mtk_scp.c +1 -1
@@ -307,7 +307,7 @@ static void mt8192_power_on_sram(void *addr)
 	writel(0, addr);
 }
 
-static void mt8192_power_off_sram(void *addr)
+static void mt8192_power_off_sram(void __iomem *addr)
Quoted 6 lines
drivers/remoteproc/mtk_scp.c +0 -0
 {
 	int i;
 
Signature · 1 line
2.29.2.299.gdc1121823c-goog

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#4 lore raw

PATCH v2 2/2 remoteproc/mediatek: fix sparse errors on dma_alloc and dma_free

In reply to Tzung-Bi Shih

Fixes the following sparse errors on dma_alloc_coherent() and dma_free_coherent().

On drivers/remoteproc/mtk_scp.c:559:23:
warning: incorrect type in assignment (different address spaces)
expected void [noderef] __iomem *cpu_addr
got void *

On drivers/remoteproc/mtk_scp.c:572:56:
warning: incorrect type in argument 3 (different address spaces)
expected void *cpu_addr
got void [noderef] __iomem *cpu_addr

The cpu_addr is not a __iomem address. Removes the marker.

---
 drivers/remoteproc/mtk_common.h | 2 +-
 drivers/remoteproc/mtk_scp.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/mtk_common.h +1 -1
index 47b4561443a9..b3397d327786 100644
@@ -99,7 +99,7 @@ struct mtk_scp {
 	bool ipi_id_ack[SCP_IPI_MAX];
 	wait_queue_head_t ack_wq;
 
-	void __iomem *cpu_addr;
+	void *cpu_addr;
 	dma_addr_t dma_addr;
 	size_t dram_size;
 
drivers/remoteproc/mtk_scp.c +1 -1
index 8ed89ea1eb78..a1e23b5f19b9 100644
@@ -413,7 +413,7 @@ static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len)
 	} else if (scp->dram_size) {
 		offset = da - scp->dma_addr;
 		if (offset >= 0 && (offset + len) < scp->dram_size)
-			return (void __force *)scp->cpu_addr + offset;
+			return scp->cpu_addr + offset;
 	}
 
 	return NULL;
Signature · 7 lines
2.29.2.299.gdc1121823c-goog


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Reviewed-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] remoteproc/mediatek: fix sparse errors on dma_alloc and dma_free

Quoted 9 lines · Tzung-Bi Shih

Fixes the following sparse errors on dma_alloc_coherent() and dma_free_coherent().

On drivers/remoteproc/mtk_scp.c:559:23:
warning: incorrect type in assignment (different address spaces)
expected void [noderef] __iomem *cpu_addr
got void *

Quoted 7 lines

On drivers/remoteproc/mtk_scp.c:572:56:
warning: incorrect type in argument 3 (different address spaces)
expected void *cpu_addr
got void [noderef] __iomem *cpu_addr

The cpu_addr is not a __iomem address. Removes the marker.

Quoted 34 lines
---
 drivers/remoteproc/mtk_common.h | 2 +-
 drivers/remoteproc/mtk_scp.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/mtk_common.h +1 -1
index 47b4561443a9..b3397d327786 100644
@@ -99,7 +99,7 @@ struct mtk_scp {
        bool ipi_id_ack[SCP_IPI_MAX];
        wait_queue_head_t ack_wq;
 
-       void __iomem *cpu_addr;
+       void *cpu_addr;
        dma_addr_t dma_addr;
        size_t dram_size;
 
drivers/remoteproc/mtk_scp.c +1 -2
index 8ed89ea1eb78..a1e23b5f19b9 100644
@@ -413,7 +413,7 @@ static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len)
        } else if (scp->dram_size) {
                offset = da - scp->dma_addr;
                if (offset >= 0 && (offset + len) < scp->dram_size)
-                       return (void __force *)scp->cpu_addr + offset;
+                       return scp->cpu_addr + offset;
        }
 
        return NULL;
--
Quoted 2 lines

2.29.2.299.gdc1121823c-goog

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

maintainer Reviewed-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] remoteproc/mediatek: fix sparse errors on dma_alloc and dma_free

In reply to Tzung-Bi Shih
Quoted 40 lines · Tzung-Bi Shih

Fixes the following sparse errors on dma_alloc_coherent() and dma_free_coherent().

On drivers/remoteproc/mtk_scp.c:559:23:
warning: incorrect type in assignment (different address spaces)
expected void [noderef] __iomem *cpu_addr
got void *

On drivers/remoteproc/mtk_scp.c:572:56:
warning: incorrect type in argument 3 (different address spaces)
expected void *cpu_addr
got void [noderef] __iomem *cpu_addr

The cpu_addr is not a __iomem address. Removes the marker.

---
 drivers/remoteproc/mtk_common.h | 2 +-
 drivers/remoteproc/mtk_scp.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/mtk_common.h +1 -1
index 47b4561443a9..b3397d327786 100644
@@ -99,7 +99,7 @@ struct mtk_scp {
 	bool ipi_id_ack[SCP_IPI_MAX];
 	wait_queue_head_t ack_wq;
 
-	void __iomem *cpu_addr;
+	void *cpu_addr;
 	dma_addr_t dma_addr;
 	size_t dram_size;
 
drivers/remoteproc/mtk_scp.c +0 -0
index 8ed89ea1eb78..a1e23b5f19b9 100644

drivers/remoteproc/mtk_scp.c static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len) · line 416

Quoted 5 lines
drivers/remoteproc/mtk_scp.c +1 -1
@@ -413,7 +413,7 @@ static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len)
 	} else if (scp->dram_size) {
 		offset = da - scp->dma_addr;
 		if (offset >= 0 && (offset + len) < scp->dram_size)
-			return (void __force *)scp->cpu_addr + offset;
+			return scp->cpu_addr + offset;
Quoted 6 lines
drivers/remoteproc/mtk_scp.c +0 -0
 	}
 
 	return NULL;
Signature · 1 line
2.29.2.299.gdc1121823c-goog

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#7 lore raw
In reply to Tzung-Bi Shih
This series was applied to andersson/remoteproc.git (refs/heads/for-next):

Hello:

This series was applied to andersson/remoteproc.git (refs/heads/for-next):

Quoted 8 lines · On Mon, 16 Nov 2020 16:25:35 +0800 you wrote:

Changes from v1:
(https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/)
- separate into 2 patches
- provide the line numbers in commit messages

The series bases on https://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git/log/?h=for-next

[...]

Here is the summary with links:
- [v2,1/2] remoteproc/mediatek: fix sparse errors on sram power on and off

    https://git.kernel.org/andersson/remoteproc/c/778f2664fa34
  - [v2,2/2] remoteproc/mediatek: fix sparse errors on dma_alloc and dma_free
    https://git.kernel.org/andersson/remoteproc/c/903635cbc757

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html