Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519337 > unrolled thread

[PATCH] driver-core: fix odd_ptr_err.cocci warnings

Started byJulia Lawall <julia.lawall@lip6.fr>
First post2016-11-10 21:20 +0100
Last post2016-11-10 21:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] driver-core: fix odd_ptr_err.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2016-11-10 21:20 +0100
    Re: [PATCH] driver-core: fix odd_ptr_err.cocci warnings Dmitry Torokhov <dtor@chromium.org> - 2016-11-10 21:20 +0100
      Re: [PATCH] driver-core: fix odd_ptr_err.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2016-11-10 21:30 +0100

#1519337 — [PATCH] driver-core: fix odd_ptr_err.cocci warnings

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-11-10 21:20 +0100
Subject[PATCH] driver-core: fix odd_ptr_err.cocci warnings
Message-ID<sC3Zf-2IW-23@gated-at.bofh.it>
PTR_ERR should access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

CC: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

0-day warning related to the following commit:

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-testing
head:   dfea747d2aba77443acf7ce6fa37caa729bd034c
commit: 79543cf2b18ea4a35f8864849d7ad8882ea8a23d [10/14] driver-core: add test module for asynchronous probing

I haven't checked the context in detail.


 test_async_driver_probe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/base/test/test_async_driver_probe.c
+++ b/drivers/base/test/test_async_driver_probe.c
@@ -119,7 +119,7 @@ static int __init test_async_probe_init(
 	sync_dev_1 = platform_device_register_simple("test_sync_driver", 1,
 						     NULL, 0);
 	if (IS_ERR(async_dev_1)) {
-		error = PTR_ERR(sync_dev_1);
+		error = PTR_ERR(async_dev_1);
 		pr_err("failed to create sync_dev_1: %d", error);
 		goto err_unregister_sync_driver;
 	}

[toc] | [next] | [standalone]


#1519342

FromDmitry Torokhov <dtor@chromium.org>
Date2016-11-10 21:20 +0100
Message-ID<sC3Zf-2IW-33@gated-at.bofh.it>
In reply to#1519337
[ resending as plain text ]

On Thu, Nov 10, 2016 at 12:18 PM, Dmitry Torokhov <dtor@chromium.org> wrote:
>
>
> On Thu, Nov 10, 2016 at 12:16 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>>
>> PTR_ERR should access the value just tested by IS_ERR
>>
>> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>>
>> CC: Dmitry Torokhov <dtor@chromium.org>
>> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>> ---
>>
>> 0-day warning related to the following commit:
>>
>> tree:
>> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
>> driver-core-testing
>> head:   dfea747d2aba77443acf7ce6fa37caa729bd034c
>> commit: 79543cf2b18ea4a35f8864849d7ad8882ea8a23d [10/14] driver-core: add
>> test module for asynchronous probing
>>
>> I haven't checked the context in detail.
>>
>>
>>  test_async_driver_probe.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- a/drivers/base/test/test_async_driver_probe.c
>> +++ b/drivers/base/test/test_async_driver_probe.c
>> @@ -119,7 +119,7 @@ static int __init test_async_probe_init(
>>         sync_dev_1 = platform_device_register_simple("test_sync_driver",
>> 1,
>>                                                      NULL, 0);
>>         if (IS_ERR(async_dev_1)) {
>> -               error = PTR_ERR(sync_dev_1);
>> +               error = PTR_ERR(async_dev_1);
>
>
> NAK. It should be "if (IS_ERR(sync_dev_1)) {"
>
>>
>>                 pr_err("failed to create sync_dev_1: %d", error);
>>                 goto err_unregister_sync_driver;
>>         }
>
>

[toc] | [prev] | [next] | [standalone]


#1519345

FromJulia Lawall <julia.lawall@lip6.fr>
Date2016-11-10 21:30 +0100
Message-ID<sC48W-2ML-7@gated-at.bofh.it>
In reply to#1519342

On Thu, 10 Nov 2016, Dmitry Torokhov wrote:

> [ resending as plain text ]
>
> On Thu, Nov 10, 2016 at 12:18 PM, Dmitry Torokhov <dtor@chromium.org> wrote:
> >
> >
> > On Thu, Nov 10, 2016 at 12:16 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >>
> >> PTR_ERR should access the value just tested by IS_ERR
> >>
> >> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
> >>
> >> CC: Dmitry Torokhov <dtor@chromium.org>
> >> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> >> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> >> ---
> >>
> >> 0-day warning related to the following commit:
> >>
> >> tree:
> >> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
> >> driver-core-testing
> >> head:   dfea747d2aba77443acf7ce6fa37caa729bd034c
> >> commit: 79543cf2b18ea4a35f8864849d7ad8882ea8a23d [10/14] driver-core: add
> >> test module for asynchronous probing
> >>
> >> I haven't checked the context in detail.
> >>
> >>
> >>  test_async_driver_probe.c |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> --- a/drivers/base/test/test_async_driver_probe.c
> >> +++ b/drivers/base/test/test_async_driver_probe.c
> >> @@ -119,7 +119,7 @@ static int __init test_async_probe_init(
> >>         sync_dev_1 = platform_device_register_simple("test_sync_driver",
> >> 1,
> >>                                                      NULL, 0);
> >>         if (IS_ERR(async_dev_1)) {
> >> -               error = PTR_ERR(sync_dev_1);
> >> +               error = PTR_ERR(async_dev_1);
> >
> >
> > NAK. It should be "if (IS_ERR(sync_dev_1)) {"

Indeed, I should have noticed that.  Will you make the fix, or should I
revise the proposed patch?

julia

> >
> >>
> >>                 pr_err("failed to create sync_dev_1: %d", error);
> >>                 goto err_unregister_sync_driver;
> >>         }
> >
> >
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web