Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1687990 > unrolled thread

[PATCH 05/11] irqchip/gic/realview: Drop unnecessary static

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2017-07-15 22:40 +0200
Last post2017-07-15 22:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 05/11] irqchip/gic/realview: Drop unnecessary static Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-15 22:40 +0200

#1687990 — [PATCH 05/11] irqchip/gic/realview: Drop unnecessary static

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-15 22:40 +0200
Subject[PATCH 05/11] irqchip/gic/realview: Drop unnecessary static
Message-ID<u3C13-64w-5@gated-at.bofh.it>
Drop static on a local variable, when the variable is initialized before
any possible use.  Thus, the static has no benefit.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@bad exists@
position p;
identifier x;
type T;
@@
static T x@p;
...
x = <+...x...+>

@@
identifier x;
expression e;
type T;
position p != bad.p;
@@
-static
 T x@p;
 ... when != x
     when strict
?x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
These patches are all independent of each other.

 drivers/irqchip/irq-gic-realview.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/irqchip/irq-gic-realview.c b/drivers/irqchip/irq-gic-realview.c
--- a/drivers/irqchip/irq-gic-realview.c
+++ b/drivers/irqchip/irq-gic-realview.c
@@ -43,7 +43,7 @@ static const struct of_device_id syscon_
 static int __init
 realview_gic_of_init(struct device_node *node, struct device_node *parent)
 {
-	static struct regmap *map;
+	struct regmap *map;
 	struct device_node *np;
 	const struct of_device_id *gic_id;
 	u32 pld1_ctrl;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web