Message ID | 1604473422-29639-1-git-send-email-sibis@codeaurora.org |
---|---|
State | Accepted |
Commit | 04ff5d19cf6e2f9dbdf137c0c6eb44934d46a99c |
Headers | show |
Series | [1/2] remoteproc: qcom_q6v5_mss: Replace ioremap with memremap | expand |
On Wed 04 Nov 01:03 CST 2020, Sibi Sankar wrote: > Fix the sparse warnings reported by the kernel test bot by replacing > ioremap calls with memremap. > > Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Regards, Bjorn > Signed-off-by: Sibi Sankar <sibis@codeaurora.org> > --- > > I'll send out the patches to convert ioremap to memremap on other > qc remoteproc drivers once I get a chance to test them. > > drivers/remoteproc/qcom_q6v5_mss.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c > index 9a473cfef758..2c866b6da23c 100644 > --- a/drivers/remoteproc/qcom_q6v5_mss.c > +++ b/drivers/remoteproc/qcom_q6v5_mss.c > @@ -1194,7 +1194,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) > goto release_firmware; > } > > - ptr = ioremap_wc(qproc->mpss_phys + offset, phdr->p_memsz); > + ptr = memremap(qproc->mpss_phys + offset, phdr->p_memsz, MEMREMAP_WC); > if (!ptr) { > dev_err(qproc->dev, > "unable to map memory region: %pa+%zx-%x\n", > @@ -1209,7 +1209,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) > "failed to load segment %d from truncated file %s\n", > i, fw_name); > ret = -EINVAL; > - iounmap(ptr); > + memunmap(ptr); > goto release_firmware; > } > > @@ -1221,7 +1221,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) > ptr, phdr->p_filesz); > if (ret) { > dev_err(qproc->dev, "failed to load %s\n", fw_name); > - iounmap(ptr); > + memunmap(ptr); > goto release_firmware; > } > > @@ -1232,7 +1232,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) > memset(ptr + phdr->p_filesz, 0, > phdr->p_memsz - phdr->p_filesz); > } > - iounmap(ptr); > + memunmap(ptr); > size += phdr->p_memsz; > > code_length = readl(qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG); > @@ -1299,11 +1299,11 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc, > } > > if (!ret) > - ptr = ioremap_wc(qproc->mpss_phys + offset + cp_offset, size); > + ptr = memremap(qproc->mpss_phys + offset + cp_offset, size, MEMREMAP_WC); > > if (ptr) { > memcpy(dest, ptr, size); > - iounmap(ptr); > + memunmap(ptr); > } else { > memset(dest, 0xff, size); > } > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 9a473cfef758..2c866b6da23c 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -1194,7 +1194,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) goto release_firmware; } - ptr = ioremap_wc(qproc->mpss_phys + offset, phdr->p_memsz); + ptr = memremap(qproc->mpss_phys + offset, phdr->p_memsz, MEMREMAP_WC); if (!ptr) { dev_err(qproc->dev, "unable to map memory region: %pa+%zx-%x\n", @@ -1209,7 +1209,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) "failed to load segment %d from truncated file %s\n", i, fw_name); ret = -EINVAL; - iounmap(ptr); + memunmap(ptr); goto release_firmware; } @@ -1221,7 +1221,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) ptr, phdr->p_filesz); if (ret) { dev_err(qproc->dev, "failed to load %s\n", fw_name); - iounmap(ptr); + memunmap(ptr); goto release_firmware; } @@ -1232,7 +1232,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) memset(ptr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz); } - iounmap(ptr); + memunmap(ptr); size += phdr->p_memsz; code_length = readl(qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG); @@ -1299,11 +1299,11 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc, } if (!ret) - ptr = ioremap_wc(qproc->mpss_phys + offset + cp_offset, size); + ptr = memremap(qproc->mpss_phys + offset + cp_offset, size, MEMREMAP_WC); if (ptr) { memcpy(dest, ptr, size); - iounmap(ptr); + memunmap(ptr); } else { memset(dest, 0xff, size); }
Fix the sparse warnings reported by the kernel test bot by replacing ioremap calls with memremap. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Sibi Sankar <sibis@codeaurora.org> --- I'll send out the patches to convert ioremap to memremap on other qc remoteproc drivers once I get a chance to test them. drivers/remoteproc/qcom_q6v5_mss.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)