mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Oberparleiter <oberpar@linux.ibm.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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:22:33 +0100	[thread overview]
Message-ID: <b277b33b-bcc0-c1c5-52d6-9e1580531df3@linux.ibm.com> (raw)
In-Reply-To: <20190122152151.16139-49-gregkh@linuxfoundation.org>

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
-- 
2.17.0

-- 
Peter Oberparleiter
Linux on Z Development - IBM Germany


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 15:21 Greg Kroah-Hartman
2019-01-23 13:22 ` Peter Oberparleiter [this message]
2019-01-23 13:43   ` Greg Kroah-Hartman

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=b277b33b-bcc0-c1c5-52d6-9e1580531df3@linux.ibm.com \
    --to=oberpar@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®