linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: simplify the return expression of nouveau_debugfs_init()
@ 2022-04-29  9:03 cgel.zte
  2022-04-29 19:38 ` Lyude Paul
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-29  9:03 UTC (permalink / raw)
  To: bskeggs
  Cc: kherbst, lyude, dri-devel, nouveau, linux-kernel, Minghao Chi,
	Zeal Robot

From: Minghao Chi <chi.minghao@zte.com.cn>

Simplify the return expression.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 1cbe01048b93..76b621f99916 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -255,19 +255,13 @@ nouveau_drm_debugfs_init(struct drm_minor *minor)
 int
 nouveau_debugfs_init(struct nouveau_drm *drm)
 {
-	int ret;
-
 	drm->debugfs = kzalloc(sizeof(*drm->debugfs), GFP_KERNEL);
 	if (!drm->debugfs)
 		return -ENOMEM;
 
-	ret = nvif_object_ctor(&drm->client.device.object, "debugfsCtrl", 0,
+	return nvif_object_ctor(&drm->client.device.object, "debugfsCtrl", 0,
 			       NVIF_CLASS_CONTROL, NULL, 0,
 			       &drm->debugfs->ctrl);
-	if (ret)
-		return ret;
-
-	return 0;
 }
 
 void
-- 
2.25.1



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

* Re: [PATCH] drm/nouveau: simplify the return expression of nouveau_debugfs_init()
  2022-04-29  9:03 [PATCH] drm/nouveau: simplify the return expression of nouveau_debugfs_init() cgel.zte
@ 2022-04-29 19:38 ` Lyude Paul
  0 siblings, 0 replies; 2+ messages in thread
From: Lyude Paul @ 2022-04-29 19:38 UTC (permalink / raw)
  To: cgel.zte, bskeggs
  Cc: kherbst, dri-devel, nouveau, linux-kernel, Minghao Chi, Zeal Robot

Reviewed-by: Lyude Paul <lyude@redhat.com>

Will push to drm-misc-next in a bit

(Kind of impressed that a bot managed to catch this, considering the route
from here to the code capable of returning < 0 or 0 was definitely not
obvious)

On Fri, 2022-04-29 at 09:03 +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Simplify the return expression.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  drivers/gpu/drm/nouveau/nouveau_debugfs.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> index 1cbe01048b93..76b621f99916 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> @@ -255,19 +255,13 @@ nouveau_drm_debugfs_init(struct drm_minor *minor)
>  int
>  nouveau_debugfs_init(struct nouveau_drm *drm)
>  {
> -       int ret;
> -
>         drm->debugfs = kzalloc(sizeof(*drm->debugfs), GFP_KERNEL);
>         if (!drm->debugfs)
>                 return -ENOMEM;
>  
> -       ret = nvif_object_ctor(&drm->client.device.object, "debugfsCtrl", 0,
> +       return nvif_object_ctor(&drm->client.device.object, "debugfsCtrl",
> 0,
>                                NVIF_CLASS_CONTROL, NULL, 0,
>                                &drm->debugfs->ctrl);
> -       if (ret)
> -               return ret;
> -
> -       return 0;
>  }
>  
>  void

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

end of thread, other threads:[~2022-04-29 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29  9:03 [PATCH] drm/nouveau: simplify the return expression of nouveau_debugfs_init() cgel.zte
2022-04-29 19:38 ` Lyude Paul

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