public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Wambui Karuga <wambui.karugax@gmail.com>
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH 1/2] drm/debugfs: remove checks for return value of drm_debugfs functions.
Date: Tue, 18 Feb 2020 20:09:40 +0100	[thread overview]
Message-ID: <20200218190940.GN2363188@phenom.ffwll.local> (raw)
In-Reply-To: <20200218172821.18378-3-wambui.karugax@gmail.com>

On Tue, Feb 18, 2020 at 08:28:14PM +0300, Wambui Karuga wrote:
> As there is no need to check the return value of
> drm_debugfs_create_files, remove unnecessary checks and error handling
> statement blocks.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

I'd split this up a bit differently, with a patch per function. But then
including in that patch the prototype change (at least for the
drm-internal ones that aren't used by drivers). This way reviewers don't
have to check the entire series to make sure that we drop the now
pointeless return value from the implementation of these functions.

I guess you could also just squash this function into the last one, it's a
fairly small patch still.
-Daniel

> ---
>  drivers/gpu/drm/drm_debugfs.c | 28 +++++-----------------------
>  1 file changed, 5 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index 4e673d318503..6a2f141b6a38 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -215,35 +215,17 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
>  	sprintf(name, "%d", minor_id);
>  	minor->debugfs_root = debugfs_create_dir(name, root);
>  
> -	ret = drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
> -				       minor->debugfs_root, minor);
> -	if (ret) {
> -		debugfs_remove(minor->debugfs_root);
> -		minor->debugfs_root = NULL;
> -		DRM_ERROR("Failed to create core drm debugfs files\n");
> -		return ret;
> -	}
> +	drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
> +				 minor->debugfs_root, minor);
>  
>  	if (drm_drv_uses_atomic_modeset(dev)) {
> -		ret = drm_atomic_debugfs_init(minor);
> -		if (ret) {
> -			DRM_ERROR("Failed to create atomic debugfs files\n");
> -			return ret;
> -		}
> +		drm_atomic_debugfs_init(minor);
>  	}
>  
>  	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
> -		ret = drm_framebuffer_debugfs_init(minor);
> -		if (ret) {
> -			DRM_ERROR("Failed to create framebuffer debugfs file\n");
> -			return ret;
> -		}
> +		drm_framebuffer_debugfs_init(minor);
>  
> -		ret = drm_client_debugfs_init(minor);
> -		if (ret) {
> -			DRM_ERROR("Failed to create client debugfs file\n");
> -			return ret;
> -		}
> +		drm_client_debugfs_init(minor);
>  	}
>  
>  	if (dev->driver->debugfs_init) {
> -- 
> 2.25.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2020-02-18 19:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 17:28 [PATCH] drm/arc: make arcpgu_debugfs_init return 0 Wambui Karuga
2020-02-18 17:28 ` [PATCH] drm/arm: make hdlcd_debugfs_init " Wambui Karuga
2020-02-24 13:59   ` Liviu Dudau
2020-02-18 17:28 ` [PATCH 1/2] drm/debugfs: remove checks for return value of drm_debugfs functions Wambui Karuga
2020-02-18 19:09   ` Daniel Vetter [this message]
2020-02-18 17:28 ` [PATCH] drm/etnaviv: remove check for return value of drm_debugfs function Wambui Karuga
2020-02-18 17:38   ` Lucas Stach
2020-02-18 18:02     ` Wambui Karuga
2020-02-18 17:28 ` [PATCH] drm/i915: make i915_debugfs_register return void Wambui Karuga
2020-02-18 17:28 ` [PATCH] drm/nouveau: remove checks for return value of debugfs functions Wambui Karuga
2020-02-19  5:39   ` [Nouveau] " Ben Skeggs
2020-02-18 17:28 ` [PATCH] drm/v3d: make v3d_debugfs_init return 0 Wambui Karuga
2020-02-19 18:46   ` Eric Anholt
2020-02-18 17:28 ` [PATCH] drm/vc4: remove check of return value of drm_debugfs functions Wambui Karuga
2020-02-18 17:28 ` [PATCH] drm/vram-helper: make drm_vram_mm_debugfs_init return 0 Wambui Karuga
2020-02-19  6:00   ` Thomas Zimmermann
2020-02-18 17:28 ` [PATCH 2/2] drm: convert drm_debugfs functions to return void Wambui Karuga
2020-02-18 18:19 ` [PATCH] drm/arc: make arcpgu_debugfs_init return 0 Greg KH
2020-02-18 19:00 ` Daniel Vetter
2020-02-18 19:18   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200218190940.GN2363188@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=wambui.karugax@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox