From: Jani Nikula <jani.nikula@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] i915: no need to check return value of debugfs_create functions
Date: Thu, 13 Jun 2019 17:53:41 +0300 [thread overview]
Message-ID: <87h88twn7u.fsf@intel.com> (raw)
In-Reply-To: <20190613133356.GA6634@kroah.com>
On Thu, 13 Jun 2019, 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: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks, looks good, but for some reason this was not picked up by our
CI. I resent it with hopes we'll get some test results too.
BR,
Jani.
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 20 +++++++-------------
> 1 file changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 5823ffb17821..bd5cf8ec254d 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4648,23 +4648,17 @@ static const struct i915_debugfs_files {
> int i915_debugfs_register(struct drm_i915_private *dev_priv)
> {
> struct drm_minor *minor = dev_priv->drm.primary;
> - struct dentry *ent;
> int i;
>
> - ent = debugfs_create_file("i915_forcewake_user", S_IRUSR,
> - minor->debugfs_root, to_i915(minor->dev),
> - &i915_forcewake_fops);
> - if (!ent)
> - return -ENOMEM;
> + debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root,
> + to_i915(minor->dev), &i915_forcewake_fops);
>
> for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
> - ent = debugfs_create_file(i915_debugfs_files[i].name,
> - S_IRUGO | S_IWUSR,
> - minor->debugfs_root,
> - to_i915(minor->dev),
> - i915_debugfs_files[i].fops);
> - if (!ent)
> - return -ENOMEM;
> + debugfs_create_file(i915_debugfs_files[i].name,
> + S_IRUGO | S_IWUSR,
> + minor->debugfs_root,
> + to_i915(minor->dev),
> + i915_debugfs_files[i].fops);
> }
>
> return drm_debugfs_create_files(i915_debugfs_list,
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2019-06-13 14:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 13:33 [PATCH] i915: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-13 14:53 ` Jani Nikula [this message]
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=87h88twn7u.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=rodrigo.vivi@intel.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