All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-04-26 11:21 ` Wei Yongjun
  0 siblings, 0 replies; 10+ messages in thread
From: Wei Yongjun @ 2018-04-26 11:21 UTC (permalink / raw)
  To: Tali Perry, Stephen Boyd; +Cc: Wei Yongjun, openbmc, linux-clk, kernel-janitors

In case of error, the function ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/clk/clk-npcm7xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
index dba5384..740af90 100644
--- a/drivers/clk/clk-npcm7xx.c
+++ b/drivers/clk/clk-npcm7xx.c
@@ -555,7 +555,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
 	}
 
 	clk_base = ioremap(res.start, resource_size(&res));
-	if (IS_ERR(clk_base))
+	if (!clk_base)
 		goto npcm7xx_init_error;
 
 	npcm7xx_clk_data = kzalloc(sizeof(*npcm7xx_clk_data->hws) *


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

* [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-04-26 11:21 ` Wei Yongjun
  0 siblings, 0 replies; 10+ messages in thread
From: Wei Yongjun @ 2018-04-26 11:21 UTC (permalink / raw)
  To: Tali Perry, Stephen Boyd; +Cc: Wei Yongjun, openbmc, linux-clk, kernel-janitors

In case of error, the function ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/clk/clk-npcm7xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
index dba5384..740af90 100644
--- a/drivers/clk/clk-npcm7xx.c
+++ b/drivers/clk/clk-npcm7xx.c
@@ -555,7 +555,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
 	}
 
 	clk_base = ioremap(res.start, resource_size(&res));
-	if (IS_ERR(clk_base))
+	if (!clk_base)
 		goto npcm7xx_init_error;
 
 	npcm7xx_clk_data = kzalloc(sizeof(*npcm7xx_clk_data->hws) *


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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
  2018-04-26 11:21 ` Wei Yongjun
@ 2018-05-01 21:50   ` Stephen Boyd
  -1 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2018-05-01 21:50 UTC (permalink / raw)
  To: Tali Perry, Wei Yongjun; +Cc: openbmc, linux-clk, kernel-janitors

Quoting Wei Yongjun (2018-04-26 04:21:08)
> In case of error, the function ioremap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
> 
> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Have you made this into a scripts/coccinelle/ script I can run?

Applied to clk-next

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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-05-01 21:50   ` Stephen Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Boyd @ 2018-05-01 21:50 UTC (permalink / raw)
  To: Tali Perry, Wei Yongjun; +Cc: Wei Yongjun, openbmc, linux-clk, kernel-janitors

Quoting Wei Yongjun (2018-04-26 04:21:08)
> In case of error, the function ioremap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
> 
> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Have you made this into a scripts/coccinelle/ script I can run?

Applied to clk-next

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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
  2018-05-01 21:50   ` Stephen Boyd
  (?)
@ 2018-05-02  9:19     ` Tali Perry
  -1 siblings, 0 replies; 10+ messages in thread
From: Tali Perry @ 2018-05-02  9:19 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Wei Yongjun, OpenBMC Maillist, linux-clk, kernel-janitors

I added the fix Wei Yongjun indicated ( Thanks Wei !)
and another fix similar to the above + error print change.

I'm a newbie... what's scripts/coccinelle/ script ?
I just made a new patch same way I did before. Is this OK?

On Wed, May 2, 2018 at 12:50 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> Quoting Wei Yongjun (2018-04-26 04:21:08)
>> In case of error, the function ioremap() returns NULL pointer not
>> ERR_PTR(). The IS_ERR() test in the return value check should be
>> replaced with NULL test.
>>
>> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> Have you made this into a scripts/coccinelle/ script I can run?
>
> Applied to clk-next

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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-05-02  9:19     ` Tali Perry
  0 siblings, 0 replies; 10+ messages in thread
From: Tali Perry @ 2018-05-02  9:19 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Wei Yongjun, OpenBMC Maillist, linux-clk, kernel-janitors

I added the fix Wei Yongjun indicated ( Thanks Wei !)
and another fix similar to the above + error print change.

I'm a newbie... what's scripts/coccinelle/ script ?
I just made a new patch same way I did before. Is this OK?

On Wed, May 2, 2018 at 12:50 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> Quoting Wei Yongjun (2018-04-26 04:21:08)
>> In case of error, the function ioremap() returns NULL pointer not
>> ERR_PTR(). The IS_ERR() test in the return value check should be
>> replaced with NULL test.
>>
>> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> Have you made this into a scripts/coccinelle/ script I can run?
>
> Applied to clk-next

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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-05-02  9:19     ` Tali Perry
  0 siblings, 0 replies; 10+ messages in thread
From: Tali Perry @ 2018-05-02  9:19 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: Wei Yongjun, OpenBMC Maillist, linux-clk, kernel-janitors

I added the fix Wei Yongjun indicated ( Thanks Wei !)
and another fix similar to the above + error print change.

I'm a newbie... what's scripts/coccinelle/ script ?
I just made a new patch same way I did before. Is this OK?

On Wed, May 2, 2018 at 12:50 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> Quoting Wei Yongjun (2018-04-26 04:21:08)
>> In case of error, the function ioremap() returns NULL pointer not
>> ERR_PTR(). The IS_ERR() test in the return value check should be
>> replaced with NULL test.
>>
>> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
>> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
>
> Have you made this into a scripts/coccinelle/ script I can run?
>
> Applied to clk-next

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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
  2018-05-02  9:19     ` Tali Perry
  (?)
@ 2018-05-02 10:36       ` Julia Lawall
  -1 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2018-05-02 10:36 UTC (permalink / raw)
  To: Tali Perry
  Cc: Stephen Boyd, Wei Yongjun, OpenBMC Maillist, linux-clk, kernel-janitors



On Wed, 2 May 2018, Tali Perry wrote:

> I added the fix Wei Yongjun indicated ( Thanks Wei !)
> and another fix similar to the above + error print change.
>
> I'm a newbie... what's scripts/coccinelle/ script ?
> I just made a new patch same way I did before. Is this OK?

With Coccinelle, you can make a rule that can be put into the Linux kernel
that can allow others to find this problem automatically. Maybe:

@@
expression e,e1;
statement S1,S2;
@@

e = ioremap(...);
... when != e = e1
if (
-    IS_ERR(e)
+    !e
   )
  S1 else S2

http://coccinelle.lip6.fr/

julia

>
> On Wed, May 2, 2018 at 12:50 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> > Quoting Wei Yongjun (2018-04-26 04:21:08)
> >> In case of error, the function ioremap() returns NULL pointer not
> >> ERR_PTR(). The IS_ERR() test in the return value check should be
> >> replaced with NULL test.
> >>
> >> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
> >> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> >
> > Have you made this into a scripts/coccinelle/ script I can run?
> >
> > Applied to clk-next
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-05-02 10:36       ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2018-05-02 10:36 UTC (permalink / raw)
  To: Tali Perry
  Cc: Stephen Boyd, Wei Yongjun, OpenBMC Maillist, linux-clk, kernel-janitors



On Wed, 2 May 2018, Tali Perry wrote:

> I added the fix Wei Yongjun indicated ( Thanks Wei !)
> and another fix similar to the above + error print change.
>
> I'm a newbie... what's scripts/coccinelle/ script ?
> I just made a new patch same way I did before. Is this OK?

With Coccinelle, you can make a rule that can be put into the Linux kernel
that can allow others to find this problem automatically. Maybe:

@@
expression e,e1;
statement S1,S2;
@@

e = ioremap(...);
... when != e = e1
if (
-    IS_ERR(e)
+    !e
   )
  S1 else S2

http://coccinelle.lip6.fr/

julia

>
> On Wed, May 2, 2018 at 12:50 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> > Quoting Wei Yongjun (2018-04-26 04:21:08)
> >> In case of error, the function ioremap() returns NULL pointer not
> >> ERR_PTR(). The IS_ERR() test in the return value check should be
> >> replaced with NULL test.
> >>
> >> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
> >> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> >
> > Have you made this into a scripts/coccinelle/ script I can run?
> >
> > Applied to clk-next
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-05-02 10:36       ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2018-05-02 10:36 UTC (permalink / raw)
  To: Tali Perry
  Cc: Stephen Boyd, Wei Yongjun, OpenBMC Maillist, linux-clk, kernel-janitors



On Wed, 2 May 2018, Tali Perry wrote:

> I added the fix Wei Yongjun indicated ( Thanks Wei !)
> and another fix similar to the above + error print change.
>
> I'm a newbie... what's scripts/coccinelle/ script ?
> I just made a new patch same way I did before. Is this OK?

With Coccinelle, you can make a rule that can be put into the Linux kernel
that can allow others to find this problem automatically. Maybe:

@@
expression e,e1;
statement S1,S2;
@@

e = ioremap(...);
... when != e = e1
if (
-    IS_ERR(e)
+    !e
   )
  S1 else S2

http://coccinelle.lip6.fr/

julia

>
> On Wed, May 2, 2018 at 12:50 AM, Stephen Boyd <sboyd@kernel.org> wrote:
> > Quoting Wei Yongjun (2018-04-26 04:21:08)
> >> In case of error, the function ioremap() returns NULL pointer not
> >> ERR_PTR(). The IS_ERR() test in the return value check should be
> >> replaced with NULL test.
> >>
> >> Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
> >> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> >
> > Have you made this into a scripts/coccinelle/ script I can run?
> >
> > Applied to clk-next
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

end of thread, other threads:[~2018-05-02 10:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 11:21 [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init() Wei Yongjun
2018-04-26 11:21 ` Wei Yongjun
2018-05-01 21:50 ` Stephen Boyd
2018-05-01 21:50   ` Stephen Boyd
2018-05-02  9:19   ` Tali Perry
2018-05-02  9:19     ` Tali Perry
2018-05-02  9:19     ` Tali Perry
2018-05-02 10:36     ` Julia Lawall
2018-05-02 10:36       ` Julia Lawall
2018-05-02 10:36       ` Julia Lawall

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.