From d20b7443fa0a8ce4aab28b2c5b9cae8fefd2743c Mon Sep 17 00:00:00 2001 From: Nishka Dasgupta Date: Mon, 19 Aug 2019 13:27:57 +0530 Subject: [PATCH] UPSTREAM: pinctrl: rk805: Make structures constant Static structures rk805_pinctrl_desc and rk805_gpio_chip, of types gpio_chip and pinctrl_desc respectively, are not used except to be copied into the fields of a different variable. Hence make rk805_pinctrl_desc and rk805_gpio_chip both constant to protect them from unintended modification. Issue found with Coccinelle. Change-Id: I63bf61b6aecaa095495157cd9eca6d8db5580fb8 Signed-off-by: Nishka Dasgupta Link: https://lore.kernel.org/r/20190819075757.1753-1-nishkadg.linux@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Tao Huang (cherry picked from commit 6e28aaab07c19fb97cedea9840ef796f1a772350) --- drivers/pinctrl/pinctrl-rk805.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rk805.c b/drivers/pinctrl/pinctrl-rk805.c index 305daba675be..a334dc5fc6c3 100644 --- a/drivers/pinctrl/pinctrl-rk805.c +++ b/drivers/pinctrl/pinctrl-rk805.c @@ -360,7 +360,7 @@ static int rk805_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) return !(val & pci->pin_cfg[offset].dir_msk); } -static struct gpio_chip rk805_gpio_chip = { +static const struct gpio_chip rk805_gpio_chip = { .label = "rk805-gpio", .request = gpiochip_generic_request, .free = gpiochip_generic_free, @@ -653,7 +653,7 @@ static const struct pinconf_ops rk805_pinconf_ops = { .pin_config_set = rk805_pinconf_set, }; -static struct pinctrl_desc rk805_pinctrl_desc = { +static const struct pinctrl_desc rk805_pinctrl_desc = { .name = "rk805-pinctrl", .pctlops = &rk805_pinctrl_ops, .pmxops = &rk805_pinmux_ops,