[PATCH] armada: no need to check return value of debugfs_create functions
Russell King - ARM Linux admin
linux at armlinux.org.uk
Thu Jun 13 14:36:00 UTC 2019
On Thu, Jun 13, 2019 at 03:28:50PM +0200, Greg Kroah-Hartman 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.
Please don't merge this patch - I have a change that conflicts with this
which switches us over to using drm_debugfs_create_files(), thereby
eliminating this code.
>
> Cc: Russell King <linux at armlinux.org.uk>
> Cc: David Airlie <airlied at linux.ie>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Cc: dri-devel at lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> ---
> drivers/gpu/drm/armada/armada_debugfs.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
> index 6758c3a83de2..aec1e7372371 100644
> --- a/drivers/gpu/drm/armada/armada_debugfs.c
> +++ b/drivers/gpu/drm/armada/armada_debugfs.c
> @@ -109,7 +109,6 @@ static struct drm_info_list armada_debugfs_list[] = {
>
> int armada_drm_debugfs_init(struct drm_minor *minor)
> {
> - struct dentry *de;
> int ret;
>
> ret = drm_debugfs_create_files(armada_debugfs_list,
> @@ -118,15 +117,10 @@ int armada_drm_debugfs_init(struct drm_minor *minor)
> if (ret)
> return ret;
>
> - de = debugfs_create_file("reg", S_IFREG | S_IRUSR,
> - minor->debugfs_root, minor->dev, &fops_reg_r);
> - if (!de)
> - return -ENOMEM;
> -
> - de = debugfs_create_file("reg_wr", S_IFREG | S_IWUSR,
> - minor->debugfs_root, minor->dev, &fops_reg_w);
> - if (!de)
> - return -ENOMEM;
> + debugfs_create_file("reg", S_IFREG | S_IRUSR, minor->debugfs_root,
> + minor->dev, &fops_reg_r);
> + debugfs_create_file("reg_wr", S_IFREG | S_IWUSR, minor->debugfs_root,
> + minor->dev, &fops_reg_w);
>
> return 0;
> }
> --
> 2.22.0
>
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
More information about the dri-devel
mailing list