diff mbox

fix ptr_ret.cocci warnings

Message ID 20170317144809.GA103304@lkp-hsx03.lkp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

kernel test robot March 17, 2017, 2:48 p.m. UTC
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(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Olimpiu Dejeu March 21, 2017, 2:58 p.m. UTC | #1
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>
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Daniel Thompson March 21, 2017, 3:07 p.m. UTC | #2
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones April 24, 2017, 10:57 a.m. UTC | #3
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.
Daniel Thompson April 24, 2017, 11:26 a.m. UTC | #4
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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)