staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
Subsystems (4)
PATCH 1/1 staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
fixed sparse warning : incorrect type in argument 1
(different address spaces)
--- drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/staging/iio/adc/mxs-lradc.c +6 -3
@@ -1545,9 +1545,12 @@ static int mxs_lradc_probe(struct platform_device *pdev)/* Grab the memory area */ iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); lradc->dev = &pdev->dev; - lradc->base =devm_ioremap_resource (dev, iores); -if (IS_ERR (lradc->base)) -return PTR_ERR (lradc->base); +void *tempptr; + + tempptr =devm_ioremap_resource (dev, iores); +if (IS_ERR (tempptr)) +return PTR_ERR (tempptr); + lradc->base = tempptr; lradc->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (lradc->clk)) {
Signature · 1 line
1.8.1.2
Quoted 15 lines · Sudip Mukherjee
fixed sparse warning : incorrect type in argument 1
(different address spaces)Signed-off-by Sudip Mukherjee <[email protected]>--- drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/staging/iio/adc/mxs-lradc.c +0
-0@@ -1545,9 +1545,12 @@ static int mxs_lradc_probe(struct platform_device *pdev)/* Grab the memory area */ iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 );
drivers/staging/iio/adc/mxs-lradc.c static int mxs_lradc_probe(struct platform_device *pdev) · line 1553
Quoted 10 lines
drivers/staging/iio/adc/mxs-lradc.c +6
-3lradc->dev = &pdev->dev; - lradc->base =devm_ioremap_resource (dev, iores); -if (IS_ERR (lradc->base)) -return PTR_ERR (lradc->base); +void *tempptr; + + tempptr =devm_ioremap_resource (dev, iores); +if (IS_ERR (tempptr)) +return PTR_ERR (tempptr); + lradc->base = tempptr;
This makes no sense at all... devm_ioremap_resource() returns a iomem pointer lrdac->base is a iomem pointer.
Please make sure that you have the latest version of sparse installed on your system.
Quoted 4 lines
drivers/staging/iio/adc/mxs-lradc.c +0
-0lradc->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (lradc->clk)) {
please discard the patch. It generates additional sparse warning. sorry for it.
thanks
sudip
Quoted 21 lines · Lars-Peter Clausen
Quoted 20 lines · Sudip Mukherjee
fixed sparse warning : incorrect type in argument 1
(different address spaces)Signed-off-by Sudip Mukherjee <[email protected]>--- drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/staging/iio/adc/mxs-lradc.c +1
-3@@ -1545,9 +1545,12 @@ static int mxs_lradc_probe(struct platform_device *pdev)/* Grab the memory area */ iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); lradc->dev = &pdev->dev; - lradc->base =devm_ioremap_resource (dev, iores); -if (IS_ERR (lradc->base)) -return PTR_ERR (lradc->base); +void *tempptr;
Quoted 8 lines
drivers/staging/iio/adc/mxs-lradc.c static int mxs_lradc_probe(struct platform_device *pdev) · line 1553
Quoted 5 lines
drivers/staging/iio/adc/mxs-lradc.c +5
-0+ + tempptr =devm_ioremap_resource (dev, iores); +if (IS_ERR (tempptr)) +return PTR_ERR (tempptr); + lradc->base = tempptr;This makes no sense at all...
devm_ioremap_resource()returns a iomem pointerlrdac->baseis a iomem pointer.
sparse is giving warning for argument 1 of IS_ERR.
Quoted 9 lines
Please make sure that you have the latest version of sparse installed on your system.
Quoted 4 lines
drivers/staging/iio/adc/mxs-lradc.c +0
-0lradc->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (lradc->clk)) {
thanks
sudip
Quoted 31 lines · Sudip Mukherjee
Quoted 21 lines · Lars-Peter Clausen
Quoted 20 lines · Sudip Mukherjee
fixed sparse warning : incorrect type in argument 1
(different address spaces)Signed-off-by Sudip Mukherjee <[email protected]>--- drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/staging/iio/adc/mxs-lradc.c +1
-3@@ -1545,9 +1545,12 @@ static int mxs_lradc_probe(struct platform_device *pdev)/* Grab the memory area */ iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); lradc->dev = &pdev->dev; - lradc->base =devm_ioremap_resource (dev, iores); -if (IS_ERR (lradc->base)) -return PTR_ERR (lradc->base); +void *tempptr;Quoted 8 lines
drivers/staging/iio/adc/mxs-lradc.c static int mxs_lradc_probe(struct platform_device *pdev) · line 1553
Quoted 5 lines
drivers/staging/iio/adc/mxs-lradc.c +5
-0+ + tempptr =devm_ioremap_resource (dev, iores); +if (IS_ERR (tempptr)) +return PTR_ERR (tempptr); + lradc->base = tempptr;This makes no sense at all...
devm_ioremap_resource()returns a iomem pointerlrdac->baseis a iomem pointer.
Quoted 1 line
sparse is giving warning for argument 1 of
IS_ERR.
Not if you update to the latest version of sparse.
Quoted 14 lines
Quoted 10 lines
Please make sure that you have the latest version of sparse installed on your system.
Quoted 4 lines
drivers/staging/iio/adc/mxs-lradc.c +0
-0lradc->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (lradc->clk)) {thanks
sudip
Quoted 32 lines · Lars-Peter Clausen
Quoted 31 lines · Sudip Mukherjee
Quoted 29 lines · Lars-Peter Clausen
Quoted 15 lines · Sudip Mukherjee
fixed sparse warning : incorrect type in argument 1
(different address spaces)Signed-off-by Sudip Mukherjee <[email protected]>--- drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/staging/iio/adc/mxs-lradc.c +0
-0@@ -1545,9 +1545,12 @@ static int mxs_lradc_probe(struct platform_device *pdev)/* Grab the memory area */ iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 );drivers/staging/iio/adc/mxs-lradc.c static int mxs_lradc_probe(struct platform_device *pdev) · line 1553
Quoted 10 lines
drivers/staging/iio/adc/mxs-lradc.c +6
-3lradc->dev = &pdev->dev; - lradc->base =devm_ioremap_resource (dev, iores); -if (IS_ERR (lradc->base)) -return PTR_ERR (lradc->base); +void *tempptr; + + tempptr =devm_ioremap_resource (dev, iores); +if (IS_ERR (tempptr)) +return PTR_ERR (tempptr); + lradc->base = tempptr;This makes no sense at all...
devm_ioremap_resource()returns a iomem pointerlrdac->baseis a iomem pointer.
Quoted 4 lines
Quoted 1 line
sparse is giving warning for argument 1 of
IS_ERR.Not if you update to the latest version of sparse.
yes , looks like ubuntu repository is having version 0.4.3 , whereas the latest version is 0.5.0. and with this one there no warning for iio. sorry for the noise.
thanks
sudip
Quoted 15 lines
Quoted 14 lines
Quoted 10 lines
Please make sure that you have the latest version of sparse installed on your system.
Quoted 4 lines
drivers/staging/iio/adc/mxs-lradc.c +0
-0lradc->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (lradc->clk)) {thanks
sudip
Quoted 3 lines · Sudip Mukherjee
fixed sparse warning : incorrect type in argument 1
(different address spaces)
The change log is not clear. It's the IS_ERR() which is the problem? This is a false positive which is fixed in a later version of Sparse.
regards,
dan carpenter
Quoted 5 lines · Dan Carpenter
Quoted 3 lines · Sudip Mukherjee
fixed sparse warning : incorrect type in argument 1
(different address spaces)
Quoted 7 lines
The change log is not clear. It's the
IS_ERR()which is the problem? This is a false positive which is fixed in a later version of Sparse.regards,
dan carpenter
yes , problem with sparse. ubuntu repo was not having the latest version ,
and i did not check what is the latest .
sorry for it.
thanks
sudip