Skip to content

Commit

Permalink
irqchip/digicolor: Drop unnecessary static
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Baruch Siach <[email protected]>
Cc: [email protected]
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Jason Cooper <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
  • Loading branch information
JuliaLawall authored and KAGA-KOKO committed Jul 18, 2017
1 parent 82faeff commit acc80c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-digicolor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit acc80c3

Please sign in to comment.