2018-02-14 21:14:05

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH] drm/i915/selftests: fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in shrink_boom.
The proper pointer to use is _explode_ instead of _purge_.

This issue was detected with the help of Coccinelle.

Fixes: fe215c8bc426 ("drm/i915/selftests: add missing gtt shrinker test")
Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index d806427..89b6ca9 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -927,7 +927,7 @@ static int shrink_boom(struct drm_i915_private *i915,

explode = fake_dma_object(i915, size);
if (IS_ERR(explode)) {
- err = PTR_ERR(purge);
+ err = PTR_ERR(explode);
goto err_purge;
}

--
2.7.4



2018-02-15 09:14:24

by Jani Nikula

[permalink] [raw]
Subject: Re: [PATCH] drm/i915/selftests: fix inconsistent IS_ERR and PTR_ERR

On Wed, 14 Feb 2018, "Gustavo A. R. Silva" <[email protected]> wrote:
> Fix inconsistent IS_ERR and PTR_ERR in shrink_boom.
> The proper pointer to use is _explode_ instead of _purge_.
>
> This issue was detected with the help of Coccinelle.
>
> Fixes: fe215c8bc426 ("drm/i915/selftests: add missing gtt shrinker test")
> Signed-off-by: Gustavo A. R. Silva <[email protected]>

Reviewed-by: Jani Nikula <[email protected]>

(Having some issues with fdo connections, thus not pushing.)

> ---
> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> index d806427..89b6ca9 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> @@ -927,7 +927,7 @@ static int shrink_boom(struct drm_i915_private *i915,
>
> explode = fake_dma_object(i915, size);
> if (IS_ERR(explode)) {
> - err = PTR_ERR(purge);
> + err = PTR_ERR(explode);
> goto err_purge;
> }

--
Jani Nikula, Intel Open Source Technology Center

2018-02-15 16:11:55

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] drm/i915/selftests: fix inconsistent IS_ERR and PTR_ERR



On 02/15/2018 03:13 AM, Jani Nikula wrote:
> On Wed, 14 Feb 2018, "Gustavo A. R. Silva" <[email protected]> wrote:
>> Fix inconsistent IS_ERR and PTR_ERR in shrink_boom.
>> The proper pointer to use is _explode_ instead of _purge_.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Fixes: fe215c8bc426 ("drm/i915/selftests: add missing gtt shrinker test")
>> Signed-off-by: Gustavo A. R. Silva <[email protected]>
>
> Reviewed-by: Jani Nikula <[email protected]>
>
> (Having some issues with fdo connections, thus not pushing.)
>

Thanks, Jani
--
Gustavo

>> ---
>> drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> index d806427..89b6ca9 100644
>> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
>> @@ -927,7 +927,7 @@ static int shrink_boom(struct drm_i915_private *i915,
>>
>> explode = fake_dma_object(i915, size);
>> if (IS_ERR(explode)) {
>> - err = PTR_ERR(purge);
>> + err = PTR_ERR(explode);
>> goto err_purge;
>> }
>

2018-02-16 09:04:48

by Chris Wilson

[permalink] [raw]
Subject: Re: [PATCH] drm/i915/selftests: fix inconsistent IS_ERR and PTR_ERR

Quoting Gustavo A. R. Silva (2018-02-15 16:09:09)
>
>
> On 02/15/2018 03:13 AM, Jani Nikula wrote:
> > On Wed, 14 Feb 2018, "Gustavo A. R. Silva" <[email protected]> wrote:
> >> Fix inconsistent IS_ERR and PTR_ERR in shrink_boom.
> >> The proper pointer to use is _explode_ instead of _purge_.
> >>
> >> This issue was detected with the help of Coccinelle.
> >>
> >> Fixes: fe215c8bc426 ("drm/i915/selftests: add missing gtt shrinker test")
> >> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> >
> > Reviewed-by: Jani Nikula <[email protected]>
> >
> > (Having some issues with fdo connections, thus not pushing.)
> >
>
> Thanks, Jani

And pushed, thanks for the patch and review.
-Chris