diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2017-01-24 14:25:24 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2017-02-13 04:29:44 -0500 |
commit | 24e34b9d75a902f1371f810c164b494336bafeae (patch) | |
tree | c9e9b4014a891e24b4bf6abf4a9c835599201936 | |
parent | 29a0729dd9f6c44c22c48accd55c94eaad7baf63 (diff) |
mfd: constify regmap_irq_chip structures
Declare regmap_irq_chip structures as const as they are only stored
in the regmap_irq_chip field of a rk808 structure. This field is of
type const, so regmap_irq_chip structures having this property can be
made const too.
Done using Coccinelle:
@r disable optional_qualifier@
identifier x;
position p;
@@
static struct regmap_irq_chip x@p={...};
@ok@
struct rk808 a;
identifier r.x;
position p;
@@
a.regmap_irq_chip=&x@p;
@bad@
position p != {r.p,ok.p};
identifier r.x;
@@
x@p
@depends on !bad disable optional_qualifier@
identifier r.x;
@@
+const
struct regmap_irq_chip x;
File size before:
text data bss dec hex filename
5033 584 16 5633 1601 drivers/mfd/rk808.o
File size after:
text data bss dec hex filename
5225 392 16 5633 1601 drivers/mfd/rk808.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | drivers/mfd/rk808.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index 2c9acdba7c2d..fd087cbb0bde 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c | |||
@@ -247,7 +247,7 @@ static const struct regmap_irq rk818_irqs[] = { | |||
247 | }, | 247 | }, |
248 | }; | 248 | }; |
249 | 249 | ||
250 | static struct regmap_irq_chip rk808_irq_chip = { | 250 | static const struct regmap_irq_chip rk808_irq_chip = { |
251 | .name = "rk808", | 251 | .name = "rk808", |
252 | .irqs = rk808_irqs, | 252 | .irqs = rk808_irqs, |
253 | .num_irqs = ARRAY_SIZE(rk808_irqs), | 253 | .num_irqs = ARRAY_SIZE(rk808_irqs), |
@@ -259,7 +259,7 @@ static struct regmap_irq_chip rk808_irq_chip = { | |||
259 | .init_ack_masked = true, | 259 | .init_ack_masked = true, |
260 | }; | 260 | }; |
261 | 261 | ||
262 | static struct regmap_irq_chip rk818_irq_chip = { | 262 | static const struct regmap_irq_chip rk818_irq_chip = { |
263 | .name = "rk818", | 263 | .name = "rk818", |
264 | .irqs = rk818_irqs, | 264 | .irqs = rk818_irqs, |
265 | .num_irqs = ARRAY_SIZE(rk818_irqs), | 265 | .num_irqs = ARRAY_SIZE(rk818_irqs), |