From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] armada: no need to check return value of debugfs_create functions
Date: Thu, 13 Jun 2019 15:36:00 +0100 [thread overview]
Message-ID: <20190613143600.ldcqfw4s3t2pxh2y@shell.armlinux.org.uk> (raw)
In-Reply-To: <20190613132850.GC4863@kroah.com>
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@armlinux.org.uk>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-06-13 14:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 13:28 [PATCH] armada: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-13 14:36 ` Russell King - ARM Linux admin [this message]
2019-06-13 16:01 ` Greg Kroah-Hartman
2019-06-13 16:15 ` Russell King - ARM Linux admin
2019-06-13 17:43 ` Greg Kroah-Hartman
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=20190613143600.ldcqfw4s3t2pxh2y@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
/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