[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190123134307.GD24700@kroah.com>
Date: Wed, 23 Jan 2019 14:43:07 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Peter Oberparleiter <oberpar@...ux.ibm.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gcov: no need to check return value of debugfs_create
functions
On Wed, Jan 23, 2019 at 02:22:33PM +0100, Peter Oberparleiter wrote:
> On 22.01.2019 16:21, 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.
> >
> > Also delete the dentry variable as it is never needed.
> >
> > Cc: Peter Oberparleiter <oberpar@...ux.ibm.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> > ---
> > kernel/gcov/fs.c | 22 ++--------------------
> > 1 file changed, 2 insertions(+), 20 deletions(-)
>
> Acked-by: Peter Oberparleiter <oberpar@...ux.ibm.com>
>
> Compile test was successful, but the patch introduces a compile warning.
> Could you merge the attached patch?
>
> 8<===
> From: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
> Subject: [PATCH] gcov: Fix compiler warning
>
> Fix compiler warning when compiling with CONFIG_GCOV_KERNEL=y:
>
> CC kernel/gcov/fs.o
> kernel/gcov/fs.c: In function ‘gcov_fs_init’:
> kernel/gcov/fs.c:756:6: warning: unused variable ‘rc’ [-Wunused-variable]
> int rc = -EIO;
> ^~
>
> Signed-off-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
> ---
> kernel/gcov/fs.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
> index aa9a49f72024..e5eb5ea7ea59 100644
> --- a/kernel/gcov/fs.c
> +++ b/kernel/gcov/fs.c
> @@ -753,8 +753,6 @@ void gcov_event(enum gcov_action action, struct gcov_info *info)
> /* Create debugfs entries. */
> static __init int gcov_fs_init(void)
> {
> - int rc = -EIO;
> -
> init_node(&root_node, NULL, NULL, NULL);
> /*
> * /sys/kernel/debug/gcov will be parent for the reset control file
> --
Ah, good catch, will do that, thanks.
greg k-h
Powered by blists - more mailing lists