All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 20:07 ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-fbdev, Lars-Peter Clausen, keescook, linux-iio,
	linux-input, kernel-janitors, linux-kernel, linux-ide, linux-mtd,
	Peter Meerwald-Stadler, Hartmut Knaack, linux-omap, linux-clk

These patches fix cases where there is a static on a local variable, but
the variable is initialized before any possible use.  Thus, the static has
no benefit.

---

 drivers/ata/sata_gemini.c                     |    2 +-
 drivers/clk/clk-moxart.c                      |    4 ++--
 drivers/clk/mmp/clk.c                         |    2 +-
 drivers/iio/orientation/hid-sensor-rotation.c |    2 +-
 drivers/irqchip/irq-digicolor.c               |    2 +-
 drivers/irqchip/irq-gic-realview.c            |    2 +-
 drivers/irqchip/irq-mips-cpu.c                |    2 +-
 drivers/mfd/max8925-i2c.c                     |    2 +-
 drivers/mfd/twl4030-irq.c                     |    2 +-
 drivers/mtd/maps/physmap_of_versatile.c       |    2 +-
 drivers/video/fbdev/da8xx-fb.c                |    2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 20:07 ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: keescook, kernel-janitors, linux-ide, linux-mtd, linux-kernel,
	linux-clk, linux-fbdev, linux-omap, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, linux-input,
	linux-iio

These patches fix cases where there is a static on a local variable, but
the variable is initialized before any possible use.  Thus, the static has
no benefit.

---

 drivers/ata/sata_gemini.c                     |    2 +-
 drivers/clk/clk-moxart.c                      |    4 ++--
 drivers/clk/mmp/clk.c                         |    2 +-
 drivers/iio/orientation/hid-sensor-rotation.c |    2 +-
 drivers/irqchip/irq-digicolor.c               |    2 +-
 drivers/irqchip/irq-gic-realview.c            |    2 +-
 drivers/irqchip/irq-mips-cpu.c                |    2 +-
 drivers/mfd/max8925-i2c.c                     |    2 +-
 drivers/mfd/twl4030-irq.c                     |    2 +-
 drivers/mtd/maps/physmap_of_versatile.c       |    2 +-
 drivers/video/fbdev/da8xx-fb.c                |    2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 20:07 ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

These patches fix cases where there is a static on a local variable, but
the variable is initialized before any possible use.  Thus, the static has
no benefit.

---

 drivers/ata/sata_gemini.c                     |    2 +-
 drivers/clk/clk-moxart.c                      |    4 ++--
 drivers/clk/mmp/clk.c                         |    2 +-
 drivers/iio/orientation/hid-sensor-rotation.c |    2 +-
 drivers/irqchip/irq-digicolor.c               |    2 +-
 drivers/irqchip/irq-gic-realview.c            |    2 +-
 drivers/irqchip/irq-mips-cpu.c                |    2 +-
 drivers/mfd/max8925-i2c.c                     |    2 +-
 drivers/mfd/twl4030-irq.c                     |    2 +-
 drivers/mtd/maps/physmap_of_versatile.c       |    2 +-
 drivers/video/fbdev/da8xx-fb.c                |    2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 20:07 ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-fbdev, Lars-Peter Clausen, keescook, linux-iio,
	linux-input, kernel-janitors, linux-kernel, linux-ide, linux-mtd,
	Peter Meerwald-Stadler, Hartmut Knaack, linux-omap, linux-clk

These patches fix cases where there is a static on a local variable, but
the variable is initialized before any possible use.  Thus, the static has
no benefit.

---

 drivers/ata/sata_gemini.c                     |    2 +-
 drivers/clk/clk-moxart.c                      |    4 ++--
 drivers/clk/mmp/clk.c                         |    2 +-
 drivers/iio/orientation/hid-sensor-rotation.c |    2 +-
 drivers/irqchip/irq-digicolor.c               |    2 +-
 drivers/irqchip/irq-gic-realview.c            |    2 +-
 drivers/irqchip/irq-mips-cpu.c                |    2 +-
 drivers/mfd/max8925-i2c.c                     |    2 +-
 drivers/mfd/twl4030-irq.c                     |    2 +-
 drivers/mtd/maps/physmap_of_versatile.c       |    2 +-
 drivers/video/fbdev/da8xx-fb.c                |    2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 20:07 ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

These patches fix cases where there is a static on a local variable, but
the variable is initialized before any possible use.  Thus, the static has
no benefit.

---

 drivers/ata/sata_gemini.c                     |    2 +-
 drivers/clk/clk-moxart.c                      |    4 ++--
 drivers/clk/mmp/clk.c                         |    2 +-
 drivers/iio/orientation/hid-sensor-rotation.c |    2 +-
 drivers/irqchip/irq-digicolor.c               |    2 +-
 drivers/irqchip/irq-gic-realview.c            |    2 +-
 drivers/irqchip/irq-mips-cpu.c                |    2 +-
 drivers/mfd/max8925-i2c.c                     |    2 +-
 drivers/mfd/twl4030-irq.c                     |    2 +-
 drivers/mtd/maps/physmap_of_versatile.c       |    2 +-
 drivers/video/fbdev/da8xx-fb.c                |    2 +-
 11 files changed, 12 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 01/11] clk: mmp: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Michael Turquette
  Cc: keescook, kernel-janitors, Stephen Boyd, linux-clk, linux-kernel

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/clk/mmp/clk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/clk/mmp/clk.c b/drivers/clk/mmp/clk.c
--- a/drivers/clk/mmp/clk.c
+++ b/drivers/clk/mmp/clk.c
@@ -9,7 +9,7 @@
 void mmp_clk_init(struct device_node *np, struct mmp_clk_unit *unit,
 		int nr_clks)
 {
-	static struct clk **clk_table;
+	struct clk **clk_table;
 
 	clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL);
 	if (!clk_table)

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 01/11] clk: mmp: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Michael Turquette
  Cc: keescook, kernel-janitors, Stephen Boyd, linux-clk, linux-kernel

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/clk/mmp/clk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/clk/mmp/clk.c b/drivers/clk/mmp/clk.c
--- a/drivers/clk/mmp/clk.c
+++ b/drivers/clk/mmp/clk.c
@@ -9,7 +9,7 @@
 void mmp_clk_init(struct device_node *np, struct mmp_clk_unit *unit,
 		int nr_clks)
 {
-	static struct clk **clk_table;
+	struct clk **clk_table;
 
 	clk_table = kcalloc(nr_clks, sizeof(struct clk *), GFP_KERNEL);
 	if (!clk_table)


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 02/11] clk: moxart: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Michael Turquette
  Cc: keescook, kernel-janitors, Stephen Boyd, linux-clk, linux-kernel

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/clk/clk-moxart.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/clk/clk-moxart.c b/drivers/clk/clk-moxart.c
--- a/drivers/clk/clk-moxart.c
+++ b/drivers/clk/clk-moxart.c
@@ -18,7 +18,7 @@
 
 static void __init moxart_of_pll_clk_init(struct device_node *node)
 {
-	static void __iomem *base;
+	void __iomem *base;
 	struct clk_hw *hw;
 	struct clk *ref_clk;
 	unsigned int mul;
@@ -57,7 +57,7 @@ CLK_OF_DECLARE(moxart_pll_clock, "moxa,m
 
 static void __init moxart_of_apb_clk_init(struct device_node *node)
 {
-	static void __iomem *base;
+	void __iomem *base;
 	struct clk_hw *hw;
 	struct clk *pll_clk;
 	unsigned int div, val;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 02/11] clk: moxart: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Michael Turquette
  Cc: keescook, kernel-janitors, Stephen Boyd, linux-clk, linux-kernel

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/clk/clk-moxart.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/clk/clk-moxart.c b/drivers/clk/clk-moxart.c
--- a/drivers/clk/clk-moxart.c
+++ b/drivers/clk/clk-moxart.c
@@ -18,7 +18,7 @@
 
 static void __init moxart_of_pll_clk_init(struct device_node *node)
 {
-	static void __iomem *base;
+	void __iomem *base;
 	struct clk_hw *hw;
 	struct clk *ref_clk;
 	unsigned int mul;
@@ -57,7 +57,7 @@ CLK_OF_DECLARE(moxart_pll_clock, "moxa,m
 
 static void __init moxart_of_apb_clk_init(struct device_node *node)
 {
-	static void __iomem *base;
+	void __iomem *base;
 	struct clk_hw *hw;
 	struct clk *pll_clk;
 	unsigned int div, val;


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 03/11] mtd: physmap_of: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: David Woodhouse
  Cc: keescook, kernel-janitors, Brian Norris, Boris Brezillon,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, linux-mtd,
	linux-kernel

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/mtd/maps/physmap_of_versatile.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
--- a/drivers/mtd/maps/physmap_of_versatile.c
+++ b/drivers/mtd/maps/physmap_of_versatile.c
@@ -97,7 +97,7 @@ static const struct of_device_id ebi_mat
 static int ap_flash_init(struct platform_device *pdev)
 {
 	struct device_node *ebi;
-	static void __iomem *ebi_base;
+	void __iomem *ebi_base;
 	u32 val;
 	int ret;
 

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 03/11] mtd: physmap_of: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: David Woodhouse
  Cc: keescook, kernel-janitors, Brian Norris, Boris Brezillon,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, linux-mtd,
	linux-kernel

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/mtd/maps/physmap_of_versatile.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
--- a/drivers/mtd/maps/physmap_of_versatile.c
+++ b/drivers/mtd/maps/physmap_of_versatile.c
@@ -97,7 +97,7 @@ static const struct of_device_id ebi_mat
 static int ap_flash_init(struct platform_device *pdev)
 {
 	struct device_node *ebi;
-	static void __iomem *ebi_base;
+	void __iomem *ebi_base;
 	u32 val;
 	int ret;
 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: keescook, kernel-janitors, linux-fbdev, linux-kernel

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/video/fbdev/da8xx-fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c
@@ -1341,7 +1341,7 @@ static int fb_probe(struct platform_devi
 {
 	struct da8xx_lcdc_platform_data *fb_pdata =
 						dev_get_platdata(&device->dev);
-	static struct resource *lcdc_regs;
+	struct resource *lcdc_regs;
 	struct lcd_ctrl_config *lcd_cfg;
 	struct fb_videomode *lcdc_info;
 	struct fb_info *da8xx_fb_info;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: keescook, kernel-janitors, linux-fbdev, linux-kernel

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/video/fbdev/da8xx-fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c
@@ -1341,7 +1341,7 @@ static int fb_probe(struct platform_devi
 {
 	struct da8xx_lcdc_platform_data *fb_pdata  						dev_get_platdata(&device->dev);
-	static struct resource *lcdc_regs;
+	struct resource *lcdc_regs;
 	struct lcd_ctrl_config *lcd_cfg;
 	struct fb_videomode *lcdc_info;
 	struct fb_info *da8xx_fb_info;


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 05/11] irqchip/gic/realview: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: keescook, kernel-janitors, Jason Cooper, Marc Zyngier, linux-kernel

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;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 05/11] irqchip/gic/realview: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: keescook, kernel-janitors, Jason Cooper, Marc Zyngier, linux-kernel

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;


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: keescook, kernel-janitors, Jason Cooper, Marc Zyngier, linux-kernel

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-mips-cpu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
--- a/drivers/irqchip/irq-mips-cpu.c
+++ b/drivers/irqchip/irq-mips-cpu.c
@@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
 static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
 			     irq_hw_number_t hw)
 {
-	static struct irq_chip *chip;
+	struct irq_chip *chip;
 
 	if (hw < 2 && cpu_has_mipsmt) {
 		/* Software interrupts are used for MT/CMT IPI */

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: keescook, kernel-janitors, Jason Cooper, Marc Zyngier, linux-kernel

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-mips-cpu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
--- a/drivers/irqchip/irq-mips-cpu.c
+++ b/drivers/irqchip/irq-mips-cpu.c
@@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
 static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
 			     irq_hw_number_t hw)
 {
-	static struct irq_chip *chip;
+	struct irq_chip *chip;
 
 	if (hw < 2 && cpu_has_mipsmt) {
 		/* Software interrupts are used for MT/CMT IPI */


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 07/11] mfd: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: keescook, kernel-janitors, Lee Jones, linux-omap, linux-kernel

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/mfd/twl4030-irq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
 
 int twl4030_init_irq(struct device *dev, int irq_num)
 {
-	static struct irq_chip	twl4030_irq_chip;
+	struct irq_chip		twl4030_irq_chip;
 	int			status, i;
 	int			irq_base, irq_end, nr_irqs;
 	struct			device_node *node = dev->of_node;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 07/11] mfd: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: keescook, kernel-janitors, Lee Jones, linux-omap, linux-kernel

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/mfd/twl4030-irq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
 
 int twl4030_init_irq(struct device *dev, int irq_num)
 {
-	static struct irq_chip	twl4030_irq_chip;
+	struct irq_chip		twl4030_irq_chip;
 	int			status, i;
 	int			irq_base, irq_end, nr_irqs;
 	struct			device_node *node = dev->of_node;


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 08/11] ata: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Linus Walleij
  Cc: keescook, kernel-janitors, Tejun Heo, linux-ide, linux-kernel

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/ata/sata_gemini.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
--- a/drivers/ata/sata_gemini.c
+++ b/drivers/ata/sata_gemini.c
@@ -305,7 +305,7 @@ static int gemini_sata_probe(struct plat
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct sata_gemini *sg;
-	static struct regmap *map;
+	struct regmap *map;
 	struct resource *res;
 	enum gemini_muxmode muxmode;
 	u32 gmode;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 08/11] ata: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Linus Walleij
  Cc: keescook, kernel-janitors, Tejun Heo, linux-ide, linux-kernel

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/ata/sata_gemini.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
--- a/drivers/ata/sata_gemini.c
+++ b/drivers/ata/sata_gemini.c
@@ -305,7 +305,7 @@ static int gemini_sata_probe(struct plat
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct sata_gemini *sg;
-	static struct regmap *map;
+	struct regmap *map;
 	struct resource *res;
 	enum gemini_muxmode muxmode;
 	u32 gmode;


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 09/11] iio: orientation: hid-sensor-rotation: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: keescook, kernel-janitors, Jonathan Cameron, Srinivas Pandruvada,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-input, linux-iio, linux-kernel

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/iio/orientation/hid-sensor-rotation.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c
--- a/drivers/iio/orientation/hid-sensor-rotation.c
+++ b/drivers/iio/orientation/hid-sensor-rotation.c
@@ -238,7 +238,7 @@ static int dev_rot_parse_report(struct p
 static int hid_dev_rot_probe(struct platform_device *pdev)
 {
 	int ret;
-	static char *name;
+	char *name;
 	struct iio_dev *indio_dev;
 	struct dev_rot_state *rot_state;
 	struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 09/11] iio: orientation: hid-sensor-rotation: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: keescook, kernel-janitors, Jonathan Cameron, Srinivas Pandruvada,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-input, linux-iio, linux-kernel

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/iio/orientation/hid-sensor-rotation.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c
--- a/drivers/iio/orientation/hid-sensor-rotation.c
+++ b/drivers/iio/orientation/hid-sensor-rotation.c
@@ -238,7 +238,7 @@ static int dev_rot_parse_report(struct p
 static int hid_dev_rot_probe(struct platform_device *pdev)
 {
 	int ret;
-	static char *name;
+	char *name;
 	struct iio_dev *indio_dev;
 	struct dev_rot_state *rot_state;
 	struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 10/11] irqchip: digicolor: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
  (?)
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: keescook, kernel-janitors, Jason Cooper, Marc Zyngier,
	Baruch Siach, linux-kernel, linux-arm-kernel

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-digicolor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
--- a/drivers/irqchip/irq-digicolor.c
+++ b/drivers/irqchip/irq-digicolor.c
@@ -71,7 +71,7 @@ static void __init digicolor_set_gc(void
 static int __init digicolor_of_init(struct device_node *node,
 				struct device_node *parent)
 {
-	static void __iomem *reg_base;
+	void __iomem *reg_base;
 	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
 	struct regmap *ucregs;
 	int ret;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 10/11] irqchip: digicolor: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

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-digicolor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
--- a/drivers/irqchip/irq-digicolor.c
+++ b/drivers/irqchip/irq-digicolor.c
@@ -71,7 +71,7 @@ static void __init digicolor_set_gc(void
 static int __init digicolor_of_init(struct device_node *node,
 				struct device_node *parent)
 {
-	static void __iomem *reg_base;
+	void __iomem *reg_base;
 	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
 	struct regmap *ucregs;
 	int ret;


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 10/11] irqchip: digicolor: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

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 at p;
...
x = <+...x...+>

@@
identifier x;
expression e;
type T;
position p != bad.p;
@@
-static
 T x at 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-digicolor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
--- a/drivers/irqchip/irq-digicolor.c
+++ b/drivers/irqchip/irq-digicolor.c
@@ -71,7 +71,7 @@ static void __init digicolor_set_gc(void
 static int __init digicolor_of_init(struct device_node *node,
 				struct device_node *parent)
 {
-	static void __iomem *reg_base;
+	void __iomem *reg_base;
 	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
 	struct regmap *ucregs;
 	int ret;

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 11/11] mfd: max8925-i2c: Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
@ 2017-07-15 20:07   ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Lee Jones; +Cc: keescook, kernel-janitors, linux-kernel

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/mfd/max8925-i2c.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -151,7 +151,7 @@ static int max8925_probe(struct i2c_clie
 				   const struct i2c_device_id *id)
 {
 	struct max8925_platform_data *pdata = dev_get_platdata(&client->dev);
-	static struct max8925_chip *chip;
+	struct max8925_chip *chip;
 	struct device_node *node = client->dev.of_node;
 
 	if (node && !pdata) {

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 11/11] mfd: max8925-i2c: Drop unnecessary static
@ 2017-07-15 20:07   ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:07 UTC (permalink / raw)
  To: Lee Jones; +Cc: keescook, kernel-janitors, linux-kernel

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/mfd/max8925-i2c.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -151,7 +151,7 @@ static int max8925_probe(struct i2c_clie
 				   const struct i2c_device_id *id)
 {
 	struct max8925_platform_data *pdata = dev_get_platdata(&client->dev);
-	static struct max8925_chip *chip;
+	struct max8925_chip *chip;
 	struct device_node *node = client->dev.of_node;
 
 	if (node && !pdata) {


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/11] Drop unnecessary static
  2017-07-15 20:07 ` Julia Lawall
  (?)
@ 2017-07-15 20:37   ` Joe Perches
  -1 siblings, 0 replies; 74+ messages in thread
From: Joe Perches @ 2017-07-15 20:37 UTC (permalink / raw)
  To: Julia Lawall, linux-arm-kernel
  Cc: keescook, kernel-janitors, linux-ide, linux-mtd, linux-kernel,
	linux-clk, linux-fbdev, linux-omap, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, linux-input,
	linux-iio

On Sat, 2017-07-15 at 22:07 +0200, Julia Lawall wrote:
> These patches fix cases where there is a static on a local variable, but
> the variable is initialized before any possible use.  Thus, the static has
> no benefit.

Nice one.


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 20:37   ` Joe Perches
  0 siblings, 0 replies; 74+ messages in thread
From: Joe Perches @ 2017-07-15 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2017-07-15 at 22:07 +0200, Julia Lawall wrote:
> These patches fix cases where there is a static on a local variable, but
> the variable is initialized before any possible use.  Thus, the static has
> no benefit.

Nice one.


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 20:37   ` Joe Perches
  0 siblings, 0 replies; 74+ messages in thread
From: Joe Perches @ 2017-07-15 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2017-07-15 at 22:07 +0200, Julia Lawall wrote:
> These patches fix cases where there is a static on a local variable, but
> the variable is initialized before any possible use.  Thus, the static has
> no benefit.

Nice one.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-15 20:49     ` Mark D Rustad
  -1 siblings, 0 replies; 74+ messages in thread
From: Mark D Rustad @ 2017-07-15 20:49 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Tony Lindgren, keescook, kernel-janitors, Lee Jones, linux-omap,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

> On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> 
> Drop static on a local variable, when the variable is initialized before
> any possible use.  Thus, the static has no benefit.

I think in this case the use relies on the structure continuing to exist, so a stack object is not an acceptable substitute. Just because it is initialized doesn't mean that it doesn't need a persistent lifetime.

> 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/mfd/twl4030-irq.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
> 
> int twl4030_init_irq(struct device *dev, int irq_num)
> {
> -	static struct irq_chip	twl4030_irq_chip;
> +	struct irq_chip		twl4030_irq_chip;
> 	int			status, i;
> 	int			irq_base, irq_end, nr_irqs;
> 	struct			device_node *node = dev->of_node;

--
Mark Rustad, MRustad@gmail.com


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
@ 2017-07-15 20:49     ` Mark D Rustad
  0 siblings, 0 replies; 74+ messages in thread
From: Mark D Rustad @ 2017-07-15 20:49 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Tony Lindgren, keescook, kernel-janitors, Lee Jones, linux-omap,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

> On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> 
> Drop static on a local variable, when the variable is initialized before
> any possible use.  Thus, the static has no benefit.

I think in this case the use relies on the structure continuing to exist, so a stack object is not an acceptable substitute. Just because it is initialized doesn't mean that it doesn't need a persistent lifetime.

> 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/mfd/twl4030-irq.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
> 
> int twl4030_init_irq(struct device *dev, int irq_num)
> {
> -	static struct irq_chip	twl4030_irq_chip;
> +	struct irq_chip		twl4030_irq_chip;
> 	int			status, i;
> 	int			irq_base, irq_end, nr_irqs;
> 	struct			device_node *node = dev->of_node;

--
Mark Rustad, MRustad@gmail.com


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-15 20:52     ` Mark D Rustad
  -1 siblings, 0 replies; 74+ messages in thread
From: Mark D Rustad @ 2017-07-15 20:52 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Gleixner, keescook, kernel-janitors, Jason Cooper,
	Marc Zyngier, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]


> On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> 
> Drop static on a local variable, when the variable is initialized before
> any possible use.  Thus, the static has no benefit.

I think this is in error like the other one. I believe that the irq_chip structure needs a persistent lifetime.

> 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-mips-cpu.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
> --- a/drivers/irqchip/irq-mips-cpu.c
> +++ b/drivers/irqchip/irq-mips-cpu.c
> @@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
> static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
> 			     irq_hw_number_t hw)
> {
> -	static struct irq_chip *chip;
> +	struct irq_chip *chip;
> 
> 	if (hw < 2 && cpu_has_mipsmt) {
> 		/* Software interrupts are used for MT/CMT IPI */
> 

--
Mark Rustad, MRustad@gmail.com


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
@ 2017-07-15 20:52     ` Mark D Rustad
  0 siblings, 0 replies; 74+ messages in thread
From: Mark D Rustad @ 2017-07-15 20:52 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Gleixner, keescook, kernel-janitors, Jason Cooper,
	Marc Zyngier, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]


> On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> 
> Drop static on a local variable, when the variable is initialized before
> any possible use.  Thus, the static has no benefit.

I think this is in error like the other one. I believe that the irq_chip structure needs a persistent lifetime.

> 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-mips-cpu.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
> --- a/drivers/irqchip/irq-mips-cpu.c
> +++ b/drivers/irqchip/irq-mips-cpu.c
> @@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
> static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
> 			     irq_hw_number_t hw)
> {
> -	static struct irq_chip *chip;
> +	struct irq_chip *chip;
> 
> 	if (hw < 2 && cpu_has_mipsmt) {
> 		/* Software interrupts are used for MT/CMT IPI */
> 

--
Mark Rustad, MRustad@gmail.com


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
  2017-07-15 20:49     ` Mark D Rustad
@ 2017-07-15 20:56       ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:56 UTC (permalink / raw)
  To: Mark D Rustad
  Cc: Tony Lindgren, keescook, kernel-janitors, Lee Jones, linux-omap,
	linux-kernel



On Sat, 15 Jul 2017, Mark D Rustad wrote:

> > On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> >
> > Drop static on a local variable, when the variable is initialized before
> > any possible use.  Thus, the static has no benefit.
>
> I think in this case the use relies on the structure continuing to exist, so a stack object is not an acceptable substitute. Just because it is initialized doesn't mean that it doesn't need a persistent lifetime.

OK, I see.  Thanks for the feedback.  I'll extend the rule to ensure that
the address of the variable is not taken.  Ignore this patch in any case.

julia

>
> > 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/mfd/twl4030-irq.c |    2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> > --- a/drivers/mfd/twl4030-irq.c
> > +++ b/drivers/mfd/twl4030-irq.c
> > @@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
> >
> > int twl4030_init_irq(struct device *dev, int irq_num)
> > {
> > -	static struct irq_chip	twl4030_irq_chip;
> > +	struct irq_chip		twl4030_irq_chip;
> > 	int			status, i;
> > 	int			irq_base, irq_end, nr_irqs;
> > 	struct			device_node *node = dev->of_node;
>
> --
> Mark Rustad, MRustad@gmail.com
>
>

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
@ 2017-07-15 20:56       ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:56 UTC (permalink / raw)
  To: Mark D Rustad
  Cc: Tony Lindgren, keescook, kernel-janitors, Lee Jones, linux-omap,
	linux-kernel



On Sat, 15 Jul 2017, Mark D Rustad wrote:

> > On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> >
> > Drop static on a local variable, when the variable is initialized before
> > any possible use.  Thus, the static has no benefit.
>
> I think in this case the use relies on the structure continuing to exist, so a stack object is not an acceptable substitute. Just because it is initialized doesn't mean that it doesn't need a persistent lifetime.

OK, I see.  Thanks for the feedback.  I'll extend the rule to ensure that
the address of the variable is not taken.  Ignore this patch in any case.

julia

>
> > 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/mfd/twl4030-irq.c |    2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> > --- a/drivers/mfd/twl4030-irq.c
> > +++ b/drivers/mfd/twl4030-irq.c
> > @@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
> >
> > int twl4030_init_irq(struct device *dev, int irq_num)
> > {
> > -	static struct irq_chip	twl4030_irq_chip;
> > +	struct irq_chip		twl4030_irq_chip;
> > 	int			status, i;
> > 	int			irq_base, irq_end, nr_irqs;
> > 	struct			device_node *node = dev->of_node;
>
> --
> Mark Rustad, MRustad@gmail.com
>
>

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
  2017-07-15 20:52     ` Mark D Rustad
@ 2017-07-15 20:59       ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:59 UTC (permalink / raw)
  To: Mark D Rustad
  Cc: Julia Lawall, Thomas Gleixner, keescook, kernel-janitors,
	Jason Cooper, Marc Zyngier, linux-kernel



On Sat, 15 Jul 2017, Mark D Rustad wrote:

>
> > On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> >
> > Drop static on a local variable, when the variable is initialized before
> > any possible use.  Thus, the static has no benefit.
>
> I think this is in error like the other one. I believe that the irq_chip structure needs a persistent lifetime.

I'm not following in this case.  chip is a pointer to a structure, not a
structure.  Its address is not taken.  irq_set_chip_and_handler that uses
it below is a fnuction, so it just gets the value.

julia

>
> > 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-mips-cpu.c |    2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
> > --- a/drivers/irqchip/irq-mips-cpu.c
> > +++ b/drivers/irqchip/irq-mips-cpu.c
> > @@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
> > static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
> > 			     irq_hw_number_t hw)
> > {
> > -	static struct irq_chip *chip;
> > +	struct irq_chip *chip;
> >
> > 	if (hw < 2 && cpu_has_mipsmt) {
> > 		/* Software interrupts are used for MT/CMT IPI */
> >
>
> --
> Mark Rustad, MRustad@gmail.com
>
>

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
@ 2017-07-15 20:59       ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 20:59 UTC (permalink / raw)
  To: Mark D Rustad
  Cc: Julia Lawall, Thomas Gleixner, keescook, kernel-janitors,
	Jason Cooper, Marc Zyngier, linux-kernel



On Sat, 15 Jul 2017, Mark D Rustad wrote:

>
> > On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> >
> > Drop static on a local variable, when the variable is initialized before
> > any possible use.  Thus, the static has no benefit.
>
> I think this is in error like the other one. I believe that the irq_chip structure needs a persistent lifetime.

I'm not following in this case.  chip is a pointer to a structure, not a
structure.  Its address is not taken.  irq_set_chip_and_handler that uses
it below is a fnuction, so it just gets the value.

julia

>
> > 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-mips-cpu.c |    2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
> > --- a/drivers/irqchip/irq-mips-cpu.c
> > +++ b/drivers/irqchip/irq-mips-cpu.c
> > @@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
> > static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
> > 			     irq_hw_number_t hw)
> > {
> > -	static struct irq_chip *chip;
> > +	struct irq_chip *chip;
> >
> > 	if (hw < 2 && cpu_has_mipsmt) {
> > 		/* Software interrupts are used for MT/CMT IPI */
> >
>
> --
> Mark Rustad, MRustad@gmail.com
>
>

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/11] Drop unnecessary static
  2017-07-15 20:37   ` Joe Perches
  (?)
@ 2017-07-15 21:00     ` Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 21:00 UTC (permalink / raw)
  To: Joe Perches
  Cc: Julia Lawall, linux-arm-kernel, keescook, kernel-janitors,
	linux-ide, linux-mtd, linux-kernel, linux-clk, linux-fbdev,
	linux-omap, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-input, linux-iio



On Sat, 15 Jul 2017, Joe Perches wrote:

> On Sat, 2017-07-15 at 22:07 +0200, Julia Lawall wrote:
> > These patches fix cases where there is a static on a local variable, but
> > the variable is initialized before any possible use.  Thus, the static has
> > no benefit.
>
> Nice one.

Thanks.  It was suggested by Kees Cook a while ago.  There seem to be many
opportunities.

julia

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 21:00     ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 21:00 UTC (permalink / raw)
  To: linux-arm-kernel



On Sat, 15 Jul 2017, Joe Perches wrote:

> On Sat, 2017-07-15 at 22:07 +0200, Julia Lawall wrote:
> > These patches fix cases where there is a static on a local variable, but
> > the variable is initialized before any possible use.  Thus, the static has
> > no benefit.
>
> Nice one.

Thanks.  It was suggested by Kees Cook a while ago.  There seem to be many
opportunities.

julia

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 00/11] Drop unnecessary static
@ 2017-07-15 21:00     ` Julia Lawall
  0 siblings, 0 replies; 74+ messages in thread
From: Julia Lawall @ 2017-07-15 21:00 UTC (permalink / raw)
  To: linux-arm-kernel



On Sat, 15 Jul 2017, Joe Perches wrote:

> On Sat, 2017-07-15 at 22:07 +0200, Julia Lawall wrote:
> > These patches fix cases where there is a static on a local variable, but
> > the variable is initialized before any possible use.  Thus, the static has
> > no benefit.
>
> Nice one.

Thanks.  It was suggested by Kees Cook a while ago.  There seem to be many
opportunities.

julia

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 10/11] irqchip: digicolor: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
  (?)
@ 2017-07-16  4:49     ` Baruch Siach
  -1 siblings, 0 replies; 74+ messages in thread
From: Baruch Siach @ 2017-07-16  4:49 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Gleixner, keescook, kernel-janitors, Jason Cooper,
	Marc Zyngier, linux-kernel, linux-arm-kernel

Hi Julia,

On Sat, Jul 15, 2017 at 10:07:45PM +0200, Julia Lawall wrote:
> 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>

Acked-by: Baruch Siach <baruch@tkos.co.il>

Thanks,
baruch

> ---
> These patches are all independent of each other.
> 
>  drivers/irqchip/irq-digicolor.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
> --- a/drivers/irqchip/irq-digicolor.c
> +++ b/drivers/irqchip/irq-digicolor.c
> @@ -71,7 +71,7 @@ static void __init digicolor_set_gc(void
>  static int __init digicolor_of_init(struct device_node *node,
>  				struct device_node *parent)
>  {
> -	static void __iomem *reg_base;
> +	void __iomem *reg_base;
>  	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
>  	struct regmap *ucregs;
>  	int ret;
> 

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 10/11] irqchip: digicolor: Drop unnecessary static
@ 2017-07-16  4:49     ` Baruch Siach
  0 siblings, 0 replies; 74+ messages in thread
From: Baruch Siach @ 2017-07-16  4:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia,

On Sat, Jul 15, 2017 at 10:07:45PM +0200, Julia Lawall wrote:
> 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>

Acked-by: Baruch Siach <baruch@tkos.co.il>

Thanks,
baruch

> ---
> These patches are all independent of each other.
> 
>  drivers/irqchip/irq-digicolor.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
> --- a/drivers/irqchip/irq-digicolor.c
> +++ b/drivers/irqchip/irq-digicolor.c
> @@ -71,7 +71,7 @@ static void __init digicolor_set_gc(void
>  static int __init digicolor_of_init(struct device_node *node,
>  				struct device_node *parent)
>  {
> -	static void __iomem *reg_base;
> +	void __iomem *reg_base;
>  	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
>  	struct regmap *ucregs;
>  	int ret;
> 

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 10/11] irqchip: digicolor: Drop unnecessary static
@ 2017-07-16  4:49     ` Baruch Siach
  0 siblings, 0 replies; 74+ messages in thread
From: Baruch Siach @ 2017-07-16  4:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia,

On Sat, Jul 15, 2017 at 10:07:45PM +0200, Julia Lawall wrote:
> 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 at p;
> ...
> x = <+...x...+>
> 
> @@
> identifier x;
> expression e;
> type T;
> position p != bad.p;
> @@
> -static
>  T x at p;
>  ... when != x
>      when strict
> ?x = e;
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Baruch Siach <baruch@tkos.co.il>

Thanks,
baruch

> ---
> These patches are all independent of each other.
> 
>  drivers/irqchip/irq-digicolor.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
> --- a/drivers/irqchip/irq-digicolor.c
> +++ b/drivers/irqchip/irq-digicolor.c
> @@ -71,7 +71,7 @@ static void __init digicolor_set_gc(void
>  static int __init digicolor_of_init(struct device_node *node,
>  				struct device_node *parent)
>  {
> -	static void __iomem *reg_base;
> +	void __iomem *reg_base;
>  	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
>  	struct regmap *ucregs;
>  	int ret;
> 

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
  2017-07-15 20:59       ` Julia Lawall
@ 2017-07-16  6:04         ` Mark D Rustad
  -1 siblings, 0 replies; 74+ messages in thread
From: Mark D Rustad @ 2017-07-16  6:04 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Gleixner, keescook, kernel-janitors, Jason Cooper,
	Marc Zyngier, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2051 bytes --]

> On Jul 15, 2017, at 1:59 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> 
> On Sat, 15 Jul 2017, Mark D Rustad wrote:
> 
>> 
>>> On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>>> 
>>> Drop static on a local variable, when the variable is initialized before
>>> any possible use.  Thus, the static has no benefit.
>> 
>> I think this is in error like the other one. I believe that the irq_chip structure needs a persistent lifetime.
> 
> I'm not following in this case.  chip is a pointer to a structure, not a
> structure.  Its address is not taken.  irq_set_chip_and_handler that uses
> it below is a fnuction, so it just gets the value.
> 
> julia

Sorry. My mistake. I didn't look quite hard enough at this one.

>> 
>>> 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-mips-cpu.c |    2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
>>> --- a/drivers/irqchip/irq-mips-cpu.c
>>> +++ b/drivers/irqchip/irq-mips-cpu.c
>>> @@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
>>> static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
>>> 			     irq_hw_number_t hw)
>>> {
>>> -	static struct irq_chip *chip;
>>> +	struct irq_chip *chip;
>>> 
>>> 	if (hw < 2 && cpu_has_mipsmt) {
>>> 		/* Software interrupts are used for MT/CMT IPI */
>>> 
>> 
>> --
>> Mark Rustad, MRustad@gmail.com

--
Mark Rustad, MRustad@gmail.com


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 06/11] irqchip: mips-cpu: Drop unnecessary static
@ 2017-07-16  6:04         ` Mark D Rustad
  0 siblings, 0 replies; 74+ messages in thread
From: Mark D Rustad @ 2017-07-16  6:04 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Thomas Gleixner, keescook, kernel-janitors, Jason Cooper,
	Marc Zyngier, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2051 bytes --]

> On Jul 15, 2017, at 1:59 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> 
> On Sat, 15 Jul 2017, Mark D Rustad wrote:
> 
>> 
>>> On Jul 15, 2017, at 1:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>>> 
>>> Drop static on a local variable, when the variable is initialized before
>>> any possible use.  Thus, the static has no benefit.
>> 
>> I think this is in error like the other one. I believe that the irq_chip structure needs a persistent lifetime.
> 
> I'm not following in this case.  chip is a pointer to a structure, not a
> structure.  Its address is not taken.  irq_set_chip_and_handler that uses
> it below is a fnuction, so it just gets the value.
> 
> julia

Sorry. My mistake. I didn't look quite hard enough at this one.

>> 
>>> 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-mips-cpu.c |    2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff -u -p a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
>>> --- a/drivers/irqchip/irq-mips-cpu.c
>>> +++ b/drivers/irqchip/irq-mips-cpu.c
>>> @@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch
>>> static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
>>> 			     irq_hw_number_t hw)
>>> {
>>> -	static struct irq_chip *chip;
>>> +	struct irq_chip *chip;
>>> 
>>> 	if (hw < 2 && cpu_has_mipsmt) {
>>> 		/* Software interrupts are used for MT/CMT IPI */
>>> 
>> 
>> --
>> Mark Rustad, MRustad@gmail.com

--
Mark Rustad, MRustad@gmail.com


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 03/11] mtd: physmap_of: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-17 19:58     ` Boris Brezillon
  -1 siblings, 0 replies; 74+ messages in thread
From: Boris Brezillon @ 2017-07-17 19:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, keescook, kernel-janitors, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, linux-mtd,
	linux-kernel

Le Sat, 15 Jul 2017 22:07:38 +0200,
Julia Lawall <Julia.Lawall@lip6.fr> a écrit :

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

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> 
> ---
> These patches are all independent of each other.
> 
>  drivers/mtd/maps/physmap_of_versatile.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
> --- a/drivers/mtd/maps/physmap_of_versatile.c
> +++ b/drivers/mtd/maps/physmap_of_versatile.c
> @@ -97,7 +97,7 @@ static const struct of_device_id ebi_mat
>  static int ap_flash_init(struct platform_device *pdev)
>  {
>  	struct device_node *ebi;
> -	static void __iomem *ebi_base;
> +	void __iomem *ebi_base;
>  	u32 val;
>  	int ret;
>  
> 

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 03/11] mtd: physmap_of: Drop unnecessary static
@ 2017-07-17 19:58     ` Boris Brezillon
  0 siblings, 0 replies; 74+ messages in thread
From: Boris Brezillon @ 2017-07-17 19:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, keescook, kernel-janitors, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, linux-mtd,
	linux-kernel

Le Sat, 15 Jul 2017 22:07:38 +0200,
Julia Lawall <Julia.Lawall@lip6.fr> a écrit :

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

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> 
> ---
> These patches are all independent of each other.
> 
>  drivers/mtd/maps/physmap_of_versatile.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
> --- a/drivers/mtd/maps/physmap_of_versatile.c
> +++ b/drivers/mtd/maps/physmap_of_versatile.c
> @@ -97,7 +97,7 @@ static const struct of_device_id ebi_mat
>  static int ap_flash_init(struct platform_device *pdev)
>  {
>  	struct device_node *ebi;
> -	static void __iomem *ebi_base;
> +	void __iomem *ebi_base;
>  	u32 val;
>  	int ret;
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 09/11] iio: orientation: hid-sensor-rotation: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-17 20:45     ` Jonathan Cameron
  -1 siblings, 0 replies; 74+ messages in thread
From: Jonathan Cameron @ 2017-07-17 20:45 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jiri Kosina, keescook, kernel-janitors, Srinivas Pandruvada,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-input, linux-iio, linux-kernel

On Sat, 15 Jul 2017 22:07:44 +0200
Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> 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>
Applied to the togreg branch of iio.git and pushed out
as testing for the autobuilders to play with it.

Thanks,

Jonathan
> 
> ---
> These patches are all independent of each other.
> 
>  drivers/iio/orientation/hid-sensor-rotation.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c
> --- a/drivers/iio/orientation/hid-sensor-rotation.c
> +++ b/drivers/iio/orientation/hid-sensor-rotation.c
> @@ -238,7 +238,7 @@ static int dev_rot_parse_report(struct p
>  static int hid_dev_rot_probe(struct platform_device *pdev)
>  {
>  	int ret;
> -	static char *name;
> +	char *name;
>  	struct iio_dev *indio_dev;
>  	struct dev_rot_state *rot_state;
>  	struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
> 

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 09/11] iio: orientation: hid-sensor-rotation: Drop unnecessary static
@ 2017-07-17 20:45     ` Jonathan Cameron
  0 siblings, 0 replies; 74+ messages in thread
From: Jonathan Cameron @ 2017-07-17 20:45 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jiri Kosina, keescook, kernel-janitors, Srinivas Pandruvada,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-input, linux-iio, linux-kernel

On Sat, 15 Jul 2017 22:07:44 +0200
Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> 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>
Applied to the togreg branch of iio.git and pushed out
as testing for the autobuilders to play with it.

Thanks,

Jonathan
> 
> ---
> These patches are all independent of each other.
> 
>  drivers/iio/orientation/hid-sensor-rotation.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c
> --- a/drivers/iio/orientation/hid-sensor-rotation.c
> +++ b/drivers/iio/orientation/hid-sensor-rotation.c
> @@ -238,7 +238,7 @@ static int dev_rot_parse_report(struct p
>  static int hid_dev_rot_probe(struct platform_device *pdev)
>  {
>  	int ret;
> -	static char *name;
> +	char *name;
>  	struct iio_dev *indio_dev;
>  	struct dev_rot_state *rot_state;
>  	struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 02/11] clk: moxart: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-18  1:31     ` Stephen Boyd
  -1 siblings, 0 replies; 74+ messages in thread
From: Stephen Boyd @ 2017-07-18  1:31 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Turquette, keescook, kernel-janitors, linux-clk, linux-kernel

On 07/15, Julia Lawall wrote:
> 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.

Already got this one a few days earlier.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 02/11] clk: moxart: Drop unnecessary static
@ 2017-07-18  1:31     ` Stephen Boyd
  0 siblings, 0 replies; 74+ messages in thread
From: Stephen Boyd @ 2017-07-18  1:31 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Turquette, keescook, kernel-janitors, linux-clk, linux-kernel

On 07/15, Julia Lawall wrote:
> 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.

Already got this one a few days earlier.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 01/11] clk: mmp: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-18  1:31     ` Stephen Boyd
  -1 siblings, 0 replies; 74+ messages in thread
From: Stephen Boyd @ 2017-07-18  1:31 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Turquette, keescook, kernel-janitors, linux-clk, linux-kernel

On 07/15, Julia Lawall wrote:
> 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>
> 
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 01/11] clk: mmp: Drop unnecessary static
@ 2017-07-18  1:31     ` Stephen Boyd
  0 siblings, 0 replies; 74+ messages in thread
From: Stephen Boyd @ 2017-07-18  1:31 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Turquette, keescook, kernel-janitors, linux-clk, linux-kernel

On 07/15, Julia Lawall wrote:
> 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>
> 
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 11/11] mfd: max8925-i2c: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-18  7:23     ` Lee Jones
  -1 siblings, 0 replies; 74+ messages in thread
From: Lee Jones @ 2017-07-18  7:23 UTC (permalink / raw)
  To: Julia Lawall; +Cc: keescook, kernel-janitors, linux-kernel

On Sat, 15 Jul 2017, Julia Lawall wrote:

> 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/mfd/max8925-i2c.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff -u -p a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
> --- a/drivers/mfd/max8925-i2c.c
> +++ b/drivers/mfd/max8925-i2c.c
> @@ -151,7 +151,7 @@ static int max8925_probe(struct i2c_clie
>  				   const struct i2c_device_id *id)
>  {
>  	struct max8925_platform_data *pdata = dev_get_platdata(&client->dev);
> -	static struct max8925_chip *chip;
> +	struct max8925_chip *chip;
>  	struct device_node *node = client->dev.of_node;
>  
>  	if (node && !pdata) {
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 11/11] mfd: max8925-i2c: Drop unnecessary static
@ 2017-07-18  7:23     ` Lee Jones
  0 siblings, 0 replies; 74+ messages in thread
From: Lee Jones @ 2017-07-18  7:23 UTC (permalink / raw)
  To: Julia Lawall; +Cc: keescook, kernel-janitors, linux-kernel

On Sat, 15 Jul 2017, Julia Lawall wrote:

> 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/mfd/max8925-i2c.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

> diff -u -p a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
> --- a/drivers/mfd/max8925-i2c.c
> +++ b/drivers/mfd/max8925-i2c.c
> @@ -151,7 +151,7 @@ static int max8925_probe(struct i2c_clie
>  				   const struct i2c_device_id *id)
>  {
>  	struct max8925_platform_data *pdata = dev_get_platdata(&client->dev);
> -	static struct max8925_chip *chip;
> +	struct max8925_chip *chip;
>  	struct device_node *node = client->dev.of_node;
>  
>  	if (node && !pdata) {
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [tip:irq/urgent] irqchip/gic/realview: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
  (?)
@ 2017-07-18 20:06   ` tip-bot for Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: tip-bot for Julia Lawall @ 2017-07-18 20:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, hpa, Julia.Lawall, mingo, linux-kernel, jason, marc.zyngier

Commit-ID:  512f9e790897e84d5b802436768508ee4628fc16
Gitweb:     http://git.kernel.org/tip/512f9e790897e84d5b802436768508ee4628fc16
Author:     Julia Lawall <Julia.Lawall@lip6.fr>
AuthorDate: Sat, 15 Jul 2017 22:07:40 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 18 Jul 2017 21:59:22 +0200

irqchip/gic/realview: Drop unnecessary static

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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: kernel-janitors@vger.kernel.org
Cc: keescook@chromium.org
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1500149266-32357-6-git-send-email-Julia.Lawall@lip6.fr

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

diff --git a/drivers/irqchip/irq-gic-realview.c b/drivers/irqchip/irq-gic-realview.c
index 54c2964..18d58d2 100644
--- 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_pldset_of_match[] = {
 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;

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [tip:irq/urgent] irqchip/mips-cpu: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
  (?)
  (?)
@ 2017-07-18 20:07   ` tip-bot for Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: tip-bot for Julia Lawall @ 2017-07-18 20:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: marc.zyngier, Julia.Lawall, hpa, jason, mingo, tglx, linux-kernel

Commit-ID:  82faeffa7e130e2ae43aa681a34c02d56dabd177
Gitweb:     http://git.kernel.org/tip/82faeffa7e130e2ae43aa681a34c02d56dabd177
Author:     Julia Lawall <Julia.Lawall@lip6.fr>
AuthorDate: Sat, 15 Jul 2017 22:07:41 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 18 Jul 2017 21:59:22 +0200

irqchip/mips-cpu: Drop unnecessary static

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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: kernel-janitors@vger.kernel.org
Cc: keescook@chromium.org
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1500149266-32357-7-git-send-email-Julia.Lawall@lip6.fr

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

diff --git a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
index 0a8ed1c..14461cb 100644
--- a/drivers/irqchip/irq-mips-cpu.c
+++ b/drivers/irqchip/irq-mips-cpu.c
@@ -154,7 +154,7 @@ asmlinkage void __weak plat_irq_dispatch(void)
 static int mips_cpu_intc_map(struct irq_domain *d, unsigned int irq,
 			     irq_hw_number_t hw)
 {
-	static struct irq_chip *chip;
+	struct irq_chip *chip;
 
 	if (hw < 2 && cpu_has_mipsmt) {
 		/* Software interrupts are used for MT/CMT IPI */

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [tip:irq/urgent] irqchip/digicolor: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
                     ` (2 preceding siblings ...)
  (?)
@ 2017-07-18 20:07   ` tip-bot for Julia Lawall
  -1 siblings, 0 replies; 74+ messages in thread
From: tip-bot for Julia Lawall @ 2017-07-18 20:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, jason, marc.zyngier, hpa, Julia.Lawall, tglx, baruch,
	linux-kernel

Commit-ID:  acc80c39929b9f2ff8b45fcfe103385a3e45c1a7
Gitweb:     http://git.kernel.org/tip/acc80c39929b9f2ff8b45fcfe103385a3e45c1a7
Author:     Julia Lawall <Julia.Lawall@lip6.fr>
AuthorDate: Sat, 15 Jul 2017 22:07:45 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 18 Jul 2017 21:59:23 +0200

irqchip/digicolor: Drop unnecessary static

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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Cc: keescook@chromium.org
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: kernel-janitors@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1500149266-32357-11-git-send-email-Julia.Lawall@lip6.fr

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

diff --git a/drivers/irqchip/irq-digicolor.c b/drivers/irqchip/irq-digicolor.c
index dad85e7..3aae015 100644
--- a/drivers/irqchip/irq-digicolor.c
+++ b/drivers/irqchip/irq-digicolor.c
@@ -71,7 +71,7 @@ static void __init digicolor_set_gc(void __iomem *reg_base, unsigned irq_base,
 static int __init digicolor_of_init(struct device_node *node,
 				struct device_node *parent)
 {
-	static void __iomem *reg_base;
+	void __iomem *reg_base;
 	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
 	struct regmap *ucregs;
 	int ret;

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
  2017-07-15 20:56       ` Julia Lawall
@ 2017-07-24 19:20         ` Pavel Machek
  -1 siblings, 0 replies; 74+ messages in thread
From: Pavel Machek @ 2017-07-24 19:20 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mark D Rustad, Tony Lindgren, keescook, kernel-janitors,
	Lee Jones, linux-omap, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

Hi!

> > > Drop static on a local variable, when the variable is initialized before
> > > any possible use.  Thus, the static has no benefit.

Actually... it has possible other benefit -- saving stack space. I've
used static for that purpose before. So ... careful with the
automation.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
@ 2017-07-24 19:20         ` Pavel Machek
  0 siblings, 0 replies; 74+ messages in thread
From: Pavel Machek @ 2017-07-24 19:20 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mark D Rustad, Tony Lindgren, keescook, kernel-janitors,
	Lee Jones, linux-omap, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

Hi!

> > > Drop static on a local variable, when the variable is initialized before
> > > any possible use.  Thus, the static has no benefit.

Actually... it has possible other benefit -- saving stack space. I've
used static for that purpose before. So ... careful with the
automation.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
  2017-07-24 19:20         ` Pavel Machek
@ 2017-07-24 22:27           ` Kees Cook
  -1 siblings, 0 replies; 74+ messages in thread
From: Kees Cook @ 2017-07-24 22:27 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Julia Lawall, Mark D Rustad, Tony Lindgren, kernel-janitors,
	Lee Jones, linux-omap, LKML

On Mon, Jul 24, 2017 at 12:20 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> > > Drop static on a local variable, when the variable is initialized before
>> > > any possible use.  Thus, the static has no benefit.
>
> Actually... it has possible other benefit -- saving stack space. I've
> used static for that purpose before. So ... careful with the
> automation.

This means any functions like this must not be thread safe, though...

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
@ 2017-07-24 22:27           ` Kees Cook
  0 siblings, 0 replies; 74+ messages in thread
From: Kees Cook @ 2017-07-24 22:27 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Julia Lawall, Mark D Rustad, Tony Lindgren, kernel-janitors,
	Lee Jones, linux-omap, LKML

On Mon, Jul 24, 2017 at 12:20 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> > > Drop static on a local variable, when the variable is initialized before
>> > > any possible use.  Thus, the static has no benefit.
>
> Actually... it has possible other benefit -- saving stack space. I've
> used static for that purpose before. So ... careful with the
> automation.

This means any functions like this must not be thread safe, though...

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-07-25  8:00     ` Lee Jones
  -1 siblings, 0 replies; 74+ messages in thread
From: Lee Jones @ 2017-07-25  8:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Tony Lindgren, keescook, kernel-janitors, linux-omap, linux-kernel

On Sat, 15 Jul 2017, Julia Lawall wrote:

> 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/mfd/twl4030-irq.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks like I didn't reply to this patch.

Just to let you know, it has been applied.

> diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
>  
>  int twl4030_init_irq(struct device *dev, int irq_num)
>  {
> -	static struct irq_chip	twl4030_irq_chip;
> +	struct irq_chip		twl4030_irq_chip;
>  	int			status, i;
>  	int			irq_base, irq_end, nr_irqs;
>  	struct			device_node *node = dev->of_node;
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/11] mfd: Drop unnecessary static
@ 2017-07-25  8:00     ` Lee Jones
  0 siblings, 0 replies; 74+ messages in thread
From: Lee Jones @ 2017-07-25  8:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Tony Lindgren, keescook, kernel-janitors, linux-omap, linux-kernel

On Sat, 15 Jul 2017, Julia Lawall wrote:

> 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/mfd/twl4030-irq.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks like I didn't reply to this patch.

Just to let you know, it has been applied.

> diff -u -p a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -685,7 +685,7 @@ int twl4030_sih_setup(struct device *dev
>  
>  int twl4030_init_irq(struct device *dev, int irq_num)
>  {
> -	static struct irq_chip	twl4030_irq_chip;
> +	struct irq_chip		twl4030_irq_chip;
>  	int			status, i;
>  	int			irq_base, irq_end, nr_irqs;
>  	struct			device_node *node = dev->of_node;
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-08-01 13:09     ` Bartlomiej Zolnierkiewicz
  -1 siblings, 0 replies; 74+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-08-01 13:09 UTC (permalink / raw)
  To: Julia Lawall; +Cc: keescook, kernel-janitors, linux-fbdev, linux-kernel

On Saturday, July 15, 2017 10:07:39 PM Julia Lawall wrote:
> 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>

Patch queued for 4.14, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 04/11] fbdev: da8xx-fb: Drop unnecessary static
@ 2017-08-01 13:09     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 74+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-08-01 13:09 UTC (permalink / raw)
  To: Julia Lawall; +Cc: keescook, kernel-janitors, linux-fbdev, linux-kernel

On Saturday, July 15, 2017 10:07:39 PM Julia Lawall wrote:
> 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>

Patch queued for 4.14, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 08/11] ata: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-08-02  8:23     ` Linus Walleij
  -1 siblings, 0 replies; 74+ messages in thread
From: Linus Walleij @ 2017-08-02  8:23 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kees Cook, kernel-janitors, Tejun Heo, linux-ide, linux-kernel

On Sat, Jul 15, 2017 at 10:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

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

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

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 08/11] ata: Drop unnecessary static
@ 2017-08-02  8:23     ` Linus Walleij
  0 siblings, 0 replies; 74+ messages in thread
From: Linus Walleij @ 2017-08-02  8:23 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kees Cook, kernel-janitors, Tejun Heo, linux-ide, linux-kernel

On Sat, Jul 15, 2017 at 10:07 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

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

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

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 08/11] ata: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-08-02 15:12     ` Tejun Heo
  -1 siblings, 0 replies; 74+ messages in thread
From: Tejun Heo @ 2017-08-02 15:12 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Linus Walleij, keescook, kernel-janitors, linux-ide, linux-kernel

On Sat, Jul 15, 2017 at 10:07:43PM +0200, Julia Lawall wrote:
> 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>

Applied to libata/for-4.14.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 08/11] ata: Drop unnecessary static
@ 2017-08-02 15:12     ` Tejun Heo
  0 siblings, 0 replies; 74+ messages in thread
From: Tejun Heo @ 2017-08-02 15:12 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Linus Walleij, keescook, kernel-janitors, linux-ide, linux-kernel

On Sat, Jul 15, 2017 at 10:07:43PM +0200, Julia Lawall wrote:
> 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>

Applied to libata/for-4.14.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 03/11] mtd: physmap_of: Drop unnecessary static
  2017-07-15 20:07   ` Julia Lawall
@ 2017-08-17 12:58     ` Boris Brezillon
  -1 siblings, 0 replies; 74+ messages in thread
From: Boris Brezillon @ 2017-08-17 12:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, keescook, kernel-janitors, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, linux-mtd,
	linux-kernel

Le Sat, 15 Jul 2017 22:07:38 +0200,
Julia Lawall <Julia.Lawall@lip6.fr> a écrit :

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

Applied to l2-mtd/master.

Thanks,

Boris

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> These patches are all independent of each other.
> 
>  drivers/mtd/maps/physmap_of_versatile.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
> --- a/drivers/mtd/maps/physmap_of_versatile.c
> +++ b/drivers/mtd/maps/physmap_of_versatile.c
> @@ -97,7 +97,7 @@ static const struct of_device_id ebi_mat
>  static int ap_flash_init(struct platform_device *pdev)
>  {
>  	struct device_node *ebi;
> -	static void __iomem *ebi_base;
> +	void __iomem *ebi_base;
>  	u32 val;
>  	int ret;
>  
> 

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 03/11] mtd: physmap_of: Drop unnecessary static
@ 2017-08-17 12:58     ` Boris Brezillon
  0 siblings, 0 replies; 74+ messages in thread
From: Boris Brezillon @ 2017-08-17 12:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, keescook, kernel-janitors, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, linux-mtd,
	linux-kernel

Le Sat, 15 Jul 2017 22:07:38 +0200,
Julia Lawall <Julia.Lawall@lip6.fr> a écrit :

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

Applied to l2-mtd/master.

Thanks,

Boris

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> These patches are all independent of each other.
> 
>  drivers/mtd/maps/physmap_of_versatile.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c
> --- a/drivers/mtd/maps/physmap_of_versatile.c
> +++ b/drivers/mtd/maps/physmap_of_versatile.c
> @@ -97,7 +97,7 @@ static const struct of_device_id ebi_mat
>  static int ap_flash_init(struct platform_device *pdev)
>  {
>  	struct device_node *ebi;
> -	static void __iomem *ebi_base;
> +	void __iomem *ebi_base;
>  	u32 val;
>  	int ret;
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 74+ messages in thread

end of thread, other threads:[~2017-08-17 12:59 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-15 20:07 [PATCH 00/11] Drop unnecessary static Julia Lawall
2017-07-15 20:07 ` Julia Lawall
2017-07-15 20:07 ` Julia Lawall
2017-07-15 20:07 ` Julia Lawall
2017-07-15 20:07 ` Julia Lawall
2017-07-15 20:07 ` [PATCH 01/11] clk: mmp: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-18  1:31   ` Stephen Boyd
2017-07-18  1:31     ` Stephen Boyd
2017-07-15 20:07 ` [PATCH 02/11] clk: moxart: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-18  1:31   ` Stephen Boyd
2017-07-18  1:31     ` Stephen Boyd
2017-07-15 20:07 ` [PATCH 03/11] mtd: physmap_of: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-17 19:58   ` Boris Brezillon
2017-07-17 19:58     ` Boris Brezillon
2017-08-17 12:58   ` Boris Brezillon
2017-08-17 12:58     ` Boris Brezillon
2017-07-15 20:07 ` [PATCH 04/11] fbdev: da8xx-fb: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-08-01 13:09   ` Bartlomiej Zolnierkiewicz
2017-08-01 13:09     ` Bartlomiej Zolnierkiewicz
2017-07-15 20:07 ` [PATCH 05/11] irqchip/gic/realview: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-18 20:06   ` [tip:irq/urgent] " tip-bot for Julia Lawall
2017-07-15 20:07 ` [PATCH 06/11] irqchip: mips-cpu: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-15 20:52   ` Mark D Rustad
2017-07-15 20:52     ` Mark D Rustad
2017-07-15 20:59     ` Julia Lawall
2017-07-15 20:59       ` Julia Lawall
2017-07-16  6:04       ` Mark D Rustad
2017-07-16  6:04         ` Mark D Rustad
2017-07-18 20:07   ` [tip:irq/urgent] irqchip/mips-cpu: " tip-bot for Julia Lawall
2017-07-15 20:07 ` [PATCH 07/11] mfd: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-15 20:49   ` Mark D Rustad
2017-07-15 20:49     ` Mark D Rustad
2017-07-15 20:56     ` Julia Lawall
2017-07-15 20:56       ` Julia Lawall
2017-07-24 19:20       ` Pavel Machek
2017-07-24 19:20         ` Pavel Machek
2017-07-24 22:27         ` Kees Cook
2017-07-24 22:27           ` Kees Cook
2017-07-25  8:00   ` Lee Jones
2017-07-25  8:00     ` Lee Jones
2017-07-15 20:07 ` [PATCH 08/11] ata: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-08-02  8:23   ` Linus Walleij
2017-08-02  8:23     ` Linus Walleij
2017-08-02 15:12   ` Tejun Heo
2017-08-02 15:12     ` Tejun Heo
2017-07-15 20:07 ` [PATCH 09/11] iio: orientation: hid-sensor-rotation: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-17 20:45   ` Jonathan Cameron
2017-07-17 20:45     ` Jonathan Cameron
2017-07-15 20:07 ` [PATCH 10/11] irqchip: digicolor: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-16  4:49   ` Baruch Siach
2017-07-16  4:49     ` Baruch Siach
2017-07-16  4:49     ` Baruch Siach
2017-07-18 20:07   ` [tip:irq/urgent] irqchip/digicolor: " tip-bot for Julia Lawall
2017-07-15 20:07 ` [PATCH 11/11] mfd: max8925-i2c: " Julia Lawall
2017-07-15 20:07   ` Julia Lawall
2017-07-18  7:23   ` Lee Jones
2017-07-18  7:23     ` Lee Jones
2017-07-15 20:37 ` [PATCH 00/11] " Joe Perches
2017-07-15 20:37   ` Joe Perches
2017-07-15 20:37   ` Joe Perches
2017-07-15 21:00   ` Julia Lawall
2017-07-15 21:00     ` Julia Lawall
2017-07-15 21:00     ` Julia Lawall

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.