* [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
@ 2014-09-04 16:45 Sudip Mukherjee
2014-09-04 16:50 ` Lars-Peter Clausen
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Sudip Mukherjee @ 2014-09-04 16:45 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald, Greg Kroah-Hartman
Cc: Sudip Mukherjee, open list:STAGING - INDUSTR...,
open list:STAGING SUBSYSTEM, open list
fixed sparse warning : incorrect type in argument 1
(different address spaces)
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index 468327f..d8d1fe1 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -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)) {
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
2014-09-04 16:45 [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type Sudip Mukherjee
@ 2014-09-04 16:50 ` Lars-Peter Clausen
2014-09-04 17:12 ` Sudip Mukherjee
2014-09-04 17:00 ` Sudip Mukherjee
2014-09-05 9:34 ` Dan Carpenter
2 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-04 16:50 UTC (permalink / raw)
To: Sudip Mukherjee, Jonathan Cameron, Hartmut Knaack,
Peter Meerwald, Greg Kroah-Hartman
Cc: open list:STAGING - INDUSTR..., STAGING SUBSYSTEM, open list
On 09/04/2014 06:45 PM, Sudip Mukherjee wrote:
> fixed sparse warning : incorrect type in argument 1
> (different address spaces)
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index 468327f..d8d1fe1 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -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;
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.
>
> lradc->clk = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(lradc->clk)) {
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
2014-09-04 16:45 [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type Sudip Mukherjee
2014-09-04 16:50 ` Lars-Peter Clausen
@ 2014-09-04 17:00 ` Sudip Mukherjee
2014-09-05 9:34 ` Dan Carpenter
2 siblings, 0 replies; 8+ messages in thread
From: Sudip Mukherjee @ 2014-09-04 17:00 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald, Greg Kroah-Hartman
Cc: open list:STAGING - INDUSTR..., open list:STAGING SUBSYSTEM, open list
please discard the patch. It generates additional sparse warning.
sorry for it.
thanks
sudip
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
2014-09-04 16:50 ` Lars-Peter Clausen
@ 2014-09-04 17:12 ` Sudip Mukherjee
2014-09-04 17:16 ` Lars-Peter Clausen
0 siblings, 1 reply; 8+ messages in thread
From: Sudip Mukherjee @ 2014-09-04 17:12 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Jonathan Cameron, Hartmut Knaack, Peter Meerwald,
Greg Kroah-Hartman, open list:STAGING - INDUSTR...,
STAGING SUBSYSTEM, open list
On Thu, Sep 04, 2014 at 06:50:05PM +0200, Lars-Peter Clausen wrote:
> On 09/04/2014 06:45 PM, Sudip Mukherjee wrote:
> >fixed sparse warning : incorrect type in argument 1
> > (different address spaces)
> >
> >Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> >---
> > drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++---
> > 1 file changed, 6 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> >index 468327f..d8d1fe1 100644
> >--- a/drivers/staging/iio/adc/mxs-lradc.c
> >+++ b/drivers/staging/iio/adc/mxs-lradc.c
> >@@ -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;
>
> This makes no sense at all... devm_ioremap_resource() returns a
> iomem pointer lrdac->base is a iomem pointer.
sparse is giving warning for argument 1 of IS_ERR.
>
> Please make sure that you have the latest version of sparse
> installed on your system.
>
> >
> > lradc->clk = devm_clk_get(&pdev->dev, NULL);
> > if (IS_ERR(lradc->clk)) {
> >
>
thanks
sudip
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
2014-09-04 17:12 ` Sudip Mukherjee
@ 2014-09-04 17:16 ` Lars-Peter Clausen
2014-09-05 6:39 ` Sudip Mukherjee
0 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2014-09-04 17:16 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Jonathan Cameron, Hartmut Knaack, Peter Meerwald,
Greg Kroah-Hartman, open list:STAGING - INDUSTR...,
STAGING SUBSYSTEM, open list
On 09/04/2014 07:12 PM, Sudip Mukherjee wrote:
> On Thu, Sep 04, 2014 at 06:50:05PM +0200, Lars-Peter Clausen wrote:
>> On 09/04/2014 06:45 PM, Sudip Mukherjee wrote:
>>> fixed sparse warning : incorrect type in argument 1
>>> (different address spaces)
>>>
>>> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
>>> ---
>>> drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++---
>>> 1 file changed, 6 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
>>> index 468327f..d8d1fe1 100644
>>> --- a/drivers/staging/iio/adc/mxs-lradc.c
>>> +++ b/drivers/staging/iio/adc/mxs-lradc.c
>>> @@ -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;
>>
>> This makes no sense at all... devm_ioremap_resource() returns a
>> iomem pointer lrdac->base is a iomem pointer.
>
> sparse is giving warning for argument 1 of IS_ERR.
Not if you update to the latest version of sparse.
>
>>
>> Please make sure that you have the latest version of sparse
>> installed on your system.
>>
>>>
>>> lradc->clk = devm_clk_get(&pdev->dev, NULL);
>>> if (IS_ERR(lradc->clk)) {
>>>
>>
>
> thanks
> sudip
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
2014-09-04 17:16 ` Lars-Peter Clausen
@ 2014-09-05 6:39 ` Sudip Mukherjee
0 siblings, 0 replies; 8+ messages in thread
From: Sudip Mukherjee @ 2014-09-05 6:39 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Jonathan Cameron, Hartmut Knaack, Peter Meerwald,
Greg Kroah-Hartman, open list:STAGING - INDUSTR...,
STAGING SUBSYSTEM, open list
On Thu, Sep 04, 2014 at 07:16:11PM +0200, Lars-Peter Clausen wrote:
> On 09/04/2014 07:12 PM, Sudip Mukherjee wrote:
> >On Thu, Sep 04, 2014 at 06:50:05PM +0200, Lars-Peter Clausen wrote:
> >>On 09/04/2014 06:45 PM, Sudip Mukherjee wrote:
> >>>fixed sparse warning : incorrect type in argument 1
> >>> (different address spaces)
> >>>
> >>>Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> >>>---
> >>> drivers/staging/iio/adc/mxs-lradc.c | 9 ++++++---
> >>> 1 file changed, 6 insertions(+), 3 deletions(-)
> >>>
> >>>diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> >>>index 468327f..d8d1fe1 100644
> >>>--- a/drivers/staging/iio/adc/mxs-lradc.c
> >>>+++ b/drivers/staging/iio/adc/mxs-lradc.c
> >>>@@ -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;
> >>
> >>This makes no sense at all... devm_ioremap_resource() returns a
> >>iomem pointer lrdac->base is a iomem pointer.
> >
> >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
> >
> >>
> >>Please make sure that you have the latest version of sparse
> >>installed on your system.
> >>
> >>>
> >>> lradc->clk = devm_clk_get(&pdev->dev, NULL);
> >>> if (IS_ERR(lradc->clk)) {
> >>>
> >>
> >
> >thanks
> >sudip
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
2014-09-04 16:45 [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type Sudip Mukherjee
2014-09-04 16:50 ` Lars-Peter Clausen
2014-09-04 17:00 ` Sudip Mukherjee
@ 2014-09-05 9:34 ` Dan Carpenter
2014-09-05 9:47 ` Sudip Mukherjee
2 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2014-09-05 9:34 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald, Greg Kroah-Hartman,
open list:STAGING - INDUSTR...,
open list:STAGING SUBSYSTEM, open list
On Thu, Sep 04, 2014 at 10:15:42PM +0530, Sudip Mukherjee wrote:
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type
2014-09-05 9:34 ` Dan Carpenter
@ 2014-09-05 9:47 ` Sudip Mukherjee
0 siblings, 0 replies; 8+ messages in thread
From: Sudip Mukherjee @ 2014-09-05 9:47 UTC (permalink / raw)
To: Dan Carpenter
Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald, Greg Kroah-Hartman,
open list:STAGING - INDUSTR...,
open list:STAGING SUBSYSTEM, open list
On Fri, Sep 05, 2014 at 12:34:13PM +0300, Dan Carpenter wrote:
> On Thu, Sep 04, 2014 at 10:15:42PM +0530, Sudip Mukherjee wrote:
> > 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
>
>
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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-09-05 9:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04 16:45 [PATCH] staging: iio: adc: mxs-lradc.c: sparse warning of incorrect type Sudip Mukherjee
2014-09-04 16:50 ` Lars-Peter Clausen
2014-09-04 17:12 ` Sudip Mukherjee
2014-09-04 17:16 ` Lars-Peter Clausen
2014-09-05 6:39 ` Sudip Mukherjee
2014-09-04 17:00 ` Sudip Mukherjee
2014-09-05 9:34 ` Dan Carpenter
2014-09-05 9:47 ` Sudip Mukherjee
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.