linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix ptr_ret.cocci warnings
@ 2017-05-15 10:52 Julia Lawall
  2017-05-15 10:56 ` Stephan Müller
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2017-05-15 10:52 UTC (permalink / raw)
  To: Stephan Müller
  Cc: linux-kernel, linux-crypto, Jason A. Donenfeld, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Stephan Müller <smueller@chronox.de>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

Not very important, but the code can be a little simpler.

 lrng_base.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/char/lrng_base.c
+++ b/drivers/char/lrng_base.c
@@ -1523,10 +1523,7 @@ static int lrng_alloc(void)
 	lrng_init_rng(key, sizeof(key));
 	lrng_pool.lrng_hash = lrng_hash_alloc(LRNG_HASH_NAME, key, sizeof(key));
 	memzero_explicit(key, sizeof(key));
-	if (IS_ERR(lrng_pool.lrng_hash))
-		return PTR_ERR(lrng_pool.lrng_hash);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(lrng_pool.lrng_hash);
 }

 /************************** LRNG kernel interfaces ***************************/

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

* Re: [PATCH] fix ptr_ret.cocci warnings
  2017-05-15 10:52 [PATCH] fix ptr_ret.cocci warnings Julia Lawall
@ 2017-05-15 10:56 ` Stephan Müller
  0 siblings, 0 replies; 8+ messages in thread
From: Stephan Müller @ 2017-05-15 10:56 UTC (permalink / raw)
  To: Julia Lawall; +Cc: linux-kernel, linux-crypto, Jason A. Donenfeld, kbuild-all

Am Montag, 15. Mai 2017, 12:52:11 CEST schrieb Julia Lawall:

Hi Julia,

> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Generated by: scripts/coccinelle/api/ptr_ret.cocci

Thank you, included -- it will be present in the next release.

Ciao
Stephan

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

* [PATCH] fix ptr_ret.cocci warnings
  2019-12-21  1:18 drivers/pci/controller/pcie-rockchip-host.c:628:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
@ 2019-12-21  1:18 ` kbuild test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-12-21  1:18 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: kbuild-all, linux-kernel, Bjorn Helgaas, Shawn Lin,
	Andrew Murray, Heiko Stuebner, linux-pci, linux-rockchip,
	linux-arm-kernel

From: kbuild test robot <lkp@intel.com>

drivers/pci/controller/pcie-rockchip-host.c:628:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 069ade5dfec9 ("Merge branch 'remotes/lorenzo/pci/rockchip'")
Signed-off-by: kbuild test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b371ddb94fae82b6565020639b7db31934043c65
commit: 069ade5dfec93dd2916a85df8b1bab2d578857bd Merge branch 'remotes/lorenzo/pci/rockchip'

 pcie-rockchip-host.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/pci/controller/pcie-rockchip-host.c
+++ b/drivers/pci/controller/pcie-rockchip-host.c
@@ -625,10 +625,7 @@ static int rockchip_pcie_parse_host_dt(s
 		return PTR_ERR(rockchip->vpcie1v8);
 
 	rockchip->vpcie0v9 = devm_regulator_get(dev, "vpcie0v9");
-	if (IS_ERR(rockchip->vpcie0v9))
-		return PTR_ERR(rockchip->vpcie0v9);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(rockchip->vpcie0v9);
 }
 
 static int rockchip_pcie_set_vpcie(struct rockchip_pcie *rockchip)

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

* Re: [PATCH] fix ptr_ret.cocci warnings
  2017-04-24 10:57           ` Lee Jones
@ 2017-04-24 11:26             ` Daniel Thompson
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Thompson @ 2017-04-24 11:26 UTC (permalink / raw)
  To: Lee Jones, Olimpiu Dejeu
  Cc: kbuild test robot, fengguang.wu, kbuild-all, Rob Herring,
	linux-kernel, linux-fbdev, devicetree, jingoohan1, Brian Dodge,
	joe, Matthew D'Asaro

On 24/04/17 11:57, Lee Jones wrote:
> On Mon, 17 Apr 2017, Olimpiu Dejeu wrote:
>
>> On Tue, Mar 21, 2017 at 11:07 AM, Daniel Thompson <
>> daniel.thompson@linaro.org> wrote:
>>
>>> On 21/03/17 14:58, Olimpiu Dejeu wrote:
>>>
>>>> On Fri, Mar 17, 2017 at 10:48 AM, kbuild test robot <lkp@intel.com>
>>>> wrote:
>>>>
>>>>> drivers/video/backlight/arcxcnn_bl.c:183:1-3: WARNING: PTR_ERR_OR_ZERO
>>>>> can be used
>>>>>
>>>>>
>>>>>  Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>>>>>
>>>>> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>>>>>
>>>>> CC: Olimpiu Dejeu <olimpiu@arcticsand.com>
>>>>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>>>>> ---
>>>>>
>>>>>  arcxcnn_bl.c |    5 +----
>>>>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>>>>
>>>>> --- a/drivers/video/backlight/arcxcnn_bl.c
>>>>> +++ b/drivers/video/backlight/arcxcnn_bl.c
>>>>> @@ -180,10 +180,7 @@ static int arcxcnn_backlight_register(st
>>>>>
>>>>>         lp->bl = devm_backlight_device_register(lp->dev, name, lp->dev,
>>>>> lp,
>>>>>                                        &arcxcnn_bl_ops, props);
>>>>> -       if (IS_ERR(lp->bl))
>>>>> -               return PTR_ERR(lp->bl);
>>>>> -
>>>>> -       return 0;
>>>>> +       return PTR_ERR_OR_ZERO(lp->bl);
>>>>>  }
>>>>>
>>>>>  static void arcxcnn_parse_dt(struct arcxcnn *lp)
>>>>>
>>>>
>>>> Acked-by: Olimpiu Dejeu <olimpiu@arcticsand.com>
>>>>
>>>
>>> Glad you approve! Could you apply this change and re-post the patch
>>> series? Thanks.
>>>
>>>
>>> Daniel.
>>>
>>>
>> Applied change, re-posted series on March 21st. No sure what next. Please
>> advise. Thanks.
>
> Yes you did.
>
> Daniel, do you see v9?

Yep. All fine at my end... it has my Reviewed-by: which is an even more 
emphatic statement than my Acked-by: ;-) .

I think from this point on I think I'll start posting
"[vX-is-still-]Acked-by:" replies so you don't have to worry about 
whether I've seen new versions.


> FYI, if this happens again, it's best to wait a couple of weeks then
> send the patch again like "[RESEND v9] ..." to gain attention.

RESENDs are a good way to go. Also, if there are questions about the 
code its better to reply to the code rather than the side discussion.


Daniel.

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

* Re: [PATCH] fix ptr_ret.cocci warnings
       [not found]         ` <CAF-XLWL_w3OqafbLzcM=kOkS1nPb0VSCAyDaudQh2UwE4Gw0gg@mail.gmail.com>
@ 2017-04-24 10:57           ` Lee Jones
  2017-04-24 11:26             ` Daniel Thompson
  0 siblings, 1 reply; 8+ messages in thread
From: Lee Jones @ 2017-04-24 10:57 UTC (permalink / raw)
  To: Olimpiu Dejeu
  Cc: Daniel Thompson, kbuild test robot, fengguang.wu, kbuild-all,
	Rob Herring, linux-kernel, linux-fbdev, devicetree, jingoohan1,
	Brian Dodge, joe, Matthew D'Asaro

On Mon, 17 Apr 2017, Olimpiu Dejeu wrote:

> On Tue, Mar 21, 2017 at 11:07 AM, Daniel Thompson <
> daniel.thompson@linaro.org> wrote:
> 
> > On 21/03/17 14:58, Olimpiu Dejeu wrote:
> >
> >> On Fri, Mar 17, 2017 at 10:48 AM, kbuild test robot <lkp@intel.com>
> >> wrote:
> >>
> >>> drivers/video/backlight/arcxcnn_bl.c:183:1-3: WARNING: PTR_ERR_OR_ZERO
> >>> can be used
> >>>
> >>>
> >>>  Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> >>>
> >>> Generated by: scripts/coccinelle/api/ptr_ret.cocci
> >>>
> >>> CC: Olimpiu Dejeu <olimpiu@arcticsand.com>
> >>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> >>> ---
> >>>
> >>>  arcxcnn_bl.c |    5 +----
> >>>  1 file changed, 1 insertion(+), 4 deletions(-)
> >>>
> >>> --- a/drivers/video/backlight/arcxcnn_bl.c
> >>> +++ b/drivers/video/backlight/arcxcnn_bl.c
> >>> @@ -180,10 +180,7 @@ static int arcxcnn_backlight_register(st
> >>>
> >>>         lp->bl = devm_backlight_device_register(lp->dev, name, lp->dev,
> >>> lp,
> >>>                                        &arcxcnn_bl_ops, props);
> >>> -       if (IS_ERR(lp->bl))
> >>> -               return PTR_ERR(lp->bl);
> >>> -
> >>> -       return 0;
> >>> +       return PTR_ERR_OR_ZERO(lp->bl);
> >>>  }
> >>>
> >>>  static void arcxcnn_parse_dt(struct arcxcnn *lp)
> >>>
> >>
> >> Acked-by: Olimpiu Dejeu <olimpiu@arcticsand.com>
> >>
> >
> > Glad you approve! Could you apply this change and re-post the patch
> > series? Thanks.
> >
> >
> > Daniel.
> >
> >
> Applied change, re-posted series on March 21st. No sure what next. Please
> advise. Thanks.

Yes you did.

Daniel, do you see v9?

FYI, if this happens again, it's best to wait a couple of weeks then
send the patch again like "[RESEND v9] ..." to gain attention.


-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] fix ptr_ret.cocci warnings
  2017-03-21 14:58     ` Olimpiu Dejeu
@ 2017-03-21 15:07       ` Daniel Thompson
       [not found]         ` <CAF-XLWL_w3OqafbLzcM=kOkS1nPb0VSCAyDaudQh2UwE4Gw0gg@mail.gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Thompson @ 2017-03-21 15:07 UTC (permalink / raw)
  To: Olimpiu Dejeu, kbuild test robot, fengguang.wu
  Cc: kbuild-all, Rob Herring, Lee Jones, linux-kernel, linux-fbdev,
	devicetree, jingoohan1, Brian Dodge, joe, Matthew D'Asaro

On 21/03/17 14:58, Olimpiu Dejeu wrote:
> On Fri, Mar 17, 2017 at 10:48 AM, kbuild test robot <lkp@intel.com> wrote:
>> drivers/video/backlight/arcxcnn_bl.c:183:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>>
>>
>>  Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>>
>> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>>
>> CC: Olimpiu Dejeu <olimpiu@arcticsand.com>
>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>> ---
>>
>>  arcxcnn_bl.c |    5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> --- a/drivers/video/backlight/arcxcnn_bl.c
>> +++ b/drivers/video/backlight/arcxcnn_bl.c
>> @@ -180,10 +180,7 @@ static int arcxcnn_backlight_register(st
>>
>>         lp->bl = devm_backlight_device_register(lp->dev, name, lp->dev, lp,
>>                                        &arcxcnn_bl_ops, props);
>> -       if (IS_ERR(lp->bl))
>> -               return PTR_ERR(lp->bl);
>> -
>> -       return 0;
>> +       return PTR_ERR_OR_ZERO(lp->bl);
>>  }
>>
>>  static void arcxcnn_parse_dt(struct arcxcnn *lp)
>
> Acked-by: Olimpiu Dejeu <olimpiu@arcticsand.com>

Glad you approve! Could you apply this change and re-post the patch 
series? Thanks.


Daniel.

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

* Re: [PATCH] fix ptr_ret.cocci warnings
  2017-03-17 14:48   ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
@ 2017-03-21 14:58     ` Olimpiu Dejeu
  2017-03-21 15:07       ` Daniel Thompson
  0 siblings, 1 reply; 8+ messages in thread
From: Olimpiu Dejeu @ 2017-03-21 14:58 UTC (permalink / raw)
  To: kbuild test robot, fengguang.wu
  Cc: kbuild-all, Rob Herring, Lee Jones, linux-kernel, linux-fbdev,
	devicetree, jingoohan1, Brian Dodge, joe, Matthew D'Asaro,
	Daniel Thompson

On Fri, Mar 17, 2017 at 10:48 AM, kbuild test robot <lkp@intel.com> wrote:
> drivers/video/backlight/arcxcnn_bl.c:183:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
>
>  Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>
> CC: Olimpiu Dejeu <olimpiu@arcticsand.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
>
>  arcxcnn_bl.c |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- a/drivers/video/backlight/arcxcnn_bl.c
> +++ b/drivers/video/backlight/arcxcnn_bl.c
> @@ -180,10 +180,7 @@ static int arcxcnn_backlight_register(st
>
>         lp->bl = devm_backlight_device_register(lp->dev, name, lp->dev, lp,
>                                        &arcxcnn_bl_ops, props);
> -       if (IS_ERR(lp->bl))
> -               return PTR_ERR(lp->bl);
> -
> -       return 0;
> +       return PTR_ERR_OR_ZERO(lp->bl);
>  }
>
>  static void arcxcnn_parse_dt(struct arcxcnn *lp)

Acked-by: Olimpiu Dejeu <olimpiu@arcticsand.com>

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

* [PATCH] fix ptr_ret.cocci warnings
  2017-03-15 19:45 ` Olimpiu Dejeu
@ 2017-03-17 14:48   ` kbuild test robot
  2017-03-21 14:58     ` Olimpiu Dejeu
  0 siblings, 1 reply; 8+ messages in thread
From: kbuild test robot @ 2017-03-17 14:48 UTC (permalink / raw)
  To: Olimpiu Dejeu
  Cc: kbuild-all, robh, lee.jones, linux-kernel, linux-fbdev,
	devicetree, jingoohan1, bdodge, joe, medasaro, daniel.thompson,
	Olimpiu Dejeu

drivers/video/backlight/arcxcnn_bl.c:183:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Olimpiu Dejeu <olimpiu@arcticsand.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 arcxcnn_bl.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/video/backlight/arcxcnn_bl.c
+++ b/drivers/video/backlight/arcxcnn_bl.c
@@ -180,10 +180,7 @@ static int arcxcnn_backlight_register(st
 
 	lp->bl = devm_backlight_device_register(lp->dev, name, lp->dev, lp,
 				       &arcxcnn_bl_ops, props);
-	if (IS_ERR(lp->bl))
-		return PTR_ERR(lp->bl);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(lp->bl);
 }
 
 static void arcxcnn_parse_dt(struct arcxcnn *lp)

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

end of thread, other threads:[~2019-12-21  1:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 10:52 [PATCH] fix ptr_ret.cocci warnings Julia Lawall
2017-05-15 10:56 ` Stephan Müller
  -- strict thread matches above, loose matches on Subject: below --
2019-12-21  1:18 drivers/pci/controller/pcie-rockchip-host.c:628:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2019-12-21  1:18 ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
2017-03-17 14:48 [PATCH v8 3/3] backlight arcxcnn add support for ArcticSand devices kbuild test robot
2017-03-15 19:45 ` Olimpiu Dejeu
2017-03-17 14:48   ` [PATCH] fix ptr_ret.cocci warnings kbuild test robot
2017-03-21 14:58     ` Olimpiu Dejeu
2017-03-21 15:07       ` Daniel Thompson
     [not found]         ` <CAF-XLWL_w3OqafbLzcM=kOkS1nPb0VSCAyDaudQh2UwE4Gw0gg@mail.gmail.com>
2017-04-24 10:57           ` Lee Jones
2017-04-24 11:26             ` Daniel Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).