Messages in this thread | | | Date | Wed, 23 Jan 2019 10:42:50 +0100 | From | Borislav Petkov <> | 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@alien8.de> > Cc: Mauro Carvalho Chehab <mchehab@kernel.org> > Cc: linux-edac@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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.
| |