From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Zhang Rui <rui.zhang@intel.com>,
Eduardo Valentin <edubezval@gmail.com>
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal: intel: no need to check return value of debugfs_create functions
Date: Fri, 14 Jun 2019 12:08:29 +0200 [thread overview]
Message-ID: <71c4ed0f-45ee-fec5-1b02-9f14b410682d@linaro.org> (raw)
In-Reply-To: <20190613183830.GD32085@kroah.com>
On 13/06/2019 20:38, 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.
>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Eduardo Valentin <edubezval@gmail.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> drivers/thermal/intel/x86_pkg_temp_thermal.c | 25 ++++----------------
> 1 file changed, 5 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c
> index 1ef937d799e4..f0441ac25555 100644
> --- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
> +++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
> @@ -87,29 +87,14 @@ static struct dentry *debugfs;
> static unsigned int pkg_interrupt_cnt;
> static unsigned int pkg_work_cnt;
>
> -static int pkg_temp_debugfs_init(void)
> +static void pkg_temp_debugfs_init(void)
> {
> - struct dentry *d;
> -
> debugfs = debugfs_create_dir("pkg_temp_thermal", NULL);
> - if (!debugfs)
> - return -ENOENT;
> -
> - d = debugfs_create_u32("pkg_thres_interrupt", S_IRUGO, debugfs,
> - &pkg_interrupt_cnt);
> - if (!d)
> - goto err_out;
> -
> - d = debugfs_create_u32("pkg_thres_work", S_IRUGO, debugfs,
> - &pkg_work_cnt);
> - if (!d)
> - goto err_out;
>
> - return 0;
> -
> -err_out:
> - debugfs_remove_recursive(debugfs);
> - return -ENOENT;
> + debugfs_create_u32("pkg_thres_interrupt", S_IRUGO, debugfs,
> + &pkg_interrupt_cnt);
> + debugfs_create_u32("pkg_thres_work", S_IRUGO, debugfs,
> + &pkg_work_cnt);
> }
>
> /*
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
prev parent reply other threads:[~2019-06-14 10:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 18:38 [PATCH] thermal: intel: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-06-14 10:08 ` Daniel Lezcano [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=71c4ed0f-45ee-fec5-1b02-9f14b410682d@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=edubezval@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@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;
as well as URLs for NNTP newsgroup(s).