All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

* [PATCH 1/1] mfd: Remove unused variable using Coccinelle
  2016-10-10  1:36 [PATCH 1/1] mfd: Remove unused variable using Coccinelle Shyam Saini
@ 2016-10-10 11:39 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2016-10-10 11:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 10, 2016 at 3:36 AM, Shyam Saini <mayhs11saini@gmail.com> wrote:

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

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.