* [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
@ 2020-05-09 8:42 ` Wei Yongjun
0 siblings, 0 replies; 9+ messages in thread
From: Wei Yongjun @ 2020-05-09 8:42 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Matthias Brugger, Erin Lo
Cc: Wei Yongjun, linux-remoteproc, linux-arm-kernel, linux-mediatek,
kernel-janitors, Hulk Robot
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.
Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/remoteproc/mtk_scp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 2bead57c9cf9..ac13e7b046a6 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
(struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
scp->send_buf =
(struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
- memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
- memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
+ memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
+ memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
return 0;
}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
@ 2020-05-09 8:42 ` Wei Yongjun
0 siblings, 0 replies; 9+ messages in thread
From: Wei Yongjun @ 2020-05-09 8:42 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Matthias Brugger, Erin Lo
Cc: kernel-janitors, linux-remoteproc, Hulk Robot, linux-mediatek,
Wei Yongjun, linux-arm-kernel
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.
Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/remoteproc/mtk_scp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 2bead57c9cf9..ac13e7b046a6 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
(struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
scp->send_buf (struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
- memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
- memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
+ memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
+ memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
return 0;
}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
@ 2020-05-09 8:42 ` Wei Yongjun
0 siblings, 0 replies; 9+ messages in thread
From: Wei Yongjun @ 2020-05-09 8:42 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Matthias Brugger, Erin Lo
Cc: kernel-janitors, linux-remoteproc, Hulk Robot, linux-mediatek,
Wei Yongjun, linux-arm-kernel
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.
Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/remoteproc/mtk_scp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 2bead57c9cf9..ac13e7b046a6 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
(struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
scp->send_buf =
(struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
- memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
- memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
+ memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
+ memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
return 0;
}
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
@ 2020-05-09 8:42 ` Wei Yongjun
0 siblings, 0 replies; 9+ messages in thread
From: Wei Yongjun @ 2020-05-09 8:42 UTC (permalink / raw)
To: Ohad Ben-Cohen, Bjorn Andersson, Matthias Brugger, Erin Lo
Cc: kernel-janitors, linux-remoteproc, Hulk Robot, linux-mediatek,
Wei Yongjun, linux-arm-kernel
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.
Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/remoteproc/mtk_scp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 2bead57c9cf9..ac13e7b046a6 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
(struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
scp->send_buf =
(struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
- memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
- memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
+ memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
+ memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
return 0;
}
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
2020-05-09 8:42 ` Wei Yongjun
(?)
(?)
@ 2020-05-11 17:45 ` Mathieu Poirier
-1 siblings, 0 replies; 9+ messages in thread
From: Mathieu Poirier @ 2020-05-11 17:45 UTC (permalink / raw)
To: Wei Yongjun
Cc: Ohad Ben-Cohen, Bjorn Andersson, Matthias Brugger, Erin Lo,
linux-remoteproc, linux-arm-kernel, linux-mediatek,
kernel-janitors, Hulk Robot
On Sat, 9 May 2020 at 02:38, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> sizeof() when applied to a pointer typed expression gives the
> size of the pointer, not that of the pointed data.
>
> Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/remoteproc/mtk_scp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 2bead57c9cf9..ac13e7b046a6 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
> (struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
> scp->send_buf =
> (struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
> - memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
> - memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
> + memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
> + memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>
> return 0;
> }
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
@ 2020-05-11 17:45 ` Mathieu Poirier
0 siblings, 0 replies; 9+ messages in thread
From: Mathieu Poirier @ 2020-05-11 17:45 UTC (permalink / raw)
To: Wei Yongjun
Cc: Ohad Ben-Cohen, kernel-janitors, Erin Lo, linux-remoteproc,
Bjorn Andersson, Hulk Robot, linux-mediatek, Matthias Brugger,
linux-arm-kernel
On Sat, 9 May 2020 at 02:38, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> sizeof() when applied to a pointer typed expression gives the
> size of the pointer, not that of the pointed data.
>
> Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/remoteproc/mtk_scp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 2bead57c9cf9..ac13e7b046a6 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
> (struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
> scp->send_buf > (struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
> - memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
> - memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
> + memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
> + memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>
> return 0;
> }
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
@ 2020-05-11 17:45 ` Mathieu Poirier
0 siblings, 0 replies; 9+ messages in thread
From: Mathieu Poirier @ 2020-05-11 17:45 UTC (permalink / raw)
To: Wei Yongjun
Cc: Ohad Ben-Cohen, kernel-janitors, Erin Lo, linux-remoteproc,
Bjorn Andersson, Hulk Robot, linux-mediatek, Matthias Brugger,
linux-arm-kernel
On Sat, 9 May 2020 at 02:38, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> sizeof() when applied to a pointer typed expression gives the
> size of the pointer, not that of the pointed data.
>
> Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/remoteproc/mtk_scp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 2bead57c9cf9..ac13e7b046a6 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
> (struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
> scp->send_buf =
> (struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
> - memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
> - memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
> + memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
> + memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>
> return 0;
> }
>
>
>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
@ 2020-05-11 17:45 ` Mathieu Poirier
0 siblings, 0 replies; 9+ messages in thread
From: Mathieu Poirier @ 2020-05-11 17:45 UTC (permalink / raw)
To: Wei Yongjun
Cc: Ohad Ben-Cohen, kernel-janitors, Erin Lo, linux-remoteproc,
Bjorn Andersson, Hulk Robot, linux-mediatek, Matthias Brugger,
linux-arm-kernel
On Sat, 9 May 2020 at 02:38, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> sizeof() when applied to a pointer typed expression gives the
> size of the pointer, not that of the pointed data.
>
> Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/remoteproc/mtk_scp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 2bead57c9cf9..ac13e7b046a6 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -132,8 +132,8 @@ static int scp_ipi_init(struct mtk_scp *scp)
> (struct mtk_share_obj __iomem *)(scp->sram_base + recv_offset);
> scp->send_buf =
> (struct mtk_share_obj __iomem *)(scp->sram_base + send_offset);
> - memset_io(scp->recv_buf, 0, sizeof(scp->recv_buf));
> - memset_io(scp->send_buf, 0, sizeof(scp->send_buf));
> + memset_io(scp->recv_buf, 0, sizeof(*scp->recv_buf));
> + memset_io(scp->send_buf, 0, sizeof(*scp->send_buf));
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>
> return 0;
> }
>
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
2020-05-09 8:42 ` Wei Yongjun
` (3 preceding siblings ...)
(?)
@ 2020-05-11 19:40 ` patchwork-bot+linux-remoteproc
-1 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-05-11 19:40 UTC (permalink / raw)
To: Wei Yongjun; +Cc: linux-remoteproc
Hello:
This patch was applied to andersson/remoteproc.git (refs/heads/for-next).
On Sat, 9 May 2020 08:42:37 +0000 you wrote:
> sizeof() when applied to a pointer typed expression gives the
> size of the pointer, not that of the pointed data.
>
> Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> [...]
Here is a summary with links:
- [-next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
https://git.kernel.org/andersson/remoteproc/c/8096f80a5c09b716be207eb042c4e40d6cdefbd2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-05-11 19:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 8:42 [PATCH -next] remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init() Wei Yongjun
2020-05-09 8:42 ` Wei Yongjun
2020-05-09 8:42 ` Wei Yongjun
2020-05-09 8:42 ` Wei Yongjun
2020-05-11 17:45 ` Mathieu Poirier
2020-05-11 17:45 ` Mathieu Poirier
2020-05-11 17:45 ` Mathieu Poirier
2020-05-11 17:45 ` Mathieu Poirier
2020-05-11 19:40 ` patchwork-bot+linux-remoteproc
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.