All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] radeon: no need to check return value of debugfs_create functions
@ 2019-06-13 11:56 Greg Kroah-Hartman
  2019-06-13 14:54 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-06-13 11:56 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David (ChunMing) Zhou,
	David Airlie, Daniel Vetter
  Cc: dri-devel, amd-gfx

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/radeon/radeon_ttm.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 5d42f8d8e68d..6bbccc796e40 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -1056,19 +1056,14 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
 	unsigned count;
 
 	struct drm_minor *minor = rdev->ddev->primary;
-	struct dentry *ent, *root = minor->debugfs_root;
-
-	ent = debugfs_create_file("radeon_vram", S_IFREG | S_IRUGO, root,
-				  rdev, &radeon_ttm_vram_fops);
-	if (IS_ERR(ent))
-		return PTR_ERR(ent);
-	rdev->mman.vram = ent;
-
-	ent = debugfs_create_file("radeon_gtt", S_IFREG | S_IRUGO, root,
-				  rdev, &radeon_ttm_gtt_fops);
-	if (IS_ERR(ent))
-		return PTR_ERR(ent);
-	rdev->mman.gtt = ent;
+	struct dentry *root = minor->debugfs_root;
+
+	rdev->mman.vram = debugfs_create_file("radeon_vram", S_IFREG | S_IRUGO,
+					      root, rdev,
+					      &radeon_ttm_vram_fops);
+
+	rdev->mman.gtt = debugfs_create_file("radeon_gtt", S_IFREG | S_IRUGO,
+					     root, rdev, &radeon_ttm_gtt_fops);
 
 	count = ARRAY_SIZE(radeon_ttm_debugfs_list);
 
-- 
2.22.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] radeon: no need to check return value of debugfs_create functions
  2019-06-13 11:56 [PATCH] radeon: no need to check return value of debugfs_create functions Greg Kroah-Hartman
@ 2019-06-13 14:54 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2019-06-13 14:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: David Airlie, Maling list - DRI developers, amd-gfx list,
	Alex Deucher, Christian König

On Thu, Jun 13, 2019 at 7:56 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> When calling debugfs functions, there is no need to ever check the
> return value.  The function can work or not, but the code logic should
> never do something different based on this.
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Applied all the radeon and amdgpu patches.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_ttm.c | 21 ++++++++-------------
>  1 file changed, 8 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 5d42f8d8e68d..6bbccc796e40 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -1056,19 +1056,14 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
>         unsigned count;
>
>         struct drm_minor *minor = rdev->ddev->primary;
> -       struct dentry *ent, *root = minor->debugfs_root;
> -
> -       ent = debugfs_create_file("radeon_vram", S_IFREG | S_IRUGO, root,
> -                                 rdev, &radeon_ttm_vram_fops);
> -       if (IS_ERR(ent))
> -               return PTR_ERR(ent);
> -       rdev->mman.vram = ent;
> -
> -       ent = debugfs_create_file("radeon_gtt", S_IFREG | S_IRUGO, root,
> -                                 rdev, &radeon_ttm_gtt_fops);
> -       if (IS_ERR(ent))
> -               return PTR_ERR(ent);
> -       rdev->mman.gtt = ent;
> +       struct dentry *root = minor->debugfs_root;
> +
> +       rdev->mman.vram = debugfs_create_file("radeon_vram", S_IFREG | S_IRUGO,
> +                                             root, rdev,
> +                                             &radeon_ttm_vram_fops);
> +
> +       rdev->mman.gtt = debugfs_create_file("radeon_gtt", S_IFREG | S_IRUGO,
> +                                            root, rdev, &radeon_ttm_gtt_fops);
>
>         count = ARRAY_SIZE(radeon_ttm_debugfs_list);
>
> --
> 2.22.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-06-13 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-13 11:56 [PATCH] radeon: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-13 14:54 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.