Re: [PATCH] mfd: kempld-core: constify variables that point to const structure

From: Lee Jones
Date: Wed Jul 04 2018 - 02:20:46 EST


On Wed, 13 Jun 2018, Julia Lawall wrote:

> Add const to the declaration of various local variables of type
> kempld_platform_data for which the referenced value is always only
> dereferenced or passed to a const parameter, to record the fact that
> kempld_platform_data_generic is declared as const.
>
> The semantic match that finds this issue is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r@
> identifier i,j;
> @@
> const struct i j = { ... };
>
> @ok@
> identifier r.i;
> position p;
> @@
> const struct i@p *
>
> @@
> identifier r.i;
> position p != ok.p;
> @@
> * struct i@p *
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@xxxxxxx>
>
> ---
> drivers/mfd/kempld-core.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)

Applied, thanks.

--
Lee Jones [æçæ]
Linaro Services Technical Lead
Linaro.org â Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog