Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: mayhs11saini@gmail.com (Shyam Saini)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] mfd: Remove unused variable using Coccinelle
Date: Mon, 10 Oct 2016 07:06:59 +0530	[thread overview]
Message-ID: <1476063419-13866-1-git-send-email-mayhs11saini@gmail.com> (raw)

The variable err is initialized but never used otherwise.

The semantic patch that makes this change is as follows:

// <smpl>
@@
type T;
identifier i;
constant C;
@@

(
extern T i;
|
- T i;
  <+... when != i
- i = C;
  ...+>
)
// </smpl>

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
 drivers/mfd/ab3100-core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index 6a5a988..3ebb2f0 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -584,8 +584,6 @@ static struct dentry *ab3100_set_reg_file;
 
 static void ab3100_setup_debugfs(struct ab3100 *ab3100)
 {
-	int err;
-
 	ab3100_dir = debugfs_create_dir("ab3100", NULL);
 	if (!ab3100_dir)
 		goto exit_no_debugfs;
@@ -594,7 +592,6 @@ static void ab3100_setup_debugfs(struct ab3100 *ab3100)
 				S_IRUGO, ab3100_dir, ab3100,
 				&ab3100_registers_fops);
 	if (!ab3100_reg_file) {
-		err = -ENOMEM;
 		goto exit_destroy_dir;
 	}
 
@@ -604,7 +601,6 @@ static void ab3100_setup_debugfs(struct ab3100 *ab3100)
 				S_IWUSR, ab3100_dir, &ab3100_get_priv,
 				&ab3100_get_set_reg_fops);
 	if (!ab3100_get_reg_file) {
-		err = -ENOMEM;
 		goto exit_destroy_reg;
 	}
 
@@ -614,7 +610,6 @@ static void ab3100_setup_debugfs(struct ab3100 *ab3100)
 				S_IWUSR, ab3100_dir, &ab3100_set_priv,
 				&ab3100_get_set_reg_fops);
 	if (!ab3100_set_reg_file) {
-		err = -ENOMEM;
 		goto exit_destroy_get_reg;
 	}
 	return;
-- 
2.7.4

             reply	other threads:[~2016-10-10  1:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  1:36 Shyam Saini [this message]
2016-10-10 11:39 ` [PATCH 1/1] mfd: Remove unused variable using Coccinelle Linus Walleij

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=1476063419-13866-1-git-send-email-mayhs11saini@gmail.com \
    --to=mayhs11saini@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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