remoteproc: qcom: Fix devm_ioremap_resource_wc() checking
Subsystems (2)
cover remoteproc: qcom: Fix devm_ioremap_resource_wc() checking
The devm_ioremap_resource_wc() function returns error pointers and not NULL. I don't know, if you'll want to fold these patches all together or not. Or into the original patch, perhaps?
Dan Carpenter (4):
remoteproc: qcom: Fix a NULL vs IS_ERR() check in
adsp_alloc_memory_region()
remoteproc: qcom: pas: Fix a couple NULL vs IS_ERR() bugs
remoteproc: qcom: Fix NULL vs IS_ERR() bug in
q6v5_alloc_memory_region()
remoteproc: qcom_wcnss: Fix NULL vs IS_ERR() bug in
wcnss_alloc_memory_region()
drivers/remoteproc/qcom_q6v5_adsp.c | 5 +++-- drivers/remoteproc/qcom_q6v5_pas.c | 8 ++++---- drivers/remoteproc/qcom_q6v5_wcss.c | 4 ++-- drivers/remoteproc/qcom_wcnss.c | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-)
Signature · 1 line
2.51.0
PATCH 1/4 remoteproc: qcom_q6v5_adsp: Fix a NULL vs IS_ERR() check in adsp_alloc_memory_region()
The devm_ioremap_resource_wc() function never returns NULL, it returns error pointers. Update the check to match.
--- drivers/remoteproc/qcom_q6v5_adsp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/remoteproc/qcom_q6v5_adsp.c +3 -2
@@ -637,9 +637,10 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp) adsp->mem_phys = adsp->mem_reloc = res.start; adsp->mem_size =resource_size (&res); adsp->mem_region =devm_ioremap_resource_wc (adsp->dev, &res); -if (!adsp->mem_region) { +if (IS_ERR (adsp->mem_region)) {dev_err (adsp->dev,"unable to map memory region: %pR\n" , &res); -return -EBUSY ; +return PTR_ERR (adsp->mem_region); + }return 0 ;
Signature · 1 line
2.51.0
PATCH 2/4 remoteproc: qcom: pas: Fix a couple NULL vs IS_ERR() bugs
In reply to Dan CarpenterThe devm_ioremap_resource_wc() function never returns NULL, it returns error pointers. Update the checking to match.
--- drivers/remoteproc/qcom_q6v5_pas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/remoteproc/qcom_q6v5_pas.c +4 -4
@@ -559,9 +559,9 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas) pas->mem_phys = pas->mem_reloc = res.start; pas->mem_size =resource_size (&res); pas->mem_region =devm_ioremap_resource_wc (pas->dev, &res); -if (!pas->mem_region) { +if (IS_ERR (pas->mem_region)) {dev_err (pas->dev,"unable to map memory region: %pR\n" , &res); -return -EBUSY ; +return PTR_ERR (pas->mem_region); }if (!pas->dtb_pas_id)
@@ -576,9 +576,9 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas) pas->dtb_mem_phys = pas->dtb_mem_reloc = res.start; pas->dtb_mem_size =resource_size (&res); pas->dtb_mem_region =devm_ioremap_resource_wc (pas->dev, &res); -if (!pas->dtb_mem_region) { +if (IS_ERR (pas->dtb_mem_region)) {dev_err (pas->dev,"unable to map dtb memory region: %pR\n" , &res); -return -EBUSY ; +return PTR_ERR (pas->dtb_mem_region); }return 0 ;
Signature · 1 line
2.51.0
PATCH 3/4 remoteproc: qcom: q6v5: Fix NULL vs IS_ERR() bug in q6v5_alloc_memory_region()
In reply to Dan CarpenterThe devm_ioremap_resource_wc() function never returns NULL, it returns error pointers. Update the checking to match.
--- drivers/remoteproc/qcom_q6v5_wcss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +2 -2
@@ -887,9 +887,9 @@ static int q6v5_alloc_memory_region(struct q6v5_wcss *wcss) wcss->mem_reloc = res.start; wcss->mem_size =resource_size (&res); wcss->mem_region =devm_ioremap_resource_wc (dev, &res); -if (!wcss->mem_region) { +if (IS_ERR (wcss->mem_region)) {dev_err (dev,"unable to map memory region: %pR\n" , &res); -return -EBUSY ; +return PTR_ERR (wcss->mem_region); }return 0 ;
Signature · 1 line
2.51.0
PATCH 4/4 remoteproc: qcom_wcnss: Fix NULL vs IS_ERR() bug in wcnss_alloc_memory_region()
In reply to Dan CarpenterThe devm_ioremap_resource_wc() function never returns NULL, it returns error pointers. Update the checking to match.
--- drivers/remoteproc/qcom_wcnss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/qcom_wcnss.c +2 -2
@@ -538,9 +538,9 @@ static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss) wcnss->mem_phys = wcnss->mem_reloc = res.start; wcnss->mem_size =resource_size (&res); wcnss->mem_region =devm_ioremap_resource_wc (wcnss->dev, &res); -if (!wcnss->mem_region) { +if (IS_ERR (wcnss->mem_region)) {dev_err (wcnss->dev,"unable to map memory region: %pR\n" , &res); -return -EBUSY ; +return PTR_ERR (wcnss->mem_region); }return 0 ;
Signature · 1 line
2.51.0
Quoted 3 lines · Dan Carpenter
The
devm_ioremap_resource_wc()function returns error pointers and not NULL. I don't know, if you'll want to fold these patches all together or not. Or into the original patch, perhaps?
Thanks for catching this!
Konrad