[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFrLn=gTz80sw5f4W=0W86p9Ktj3Zo1b+4R-YZd-sbRNzA@mail.gmail.com>
Date: Wed, 23 Jan 2019 13:49:00 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Kevin Hilman <khilman@...nel.org>,
Len Brown <len.brown@...el.com>,
Linux PM <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] power: domain: no need to check return value of
debugfs_create functions
On Tue, 22 Jan 2019 at 16:23, Greg Kroah-Hartman
<gregkh@...uxfoundation.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: "Rafael J. Wysocki" <rjw@...ysocki.net>
> Cc: Kevin Hilman <khilman@...nel.org>
> Cc: Ulf Hansson <ulf.hansson@...aro.org>
> Cc: Len Brown <len.brown@...el.com>
> Cc: linux-pm@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Reviewed-by: Ulf Hansson <ulf.hansson@...aro.org>
Kind regards
Uffe
> ---
> drivers/base/power/domain.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 500de1dee967..45eafe8cf7dd 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -2948,18 +2948,11 @@ static int __init genpd_debug_init(void)
>
> genpd_debugfs_dir = debugfs_create_dir("pm_genpd", NULL);
>
> - if (!genpd_debugfs_dir)
> - return -ENOMEM;
> -
> - d = debugfs_create_file("pm_genpd_summary", S_IRUGO,
> - genpd_debugfs_dir, NULL, &summary_fops);
> - if (!d)
> - return -ENOMEM;
> + debugfs_create_file("pm_genpd_summary", S_IRUGO, genpd_debugfs_dir,
> + NULL, &summary_fops);
>
> list_for_each_entry(genpd, &gpd_list, gpd_list_node) {
> d = debugfs_create_dir(genpd->name, genpd_debugfs_dir);
> - if (!d)
> - return -ENOMEM;
>
> debugfs_create_file("current_state", 0444,
> d, genpd, &status_fops);
> --
> 2.20.1
>
Powered by blists - more mailing lists