lkml.org 
[lkml]   [2018]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mfd: kempld-core: constify variables that point to const structure
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@lip6.fr>
>
> ---
> 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

\
 
 \ /
  Last update: 2018-07-04 08:21    [W:0.054 / U:1.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site