* [PATCH 1/1] mfd: Remove unused variable using Coccinelle
@ 2016-10-10 1:36 Shyam Saini
2016-10-10 11:39 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Shyam Saini @ 2016-10-10 1:36 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-10 11:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-10 1:36 [PATCH 1/1] mfd: Remove unused variable using Coccinelle Shyam Saini
2016-10-10 11:39 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox