* [PATCH-next] drm/tegra: gem: Use PTR_ERR_OR_ZERO
@ 2018-01-23 20:29 Christopher Díaz Riveros
2018-01-24 7:09 ` Mikko Perttunen
0 siblings, 1 reply; 2+ messages in thread
From: Christopher Díaz Riveros @ 2018-01-23 20:29 UTC (permalink / raw)
To: thierry.reding, airlied, jonathanh
Cc: dri-devel, linux-tegra, linux-kernel, kernel-janitors
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
This issue was detected by using the Coccinelle software.
Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
---
drivers/gpu/drm/tegra/gem.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 49b9bf28f872..36c4ecc33e1a 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -416,10 +416,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
&args->handle);
- if (IS_ERR(bo))
- return PTR_ERR(bo);
-
- return 0;
+ return PTR_ERR_OR_ZERO(bo);
}
static int tegra_bo_fault(struct vm_fault *vmf)
--
2.16.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH-next] drm/tegra: gem: Use PTR_ERR_OR_ZERO
2018-01-23 20:29 [PATCH-next] drm/tegra: gem: Use PTR_ERR_OR_ZERO Christopher Díaz Riveros
@ 2018-01-24 7:09 ` Mikko Perttunen
0 siblings, 0 replies; 2+ messages in thread
From: Mikko Perttunen @ 2018-01-24 7:09 UTC (permalink / raw)
To: Christopher Díaz Riveros, thierry.reding, airlied, jonathanh
Cc: dri-devel, linux-tegra, linux-kernel, kernel-janitors
This nas been NAK'd before as harder to read than the current way.
Thanks,
Mikko
On 01/23/2018 10:29 PM, Christopher Díaz Riveros wrote:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
> ---
> drivers/gpu/drm/tegra/gem.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> index 49b9bf28f872..36c4ecc33e1a 100644
> --- a/drivers/gpu/drm/tegra/gem.c
> +++ b/drivers/gpu/drm/tegra/gem.c
> @@ -416,10 +416,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
>
> bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
> &args->handle);
> - if (IS_ERR(bo))
> - return PTR_ERR(bo);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(bo);
> }
>
> static int tegra_bo_fault(struct vm_fault *vmf)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-24 7:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 20:29 [PATCH-next] drm/tegra: gem: Use PTR_ERR_OR_ZERO Christopher Díaz Riveros
2018-01-24 7:09 ` Mikko Perttunen
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).