public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gcov: no need to check return value of debugfs_create functions
Date: Wed, 23 Jan 2019 14:43:07 +0100	[thread overview]
Message-ID: <20190123134307.GD24700@kroah.com> (raw)
In-Reply-To: <b277b33b-bcc0-c1c5-52d6-9e1580531df3@linux.ibm.com>

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@linux.ibm.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  kernel/gcov/fs.c | 22 ++--------------------
> >  1 file changed, 2 insertions(+), 20 deletions(-)
> 
> Acked-by: Peter Oberparleiter <oberpar@linux.ibm.com>
> 
> Compile test was successful, but the patch introduces a compile warning.
> Could you merge the attached patch?
> 
> 8<===
> From: Peter Oberparleiter <oberpar@linux.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@linux.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

      reply	other threads:[~2019-01-23 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 15:21 [PATCH] gcov: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-23 13:22 ` Peter Oberparleiter
2019-01-23 13:43   ` Greg Kroah-Hartman [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=20190123134307.GD24700@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oberpar@linux.ibm.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