[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190123094250.GA3227@zn.tnic>
Date: Wed, 23 Jan 2019 10:42:50 +0100
From: Borislav Petkov <bp@...en8.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-edac@...r.kernel.org
Subject: Re: [PATCH] edac: no need to check return value of debugfs_create
functions
On Tue, Jan 22, 2019 at 04:21:16PM +0100, 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: Borislav Petkov <bp@...en8.de>
> Cc: Mauro Carvalho Chehab <mchehab@...nel.org>
> Cc: linux-edac@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
> drivers/edac/debugfs.c | 45 ++++++++++----------------------------
> drivers/edac/edac_module.h | 4 ++--
> 2 files changed, 13 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/edac/debugfs.c b/drivers/edac/debugfs.c
> index 92dbb7e2320c..fd27ea0453a3 100644
> --- a/drivers/edac/debugfs.c
> +++ b/drivers/edac/debugfs.c
> @@ -44,10 +44,6 @@ static const struct file_operations debug_fake_inject_fops = {
> int __init edac_debugfs_init(void)
> {
> edac_debugfs = debugfs_create_dir("edac", NULL);
> - if (IS_ERR(edac_debugfs)) {
> - edac_debugfs = NULL;
> - return -ENOMEM;
> - }
> return 0;
> }
Applied after making that function void too.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists