Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1301588 > unrolled thread

[PATCH] iio: ak8975: constify ak_def structures

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2016-01-05 16:10 +0100
Last post2016-01-09 18:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iio: ak8975: constify ak_def structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-01-05 16:10 +0100
    Re: [PATCH] iio: ak8975: constify ak_def structures Jonathan Cameron <jic23@kernel.org> - 2016-01-09 18:10 +0100

#1301588 — [PATCH] iio: ak8975: constify ak_def structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-01-05 16:10 +0100
Subject[PATCH] iio: ak8975: constify ak_def structures
Message-ID<qNBpf-4ua-1@gated-at.bofh.it>
The ak_def structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/iio/magnetometer/ak8975.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index b13936d..9c5c9ef 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -252,7 +252,7 @@ struct ak_def {
 	u8 data_regs[3];
 };
 
-static struct ak_def ak_def_array[AK_MAX_TYPE] = {
+static const struct ak_def ak_def_array[AK_MAX_TYPE] = {
 	{
 		.type = AK8975,
 		.raw_to_gauss = ak8975_raw_to_gauss,
@@ -360,7 +360,7 @@ static struct ak_def ak_def_array[AK_MAX_TYPE] = {
  */
 struct ak8975_data {
 	struct i2c_client	*client;
-	struct ak_def		*def;
+	const struct ak_def	*def;
 	struct attribute_group	attrs;
 	struct mutex		lock;
 	u8			asa[3];

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1305328

FromJonathan Cameron <jic23@kernel.org>
Date2016-01-09 18:10 +0100
Message-ID<qP5bz-8K-7@gated-at.bofh.it>
In reply to#1301588
On 05/01/16 14:56, Julia Lawall wrote:
> The ak_def structures are never modified, so declare them as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
Applied, thanks.

Jonathan
> ---
>  drivers/iio/magnetometer/ak8975.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index b13936d..9c5c9ef 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -252,7 +252,7 @@ struct ak_def {
>  	u8 data_regs[3];
>  };
>  
> -static struct ak_def ak_def_array[AK_MAX_TYPE] = {
> +static const struct ak_def ak_def_array[AK_MAX_TYPE] = {
>  	{
>  		.type = AK8975,
>  		.raw_to_gauss = ak8975_raw_to_gauss,
> @@ -360,7 +360,7 @@ static struct ak_def ak_def_array[AK_MAX_TYPE] = {
>   */
>  struct ak8975_data {
>  	struct i2c_client	*client;
> -	struct ak_def		*def;
> +	const struct ak_def	*def;
>  	struct attribute_group	attrs;
>  	struct mutex		lock;
>  	u8			asa[3];
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web