All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: sunxi: fix devm_ioremap_resource error detection code
@ 2014-06-28 17:23 ` Himangi Saraogi
  0 siblings, 0 replies; 6+ messages in thread
From: Himangi Saraogi @ 2014-06-28 17:23 UTC (permalink / raw)
  To: Emilio López, Mike Turquette, Maxime Ripard, linux-kernel,
	linux-arm-kernel
  Cc: julia.lawall

devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.

A simplified version of the semantic match that finds this problem is as
follows:

// <smpl>
@@
expression e,e1;
statement S;
@@

*e = devm_ioremap_resource(...);
if (!e1) S

// </smpl>

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
index 44cd27c..670f90d 100644
--- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
+++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
@@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg = devm_ioremap_resource(&pdev->dev, r);
-	if (!reg)
+	if (IS_ERR(reg))
 		return PTR_ERR(reg);
 
 	clk_parent = of_clk_get_parent_name(np, 0);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] clk: sunxi: fix devm_ioremap_resource error detection code
@ 2014-06-28 17:23 ` Himangi Saraogi
  0 siblings, 0 replies; 6+ messages in thread
From: Himangi Saraogi @ 2014-06-28 17:23 UTC (permalink / raw)
  To: linux-arm-kernel

devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.

A simplified version of the semantic match that finds this problem is as
follows:

// <smpl>
@@
expression e,e1;
statement S;
@@

*e = devm_ioremap_resource(...);
if (!e1) S

// </smpl>

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
index 44cd27c..670f90d 100644
--- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
+++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
@@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg = devm_ioremap_resource(&pdev->dev, r);
-	if (!reg)
+	if (IS_ERR(reg))
 		return PTR_ERR(reg);
 
 	clk_parent = of_clk_get_parent_name(np, 0);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: sunxi: fix devm_ioremap_resource error detection code
       [not found] ` <53AF024B.3010100@free-electrons.com>
@ 2014-06-28 21:38     ` Emilio López
  0 siblings, 0 replies; 6+ messages in thread
From: Emilio López @ 2014-06-28 21:38 UTC (permalink / raw)
  To: Boris BREZILLON, Himangi Saraogi, Mike Turquette
  Cc: Maxime Ripard, linux-kernel, linux-arm-kernel, julia.lawall

Hi,

El 28/06/14 14:58, Boris BREZILLON escribió:
> Hello,
>
> On 28/06/2014 19:23, Himangi Saraogi wrote:
>> devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
>>
>> A simplified version of the semantic match that finds this problem is as
>> follows:
>>
>> // <smpl>
>> @@
>> expression e,e1;
>> statement S;
>> @@
>>
>> *e = devm_ioremap_resource(...);
>> if (!e1) S
>>
>> // </smpl>
>> Signed-off-by: Himangi Saraogi<himangi774@gmail.com>
>> Acked-by: Julia Lawall<julia.lawall@lip6.fr>
>> ---
>>   drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
>> index 44cd27c..670f90d 100644
>> --- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
>> +++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
>> @@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
>>
>>   	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>   	reg = devm_ioremap_resource(&pdev->dev, r);
>> -	if (!reg)
>> +	if (IS_ERR(reg))
>>   		return PTR_ERR(reg);
>>
>>   	clk_parent = of_clk_get_parent_name(np, 0);
>
> Oops, one more mistake in testing devm_ioremap_resource return code (I
> always mix devm_ioremap_resource and devm_request_and_ioremap behaviours).
>
> Sorry for the inconvenience, and of course, you have my:
>
> Acked-by Boris BREZILLON <boris.brezillon@free-electrons.com>

Mike, do you want to take this directly for the -rc cycle, or should I 
queue it for 3.17? Please let me know.

Cheers,

Emilio

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] clk: sunxi: fix devm_ioremap_resource error detection code
@ 2014-06-28 21:38     ` Emilio López
  0 siblings, 0 replies; 6+ messages in thread
From: Emilio López @ 2014-06-28 21:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

El 28/06/14 14:58, Boris BREZILLON escribi?:
> Hello,
>
> On 28/06/2014 19:23, Himangi Saraogi wrote:
>> devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
>>
>> A simplified version of the semantic match that finds this problem is as
>> follows:
>>
>> // <smpl>
>> @@
>> expression e,e1;
>> statement S;
>> @@
>>
>> *e = devm_ioremap_resource(...);
>> if (!e1) S
>>
>> // </smpl>
>> Signed-off-by: Himangi Saraogi<himangi774@gmail.com>
>> Acked-by: Julia Lawall<julia.lawall@lip6.fr>
>> ---
>>   drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
>> index 44cd27c..670f90d 100644
>> --- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
>> +++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
>> @@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
>>
>>   	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>   	reg = devm_ioremap_resource(&pdev->dev, r);
>> -	if (!reg)
>> +	if (IS_ERR(reg))
>>   		return PTR_ERR(reg);
>>
>>   	clk_parent = of_clk_get_parent_name(np, 0);
>
> Oops, one more mistake in testing devm_ioremap_resource return code (I
> always mix devm_ioremap_resource and devm_request_and_ioremap behaviours).
>
> Sorry for the inconvenience, and of course, you have my:
>
> Acked-by Boris BREZILLON <boris.brezillon@free-electrons.com>

Mike, do you want to take this directly for the -rc cycle, or should I 
queue it for 3.17? Please let me know.

Cheers,

Emilio

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: sunxi: fix devm_ioremap_resource error detection code
  2014-06-28 21:38     ` Emilio López
@ 2014-07-02  6:40       ` Mike Turquette
  -1 siblings, 0 replies; 6+ messages in thread
From: Mike Turquette @ 2014-07-02  6:40 UTC (permalink / raw)
  To: Emilio López, Boris BREZILLON, Himangi Saraogi
  Cc: Maxime Ripard, linux-kernel, linux-arm-kernel, julia.lawall

Quoting Emilio López (2014-06-28 14:38:26)
> Hi,
> 
> El 28/06/14 14:58, Boris BREZILLON escribió:
> > Hello,
> >
> > On 28/06/2014 19:23, Himangi Saraogi wrote:
> >> devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
> >>
> >> A simplified version of the semantic match that finds this problem is as
> >> follows:
> >>
> >> // <smpl>
> >> @@
> >> expression e,e1;
> >> statement S;
> >> @@
> >>
> >> *e = devm_ioremap_resource(...);
> >> if (!e1) S
> >>
> >> // </smpl>
> >> Signed-off-by: Himangi Saraogi<himangi774@gmail.com>
> >> Acked-by: Julia Lawall<julia.lawall@lip6.fr>
> >> ---
> >>   drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
> >> index 44cd27c..670f90d 100644
> >> --- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
> >> +++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
> >> @@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
> >>
> >>      r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >>      reg = devm_ioremap_resource(&pdev->dev, r);
> >> -    if (!reg)
> >> +    if (IS_ERR(reg))
> >>              return PTR_ERR(reg);
> >>
> >>      clk_parent = of_clk_get_parent_name(np, 0);
> >
> > Oops, one more mistake in testing devm_ioremap_resource return code (I
> > always mix devm_ioremap_resource and devm_request_and_ioremap behaviours).
> >
> > Sorry for the inconvenience, and of course, you have my:
> >
> > Acked-by Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Mike, do you want to take this directly for the -rc cycle, or should I 
> queue it for 3.17? Please let me know.

I've picked it for the current -rc cycle.

Thanks,
Mike

> 
> Cheers,
> 
> Emilio

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] clk: sunxi: fix devm_ioremap_resource error detection code
@ 2014-07-02  6:40       ` Mike Turquette
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Turquette @ 2014-07-02  6:40 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Emilio L?pez (2014-06-28 14:38:26)
> Hi,
> 
> El 28/06/14 14:58, Boris BREZILLON escribi?:
> > Hello,
> >
> > On 28/06/2014 19:23, Himangi Saraogi wrote:
> >> devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
> >>
> >> A simplified version of the semantic match that finds this problem is as
> >> follows:
> >>
> >> // <smpl>
> >> @@
> >> expression e,e1;
> >> statement S;
> >> @@
> >>
> >> *e = devm_ioremap_resource(...);
> >> if (!e1) S
> >>
> >> // </smpl>
> >> Signed-off-by: Himangi Saraogi<himangi774@gmail.com>
> >> Acked-by: Julia Lawall<julia.lawall@lip6.fr>
> >> ---
> >>   drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
> >> index 44cd27c..670f90d 100644
> >> --- a/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
> >> +++ b/drivers/clk/sunxi/clk-sun6i-apb0-gates.c
> >> @@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev)
> >>
> >>      r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >>      reg = devm_ioremap_resource(&pdev->dev, r);
> >> -    if (!reg)
> >> +    if (IS_ERR(reg))
> >>              return PTR_ERR(reg);
> >>
> >>      clk_parent = of_clk_get_parent_name(np, 0);
> >
> > Oops, one more mistake in testing devm_ioremap_resource return code (I
> > always mix devm_ioremap_resource and devm_request_and_ioremap behaviours).
> >
> > Sorry for the inconvenience, and of course, you have my:
> >
> > Acked-by Boris BREZILLON <boris.brezillon@free-electrons.com>
> 
> Mike, do you want to take this directly for the -rc cycle, or should I 
> queue it for 3.17? Please let me know.

I've picked it for the current -rc cycle.

Thanks,
Mike

> 
> Cheers,
> 
> Emilio

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-02  6:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-28 17:23 [PATCH] clk: sunxi: fix devm_ioremap_resource error detection code Himangi Saraogi
2014-06-28 17:23 ` Himangi Saraogi
     [not found] ` <53AF024B.3010100@free-electrons.com>
2014-06-28 21:38   ` Emilio López
2014-06-28 21:38     ` Emilio López
2014-07-02  6:40     ` Mike Turquette
2014-07-02  6:40       ` Mike Turquette

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.