remoteproc/mediatek: fix invalid use of sizeof in scp_ipi_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Sat, 9 May 2020 08:42:37 +0000 (08:42 +0000)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 11 May 2020 18:28:30 +0000 (11:28 -0700)
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Fixes: 63c13d61eafe ("remoteproc/mediatek: add SCP support for mt8183")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200509084237.36293-1-weiyongjun1@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/mtk_scp.c

index ea3743e..1ebad70 100644 (file)
@@ -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;
 }