[alsa-devel] [PATCH 0/6] constify gpio_chip structures
Constify gpio_chip structures
---
drivers/gpio/gpio-arizona.c | 2 +- drivers/gpio/gpio-bcm-kona.c | 2 +- drivers/gpio/gpio-da9052.c | 2 +- drivers/gpio/gpio-da9055.c | 2 +- drivers/gpio/gpio-it87.c | 2 +- drivers/gpio/gpio-lp873x.c | 2 +- drivers/gpio/gpio-lpc18xx.c | 2 +- drivers/gpio/gpio-pisosr.c | 2 +- drivers/gpio/gpio-sch.c | 2 +- drivers/gpio/gpio-stmpe.c | 2 +- drivers/gpio/gpio-tc3589x.c | 2 +- drivers/gpio/gpio-tpic2810.c | 2 +- drivers/gpio/gpio-tps65086.c | 2 +- drivers/gpio/gpio-tps65218.c | 2 +- drivers/gpio/gpio-tps65912.c | 2 +- drivers/gpio/gpio-ts4900.c | 2 +- drivers/gpio/gpio-twl4030.c | 2 +- drivers/gpio/gpio-wm831x.c | 2 +- drivers/gpio/gpio-wm8350.c | 2 +- drivers/gpio/gpio-wm8994.c | 2 +- drivers/mfd/sm501.c | 2 +- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +- drivers/pinctrl/stm32/pinctrl-stm32.c | 2 +- sound/soc/codecs/rt5677.c | 2 +- sound/soc/codecs/wm5100.c | 2 +- sound/soc/codecs/wm8903.c | 2 +- sound/soc/codecs/wm8962.c | 2 +- sound/soc/codecs/wm8996.c | 2 +- sound/soc/soc-ac97.c | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-)
These structures are only used to copy into other structures, so declare them as const.
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct gpio_chip i@p = { ... };
@ok@ identifier r.i; expression e; position p; @@ e = i@p;
@bad@ position p != {r.p,ok.p}; identifier r.i; struct gpio_chip e; @@ e@i@p
@depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct gpio_chip i = { ... }; // </smpl>
Signed-off-by: Julia Lawall Julia.Lawall@lip6.fr
--- sound/soc/soc-ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c index bc4a55b..6c8b0b0 100644 --- a/sound/soc/soc-ac97.c +++ b/sound/soc/soc-ac97.c @@ -116,7 +116,7 @@ static int snd_soc_ac97_gpio_direction_out(struct gpio_chip *chip, return snd_soc_update_bits(codec, AC97_GPIO_CFG, 1 << offset, 0); }
-static struct gpio_chip snd_soc_ac97_gpio_chip = { +static const struct gpio_chip snd_soc_ac97_gpio_chip = { .label = "snd_soc_ac97", .owner = THIS_MODULE, .request = snd_soc_ac97_gpio_request,
The patch
ASoC: ac97: constify gpio_chip structures
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 52abe54138d9b14b4a0a17742a53d2411bc5b167 Mon Sep 17 00:00:00 2001
From: Julia Lawall Julia.Lawall@lip6.fr Date: Sun, 11 Sep 2016 14:14:41 +0200 Subject: [PATCH] ASoC: ac97: constify gpio_chip structures
These structures are only used to copy into other structures, so declare them as const.
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct gpio_chip i@p = { ... };
@ok@ identifier r.i; expression e; position p; @@ e = i@p;
@bad@ position p != {r.p,ok.p}; identifier r.i; struct gpio_chip e; @@ e@i@p
@depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct gpio_chip i = { ... }; // </smpl>
Signed-off-by: Julia Lawall Julia.Lawall@lip6.fr Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c index bc4a55bb3fd9..6c8b0b0c56ec 100644 --- a/sound/soc/soc-ac97.c +++ b/sound/soc/soc-ac97.c @@ -116,7 +116,7 @@ static int snd_soc_ac97_gpio_direction_out(struct gpio_chip *chip, return snd_soc_update_bits(codec, AC97_GPIO_CFG, 1 << offset, 0); }
-static struct gpio_chip snd_soc_ac97_gpio_chip = { +static const struct gpio_chip snd_soc_ac97_gpio_chip = { .label = "snd_soc_ac97", .owner = THIS_MODULE, .request = snd_soc_ac97_gpio_request,
These structures are only used to copy into other structures, so declare them as const.
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct gpio_chip i@p = { ... };
@ok@ identifier r.i; expression e; position p; @@ e = i@p;
@bad@ position p != {r.p,ok.p}; identifier r.i; struct gpio_chip e; @@ e@i@p
@depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct gpio_chip i = { ... }; // </smpl>
Signed-off-by: Julia Lawall Julia.Lawall@lip6.fr
--- sound/soc/codecs/rt5677.c | 2 +- sound/soc/codecs/wm5100.c | 2 +- sound/soc/codecs/wm8903.c | 2 +- sound/soc/codecs/wm8962.c | 2 +- sound/soc/codecs/wm8996.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 278467d..5605750 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c @@ -2285,7 +2285,7 @@ static int wm5100_gpio_direction_in(struct gpio_chip *chip, unsigned offset) (1 << WM5100_GP1_DIR_SHIFT)); }
-static struct gpio_chip wm5100_template_chip = { +static const struct gpio_chip wm5100_template_chip = { .label = "wm5100", .owner = THIS_MODULE, .direction_output = wm5100_gpio_direction_out, diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 837c8b9..6e887c2 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c @@ -1830,7 +1830,7 @@ static void wm8903_gpio_set(struct gpio_chip *chip, unsigned offset, int value) !!value << WM8903_GP1_LVL_SHIFT); }
-static struct gpio_chip wm8903_template_chip = { +static const struct gpio_chip wm8903_template_chip = { .label = "wm8903", .owner = THIS_MODULE, .request = wm8903_gpio_request, diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 9f67922..fd2731d 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -3357,7 +3357,7 @@ static int wm8962_gpio_direction_out(struct gpio_chip *chip, return 0; }
-static struct gpio_chip wm8962_template_chip = { +static const struct gpio_chip wm8962_template_chip = { .label = "wm8962", .owner = THIS_MODULE, .request = wm8962_gpio_request, diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 5eba8ff..8affa49 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c @@ -2184,7 +2184,7 @@ static int wm8996_gpio_direction_in(struct gpio_chip *chip, unsigned offset) (1 << WM8996_GP1_DIR_SHIFT)); }
-static struct gpio_chip wm8996_template_chip = { +static const struct gpio_chip wm8996_template_chip = { .label = "wm8996", .owner = THIS_MODULE, .direction_output = wm8996_gpio_direction_out, diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 68268f2..7df422c 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -4657,7 +4657,7 @@ static int rt5677_to_irq(struct gpio_chip *chip, unsigned offset) return regmap_irq_get_virq(data, irq); }
-static struct gpio_chip rt5677_template_chip = { +static const struct gpio_chip rt5677_template_chip = { .label = "rt5677", .owner = THIS_MODULE, .direction_output = rt5677_gpio_direction_out,
participants (2)
-
Julia Lawall
-
Mark Brown