All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] account for const type of of_device_id.data
@ 2018-01-02 13:27 ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-iio
  Cc: kernel-janitors, Peter Meerwald-Stadler, Lars-Peter Clausen,
	Hartmut Knaack, linux-mtd, linux-i2c, linux-spi, linux-rockchip,
	linux-arm-kernel, linux-pm, linux-kernel, linux-gpio, linux-pci,
	linux-arm-msm

Maintain const annotations when putting values into the data field of
an of_device_id structure, and afterwards when extracting them from
the data field of such a structure.

This was done using the following semantic patch:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier i,j;
const struct j *m;
struct i *y;
type T;
expression x,e;
position p;
@@

(
y =@p (T)(of_device_get_match_data(...));
|
x = of_match_node(...);
... when != x = e
(
m = e;
|
y =@p (T)(x->data);
)
)

@s@
identifier r.i,j;
@@

const struct i j = { ... };

@t depends on s disable optional_qualifier@
expression e;
identifier r.i,x,j,n;
struct j *m;
struct i *e1;
position any r.p;
type T;
@@

(
+const
struct i *x;
<+...
(
x =@p 
-   (T)(e)
+   e
|
x =@p e
)
...+>
|
m->@e1 n =@p 
-   (T)(e)
+   e
|
m->@e1 n =@p e
)

@disable optional_qualifier@
identifier t.j,t.n,r.i;
@@

struct j {
  ...
+ const
  struct i *n;
  ...
}

@@
identifier x,s.j;
type T;
@@

struct of_device_id x[] = { ...,
  { .data =
-           (T)
            &j, }, ...};

// </smpl>

---

 drivers/i2c/busses/i2c-rk3x.c               |   16 ++++++++--------
 drivers/iio/common/ssp_sensors/ssp.h        |    2 +-
 drivers/iio/common/ssp_sensors/ssp_dev.c    |    2 +-
 drivers/mtd/spi-nor/fsl-quadspi.c           |    8 ++++----
 drivers/pci/dwc/pcie-qcom.c                 |    4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
 drivers/pinctrl/pinctrl-at91-pio4.c         |    4 ++--
 drivers/pinctrl/pinctrl-axp209.c            |    2 +-
 drivers/power/avs/rockchip-io-domain.c      |   24 ++++++++++++------------
 drivers/power/reset/at91-sama5d2_shdwc.c    |    4 ++--
 drivers/power/supply/axp20x_ac_power.c      |    8 ++++----
 drivers/spi/spi-fsl-dspi.c                  |    7 +++----
 drivers/spi/spi-sirf.c                      |    4 ++--
 13 files changed, 44 insertions(+), 44 deletions(-)

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 00/12] account for const type of of_device_id.data
@ 2018-01-02 13:27 ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

Maintain const annotations when putting values into the data field of
an of_device_id structure, and afterwards when extracting them from
the data field of such a structure.

This was done using the following semantic patch:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier i,j;
const struct j *m;
struct i *y;
type T;
expression x,e;
position p;
@@

(
y =@p (T)(of_device_get_match_data(...));
|
x = of_match_node(...);
... when != x = e
(
m = e;
|
y =@p (T)(x->data);
)
)

@s@
identifier r.i,j;
@@

const struct i j = { ... };

@t depends on s disable optional_qualifier@
expression e;
identifier r.i,x,j,n;
struct j *m;
struct i *e1;
position any r.p;
type T;
@@

(
+const
struct i *x;
<+...
(
x =@p 
-   (T)(e)
+   e
|
x =@p e
)
...+>
|
m->@e1 n =@p 
-   (T)(e)
+   e
|
m->@e1 n =@p e
)

@disable optional_qualifier@
identifier t.j,t.n,r.i;
@@

struct j {
  ...
+ const
  struct i *n;
  ...
}

@@
identifier x,s.j;
type T;
@@

struct of_device_id x[] = { ...,
  { .data -           (T)
            &j, }, ...};

// </smpl>

---

 drivers/i2c/busses/i2c-rk3x.c               |   16 ++++++++--------
 drivers/iio/common/ssp_sensors/ssp.h        |    2 +-
 drivers/iio/common/ssp_sensors/ssp_dev.c    |    2 +-
 drivers/mtd/spi-nor/fsl-quadspi.c           |    8 ++++----
 drivers/pci/dwc/pcie-qcom.c                 |    4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
 drivers/pinctrl/pinctrl-at91-pio4.c         |    4 ++--
 drivers/pinctrl/pinctrl-axp209.c            |    2 +-
 drivers/power/avs/rockchip-io-domain.c      |   24 ++++++++++++------------
 drivers/power/reset/at91-sama5d2_shdwc.c    |    4 ++--
 drivers/power/supply/axp20x_ac_power.c      |    8 ++++----
 drivers/spi/spi-fsl-dspi.c                  |    7 +++----
 drivers/spi/spi-sirf.c                      |    4 ++--
 13 files changed, 44 insertions(+), 44 deletions(-)

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 00/12] account for const type of of_device_id.data
@ 2018-01-02 13:27 ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-iio
  Cc: linux-arm-msm, Lars-Peter Clausen, linux-pm, linux-pci,
	linux-gpio, kernel-janitors, linux-kernel, linux-spi,
	linux-rockchip, linux-mtd, linux-i2c, Peter Meerwald-Stadler,
	Hartmut Knaack, linux-arm-kernel

Maintain const annotations when putting values into the data field of
an of_device_id structure, and afterwards when extracting them from
the data field of such a structure.

This was done using the following semantic patch:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier i,j;
const struct j *m;
struct i *y;
type T;
expression x,e;
position p;
@@

(
y =@p (T)(of_device_get_match_data(...));
|
x = of_match_node(...);
... when != x = e
(
m = e;
|
y =@p (T)(x->data);
)
)

@s@
identifier r.i,j;
@@

const struct i j = { ... };

@t depends on s disable optional_qualifier@
expression e;
identifier r.i,x,j,n;
struct j *m;
struct i *e1;
position any r.p;
type T;
@@

(
+const
struct i *x;
<+...
(
x =@p 
-   (T)(e)
+   e
|
x =@p e
)
...+>
|
m->@e1 n =@p 
-   (T)(e)
+   e
|
m->@e1 n =@p e
)

@disable optional_qualifier@
identifier t.j,t.n,r.i;
@@

struct j {
  ...
+ const
  struct i *n;
  ...
}

@@
identifier x,s.j;
type T;
@@

struct of_device_id x[] = { ...,
  { .data =
-           (T)
            &j, }, ...};

// </smpl>

---

 drivers/i2c/busses/i2c-rk3x.c               |   16 ++++++++--------
 drivers/iio/common/ssp_sensors/ssp.h        |    2 +-
 drivers/iio/common/ssp_sensors/ssp_dev.c    |    2 +-
 drivers/mtd/spi-nor/fsl-quadspi.c           |    8 ++++----
 drivers/pci/dwc/pcie-qcom.c                 |    4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
 drivers/pinctrl/pinctrl-at91-pio4.c         |    4 ++--
 drivers/pinctrl/pinctrl-axp209.c            |    2 +-
 drivers/power/avs/rockchip-io-domain.c      |   24 ++++++++++++------------
 drivers/power/reset/at91-sama5d2_shdwc.c    |    4 ++--
 drivers/power/supply/axp20x_ac_power.c      |    8 ++++----
 drivers/spi/spi-fsl-dspi.c                  |    7 +++----
 drivers/spi/spi-sirf.c                      |    4 ++--
 13 files changed, 44 insertions(+), 44 deletions(-)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 00/12] account for const type of of_device_id.data
@ 2018-01-02 13:27 ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

Maintain const annotations when putting values into the data field of
an of_device_id structure, and afterwards when extracting them from
the data field of such a structure.

This was done using the following semantic patch:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier i,j;
const struct j *m;
struct i *y;
type T;
expression x,e;
position p;
@@

(
y =@p (T)(of_device_get_match_data(...));
|
x = of_match_node(...);
... when != x = e
(
m = e;
|
y =@p (T)(x->data);
)
)

@s@
identifier r.i,j;
@@

const struct i j = { ... };

@t depends on s disable optional_qualifier@
expression e;
identifier r.i,x,j,n;
struct j *m;
struct i *e1;
position any r.p;
type T;
@@

(
+const
struct i *x;
<+...
(
x =@p 
-   (T)(e)
+   e
|
x =@p e
)
...+>
|
m->@e1 n =@p 
-   (T)(e)
+   e
|
m->@e1 n =@p e
)

@disable optional_qualifier@
identifier t.j,t.n,r.i;
@@

struct j {
  ...
+ const
  struct i *n;
  ...
}

@@
identifier x,s.j;
type T;
@@

struct of_device_id x[] = { ...,
  { .data =
-           (T)
            &j, }, ...};

// </smpl>

---

 drivers/i2c/busses/i2c-rk3x.c               |   16 ++++++++--------
 drivers/iio/common/ssp_sensors/ssp.h        |    2 +-
 drivers/iio/common/ssp_sensors/ssp_dev.c    |    2 +-
 drivers/mtd/spi-nor/fsl-quadspi.c           |    8 ++++----
 drivers/pci/dwc/pcie-qcom.c                 |    4 ++--
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
 drivers/pinctrl/pinctrl-at91-pio4.c         |    4 ++--
 drivers/pinctrl/pinctrl-axp209.c            |    2 +-
 drivers/power/avs/rockchip-io-domain.c      |   24 ++++++++++++------------
 drivers/power/reset/at91-sama5d2_shdwc.c    |    4 ++--
 drivers/power/supply/axp20x_ac_power.c      |    8 ++++----
 drivers/spi/spi-fsl-dspi.c                  |    7 +++----
 drivers/spi/spi-sirf.c                      |    4 ++--
 13 files changed, 44 insertions(+), 44 deletions(-)

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 01/12] PM / AVS: rockchip-io: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
  (?)
  (?)
@ 2018-01-02 13:27   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: kernel-janitors, Nishanth Menon, Heiko Stuebner, linux-pm,
	linux-arm-kernel, linux-rockchip, linux-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is
thus no longer needed.

Done using Coccinelle.

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

---
 drivers/power/avs/rockchip-io-domain.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff -u -p a/drivers/power/avs/rockchip-io-domain.c b/drivers/power/avs/rockchip-io-domain.c
--- a/drivers/power/avs/rockchip-io-domain.c
+++ b/drivers/power/avs/rockchip-io-domain.c
@@ -76,7 +76,7 @@ struct rockchip_iodomain_supply {
 struct rockchip_iodomain {
 	struct device *dev;
 	struct regmap *grf;
-	struct rockchip_iodomain_soc_data *soc_data;
+	const struct rockchip_iodomain_soc_data *soc_data;
 	struct rockchip_iodomain_supply supplies[MAX_SUPPLIES];
 };
 
@@ -382,43 +382,43 @@ static const struct rockchip_iodomain_so
 static const struct of_device_id rockchip_iodomain_match[] = {
 	{
 		.compatible = "rockchip,rk3188-io-voltage-domain",
-		.data = (void *)&soc_data_rk3188
+		.data = &soc_data_rk3188
 	},
 	{
 		.compatible = "rockchip,rk3228-io-voltage-domain",
-		.data = (void *)&soc_data_rk3228
+		.data = &soc_data_rk3228
 	},
 	{
 		.compatible = "rockchip,rk3288-io-voltage-domain",
-		.data = (void *)&soc_data_rk3288
+		.data = &soc_data_rk3288
 	},
 	{
 		.compatible = "rockchip,rk3328-io-voltage-domain",
-		.data = (void *)&soc_data_rk3328
+		.data = &soc_data_rk3328
 	},
 	{
 		.compatible = "rockchip,rk3368-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368
+		.data = &soc_data_rk3368
 	},
 	{
 		.compatible = "rockchip,rk3368-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368_pmu
+		.data = &soc_data_rk3368_pmu
 	},
 	{
 		.compatible = "rockchip,rk3399-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399
+		.data = &soc_data_rk3399
 	},
 	{
 		.compatible = "rockchip,rk3399-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399_pmu
+		.data = &soc_data_rk3399_pmu
 	},
 	{
 		.compatible = "rockchip,rv1108-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108
+		.data = &soc_data_rv1108
 	},
 	{
 		.compatible = "rockchip,rv1108-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108_pmu
+		.data = &soc_data_rv1108_pmu
 	},
 	{ /* sentinel */ },
 };
@@ -443,7 +443,7 @@ static int rockchip_iodomain_probe(struc
 	platform_set_drvdata(pdev, iod);
 
 	match = of_match_node(rockchip_iodomain_match, np);
-	iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
+	iod->soc_data = match->data;
 
 	parent = pdev->dev.parent;
 	if (parent && parent->of_node) {

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 01/12] PM / AVS: rockchip-io: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is
thus no longer needed.

Done using Coccinelle.

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

---
 drivers/power/avs/rockchip-io-domain.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff -u -p a/drivers/power/avs/rockchip-io-domain.c b/drivers/power/avs/rockchip-io-domain.c
--- a/drivers/power/avs/rockchip-io-domain.c
+++ b/drivers/power/avs/rockchip-io-domain.c
@@ -76,7 +76,7 @@ struct rockchip_iodomain_supply {
 struct rockchip_iodomain {
 	struct device *dev;
 	struct regmap *grf;
-	struct rockchip_iodomain_soc_data *soc_data;
+	const struct rockchip_iodomain_soc_data *soc_data;
 	struct rockchip_iodomain_supply supplies[MAX_SUPPLIES];
 };
 
@@ -382,43 +382,43 @@ static const struct rockchip_iodomain_so
 static const struct of_device_id rockchip_iodomain_match[] = {
 	{
 		.compatible = "rockchip,rk3188-io-voltage-domain",
-		.data = (void *)&soc_data_rk3188
+		.data = &soc_data_rk3188
 	},
 	{
 		.compatible = "rockchip,rk3228-io-voltage-domain",
-		.data = (void *)&soc_data_rk3228
+		.data = &soc_data_rk3228
 	},
 	{
 		.compatible = "rockchip,rk3288-io-voltage-domain",
-		.data = (void *)&soc_data_rk3288
+		.data = &soc_data_rk3288
 	},
 	{
 		.compatible = "rockchip,rk3328-io-voltage-domain",
-		.data = (void *)&soc_data_rk3328
+		.data = &soc_data_rk3328
 	},
 	{
 		.compatible = "rockchip,rk3368-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368
+		.data = &soc_data_rk3368
 	},
 	{
 		.compatible = "rockchip,rk3368-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368_pmu
+		.data = &soc_data_rk3368_pmu
 	},
 	{
 		.compatible = "rockchip,rk3399-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399
+		.data = &soc_data_rk3399
 	},
 	{
 		.compatible = "rockchip,rk3399-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399_pmu
+		.data = &soc_data_rk3399_pmu
 	},
 	{
 		.compatible = "rockchip,rv1108-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108
+		.data = &soc_data_rv1108
 	},
 	{
 		.compatible = "rockchip,rv1108-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108_pmu
+		.data = &soc_data_rv1108_pmu
 	},
 	{ /* sentinel */ },
 };
@@ -443,7 +443,7 @@ static int rockchip_iodomain_probe(struc
 	platform_set_drvdata(pdev, iod);
 
 	match = of_match_node(rockchip_iodomain_match, np);
-	iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
+	iod->soc_data = match->data;
 
 	parent = pdev->dev.parent;
 	if (parent && parent->of_node) {


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 01/12] PM / AVS: rockchip-io: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: Kevin Hilman
  Cc: Nishanth Menon, Heiko Stuebner, linux-pm, kernel-janitors,
	linux-kernel, linux-rockchip, linux-arm-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is
thus no longer needed.

Done using Coccinelle.

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

---
 drivers/power/avs/rockchip-io-domain.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff -u -p a/drivers/power/avs/rockchip-io-domain.c b/drivers/power/avs/rockchip-io-domain.c
--- a/drivers/power/avs/rockchip-io-domain.c
+++ b/drivers/power/avs/rockchip-io-domain.c
@@ -76,7 +76,7 @@ struct rockchip_iodomain_supply {
 struct rockchip_iodomain {
 	struct device *dev;
 	struct regmap *grf;
-	struct rockchip_iodomain_soc_data *soc_data;
+	const struct rockchip_iodomain_soc_data *soc_data;
 	struct rockchip_iodomain_supply supplies[MAX_SUPPLIES];
 };
 
@@ -382,43 +382,43 @@ static const struct rockchip_iodomain_so
 static const struct of_device_id rockchip_iodomain_match[] = {
 	{
 		.compatible = "rockchip,rk3188-io-voltage-domain",
-		.data = (void *)&soc_data_rk3188
+		.data = &soc_data_rk3188
 	},
 	{
 		.compatible = "rockchip,rk3228-io-voltage-domain",
-		.data = (void *)&soc_data_rk3228
+		.data = &soc_data_rk3228
 	},
 	{
 		.compatible = "rockchip,rk3288-io-voltage-domain",
-		.data = (void *)&soc_data_rk3288
+		.data = &soc_data_rk3288
 	},
 	{
 		.compatible = "rockchip,rk3328-io-voltage-domain",
-		.data = (void *)&soc_data_rk3328
+		.data = &soc_data_rk3328
 	},
 	{
 		.compatible = "rockchip,rk3368-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368
+		.data = &soc_data_rk3368
 	},
 	{
 		.compatible = "rockchip,rk3368-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368_pmu
+		.data = &soc_data_rk3368_pmu
 	},
 	{
 		.compatible = "rockchip,rk3399-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399
+		.data = &soc_data_rk3399
 	},
 	{
 		.compatible = "rockchip,rk3399-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399_pmu
+		.data = &soc_data_rk3399_pmu
 	},
 	{
 		.compatible = "rockchip,rv1108-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108
+		.data = &soc_data_rv1108
 	},
 	{
 		.compatible = "rockchip,rv1108-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108_pmu
+		.data = &soc_data_rv1108_pmu
 	},
 	{ /* sentinel */ },
 };
@@ -443,7 +443,7 @@ static int rockchip_iodomain_probe(struc
 	platform_set_drvdata(pdev, iod);
 
 	match = of_match_node(rockchip_iodomain_match, np);
-	iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
+	iod->soc_data = match->data;
 
 	parent = pdev->dev.parent;
 	if (parent && parent->of_node) {

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 01/12] PM / AVS: rockchip-io: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is
thus no longer needed.

Done using Coccinelle.

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

---
 drivers/power/avs/rockchip-io-domain.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff -u -p a/drivers/power/avs/rockchip-io-domain.c b/drivers/power/avs/rockchip-io-domain.c
--- a/drivers/power/avs/rockchip-io-domain.c
+++ b/drivers/power/avs/rockchip-io-domain.c
@@ -76,7 +76,7 @@ struct rockchip_iodomain_supply {
 struct rockchip_iodomain {
 	struct device *dev;
 	struct regmap *grf;
-	struct rockchip_iodomain_soc_data *soc_data;
+	const struct rockchip_iodomain_soc_data *soc_data;
 	struct rockchip_iodomain_supply supplies[MAX_SUPPLIES];
 };
 
@@ -382,43 +382,43 @@ static const struct rockchip_iodomain_so
 static const struct of_device_id rockchip_iodomain_match[] = {
 	{
 		.compatible = "rockchip,rk3188-io-voltage-domain",
-		.data = (void *)&soc_data_rk3188
+		.data = &soc_data_rk3188
 	},
 	{
 		.compatible = "rockchip,rk3228-io-voltage-domain",
-		.data = (void *)&soc_data_rk3228
+		.data = &soc_data_rk3228
 	},
 	{
 		.compatible = "rockchip,rk3288-io-voltage-domain",
-		.data = (void *)&soc_data_rk3288
+		.data = &soc_data_rk3288
 	},
 	{
 		.compatible = "rockchip,rk3328-io-voltage-domain",
-		.data = (void *)&soc_data_rk3328
+		.data = &soc_data_rk3328
 	},
 	{
 		.compatible = "rockchip,rk3368-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368
+		.data = &soc_data_rk3368
 	},
 	{
 		.compatible = "rockchip,rk3368-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3368_pmu
+		.data = &soc_data_rk3368_pmu
 	},
 	{
 		.compatible = "rockchip,rk3399-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399
+		.data = &soc_data_rk3399
 	},
 	{
 		.compatible = "rockchip,rk3399-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rk3399_pmu
+		.data = &soc_data_rk3399_pmu
 	},
 	{
 		.compatible = "rockchip,rv1108-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108
+		.data = &soc_data_rv1108
 	},
 	{
 		.compatible = "rockchip,rv1108-pmu-io-voltage-domain",
-		.data = (void *)&soc_data_rv1108_pmu
+		.data = &soc_data_rv1108_pmu
 	},
 	{ /* sentinel */ },
 };
@@ -443,7 +443,7 @@ static int rockchip_iodomain_probe(struc
 	platform_set_drvdata(pdev, iod);
 
 	match = of_match_node(rockchip_iodomain_match, np);
-	iod->soc_data = (struct rockchip_iodomain_soc_data *)match->data;
+	iod->soc_data = match->data;
 
 	parent = pdev->dev.parent;
 	if (parent && parent->of_node) {

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 02/12] pinctrl: at91-pio4: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
  (?)
  (?)
@ 2018-01-02 13:27   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: Ludovic Desroches
  Cc: Linus Walleij, kernel-janitors, linux-kernel, linux-gpio,
	Alexandre Belloni, linux-arm-kernel

This driver creates a const structure that it stores in the data field
of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/pinctrl/pinctrl-at91-pio4.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -910,7 +910,7 @@ static int atmel_pinctrl_probe(struct pl
 	int i, ret;
 	struct resource	*res;
 	struct atmel_pioctrl *atmel_pioctrl;
-	struct atmel_pioctrl_data *atmel_pioctrl_data;
+	const struct atmel_pioctrl_data *atmel_pioctrl_data;
 
 	atmel_pioctrl = devm_kzalloc(dev, sizeof(*atmel_pioctrl), GFP_KERNEL);
 	if (!atmel_pioctrl)
@@ -924,7 +924,7 @@ static int atmel_pinctrl_probe(struct pl
 		dev_err(dev, "unknown compatible string\n");
 		return -ENODEV;
 	}
-	atmel_pioctrl_data = (struct atmel_pioctrl_data *)match->data;
+	atmel_pioctrl_data = match->data;
 	atmel_pioctrl->nbanks = atmel_pioctrl_data->nbanks;
 	atmel_pioctrl->npins = atmel_pioctrl->nbanks * ATMEL_PIO_NPINS_PER_BANK;

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 02/12] pinctrl: at91-pio4: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: Ludovic Desroches
  Cc: kernel-janitors, Linus Walleij, Nicolas Ferre, Alexandre Belloni,
	linux-arm-kernel, linux-gpio, linux-kernel

This driver creates a const structure that it stores in the data field
of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/pinctrl/pinctrl-at91-pio4.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -910,7 +910,7 @@ static int atmel_pinctrl_probe(struct pl
 	int i, ret;
 	struct resource	*res;
 	struct atmel_pioctrl *atmel_pioctrl;
-	struct atmel_pioctrl_data *atmel_pioctrl_data;
+	const struct atmel_pioctrl_data *atmel_pioctrl_data;
 
 	atmel_pioctrl = devm_kzalloc(dev, sizeof(*atmel_pioctrl), GFP_KERNEL);
 	if (!atmel_pioctrl)
@@ -924,7 +924,7 @@ static int atmel_pinctrl_probe(struct pl
 		dev_err(dev, "unknown compatible string\n");
 		return -ENODEV;
 	}
-	atmel_pioctrl_data = (struct atmel_pioctrl_data *)match->data;
+	atmel_pioctrl_data = match->data;
 	atmel_pioctrl->nbanks = atmel_pioctrl_data->nbanks;
 	atmel_pioctrl->npins = atmel_pioctrl->nbanks * ATMEL_PIO_NPINS_PER_BANK;
 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 02/12] pinctrl: at91-pio4: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a const structure that it stores in the data field
of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/pinctrl/pinctrl-at91-pio4.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -910,7 +910,7 @@ static int atmel_pinctrl_probe(struct pl
 	int i, ret;
 	struct resource	*res;
 	struct atmel_pioctrl *atmel_pioctrl;
-	struct atmel_pioctrl_data *atmel_pioctrl_data;
+	const struct atmel_pioctrl_data *atmel_pioctrl_data;
 
 	atmel_pioctrl = devm_kzalloc(dev, sizeof(*atmel_pioctrl), GFP_KERNEL);
 	if (!atmel_pioctrl)
@@ -924,7 +924,7 @@ static int atmel_pinctrl_probe(struct pl
 		dev_err(dev, "unknown compatible string\n");
 		return -ENODEV;
 	}
-	atmel_pioctrl_data = (struct atmel_pioctrl_data *)match->data;
+	atmel_pioctrl_data = match->data;
 	atmel_pioctrl->nbanks = atmel_pioctrl_data->nbanks;
 	atmel_pioctrl->npins = atmel_pioctrl->nbanks * ATMEL_PIO_NPINS_PER_BANK;
 


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 02/12] pinctrl: at91-pio4: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a const structure that it stores in the data field
of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/pinctrl/pinctrl-at91-pio4.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -910,7 +910,7 @@ static int atmel_pinctrl_probe(struct pl
 	int i, ret;
 	struct resource	*res;
 	struct atmel_pioctrl *atmel_pioctrl;
-	struct atmel_pioctrl_data *atmel_pioctrl_data;
+	const struct atmel_pioctrl_data *atmel_pioctrl_data;
 
 	atmel_pioctrl = devm_kzalloc(dev, sizeof(*atmel_pioctrl), GFP_KERNEL);
 	if (!atmel_pioctrl)
@@ -924,7 +924,7 @@ static int atmel_pinctrl_probe(struct pl
 		dev_err(dev, "unknown compatible string\n");
 		return -ENODEV;
 	}
-	atmel_pioctrl_data = (struct atmel_pioctrl_data *)match->data;
+	atmel_pioctrl_data = match->data;
 	atmel_pioctrl->nbanks = atmel_pioctrl_data->nbanks;
 	atmel_pioctrl->npins = atmel_pioctrl->nbanks * ATMEL_PIO_NPINS_PER_BANK;
 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 03/12] spi: sirf: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
  (?)
@ 2018-01-02 13:27   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: Mark Brown
  Cc: kernel-janitors, Barry Song, linux-spi, linux-arm-kernel, linux-kernel

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/spi/spi-sirf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct plat
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct plat
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 03/12] spi: sirf: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/spi/spi-sirf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct plat
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct plat
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 03/12] spi: sirf: account for const type of of_device_id.data
@ 2018-01-02 13:27   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:27 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/spi/spi-sirf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct plat
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct plat
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Stanimir Varbanov
  Cc: kernel-janitors, Lorenzo Pieralisi, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/pci/dwc/pcie-qcom.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
--- a/drivers/pci/dwc/pcie-qcom.c
+++ b/drivers/pci/dwc/pcie-qcom.c
@@ -171,7 +171,7 @@ struct qcom_pcie {
 	union qcom_pcie_resources res;
 	struct phy *phy;
 	struct gpio_desc *reset;
-	struct qcom_pcie_ops *ops;
+	const struct qcom_pcie_ops *ops;
 };
 
 #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
@@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
 
 	pcie->pci = pci;
 
-	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
+	pcie->ops = of_device_get_match_data(dev);
 
 	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
 	if (IS_ERR(pcie->reset))

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Stanimir Varbanov
  Cc: kernel-janitors, Lorenzo Pieralisi, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

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

---
 drivers/pci/dwc/pcie-qcom.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
--- a/drivers/pci/dwc/pcie-qcom.c
+++ b/drivers/pci/dwc/pcie-qcom.c
@@ -171,7 +171,7 @@ struct qcom_pcie {
 	union qcom_pcie_resources res;
 	struct phy *phy;
 	struct gpio_desc *reset;
-	struct qcom_pcie_ops *ops;
+	const struct qcom_pcie_ops *ops;
 };
 
 #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
@@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
 
 	pcie->pci = pci;
 
-	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
+	pcie->ops = of_device_get_match_data(dev);
 
 	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
 	if (IS_ERR(pcie->reset))


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
  (?)
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Jason Cooper
  Cc: kernel-janitors, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Linus Walleij, linux-arm-kernel,
	linux-gpio, linux-kernel

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

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

---
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -1006,11 +1006,11 @@ static int armada_37xx_pinctrl_register(
 static const struct of_device_id armada_37xx_pinctrl_of_match[] = {
 	{
 		.compatible = "marvell,armada3710-sb-pinctrl",
-		.data = (void *)&armada_37xx_pin_sb,
+		.data = &armada_37xx_pin_sb,
 	},
 	{
 		.compatible = "marvell,armada3710-nb-pinctrl",
-		.data = (void *)&armada_37xx_pin_nb,
+		.data = &armada_37xx_pin_nb,
 	},
 	{ },
 };

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

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

---
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -1006,11 +1006,11 @@ static int armada_37xx_pinctrl_register(
 static const struct of_device_id armada_37xx_pinctrl_of_match[] = {
 	{
 		.compatible = "marvell,armada3710-sb-pinctrl",
-		.data = (void *)&armada_37xx_pin_sb,
+		.data = &armada_37xx_pin_sb,
 	},
 	{
 		.compatible = "marvell,armada3710-nb-pinctrl",
-		.data = (void *)&armada_37xx_pin_nb,
+		.data = &armada_37xx_pin_nb,
 	},
 	{ },
 };


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

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

---
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -1006,11 +1006,11 @@ static int armada_37xx_pinctrl_register(
 static const struct of_device_id armada_37xx_pinctrl_of_match[] = {
 	{
 		.compatible = "marvell,armada3710-sb-pinctrl",
-		.data = (void *)&armada_37xx_pin_sb,
+		.data = &armada_37xx_pin_sb,
 	},
 	{
 		.compatible = "marvell,armada3710-nb-pinctrl",
-		.data = (void *)&armada_37xx_pin_nb,
+		.data = &armada_37xx_pin_nb,
 	},
 	{ },
 };

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 06/12] power: supply: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: kernel-janitors, Chen-Yu Tsai, linux-pm, linux-kernel

This driver creates two const structures that it stores in the data
field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is thus
no longer needed.

Done using Coccinelle.

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

---
 drivers/power/supply/axp20x_ac_power.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -u -p a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c
--- a/drivers/power/supply/axp20x_ac_power.c
+++ b/drivers/power/supply/axp20x_ac_power.c
@@ -159,7 +159,7 @@ static int axp20x_ac_power_probe(struct
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
 	struct power_supply_config psy_cfg = {};
 	struct axp20x_ac_power *power;
-	struct axp_data *axp_data;
+	const struct axp_data *axp_data;
 	static const char * const irq_names[] = { "ACIN_PLUGIN", "ACIN_REMOVAL",
 		NULL };
 	int i, irq, ret;
@@ -176,7 +176,7 @@ static int axp20x_ac_power_probe(struct
 	if (!power)
 		return -ENOMEM;
 
-	axp_data = (struct axp_data *)of_device_get_match_data(&pdev->dev);
+	axp_data = of_device_get_match_data(&pdev->dev);
 
 	if (axp_data->acin_adc) {
 		power->acin_v = devm_iio_channel_get(&pdev->dev, "acin_v");
@@ -230,10 +230,10 @@ static int axp20x_ac_power_probe(struct
 static const struct of_device_id axp20x_ac_power_match[] = {
 	{
 		.compatible = "x-powers,axp202-ac-power-supply",
-		.data = (void *)&axp20x_data,
+		.data = &axp20x_data,
 	}, {
 		.compatible = "x-powers,axp221-ac-power-supply",
-		.data = (void *)&axp22x_data,
+		.data = &axp22x_data,
 	}, { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, axp20x_ac_power_match);

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 06/12] power: supply: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: kernel-janitors, Chen-Yu Tsai, linux-pm, linux-kernel

This driver creates two const structures that it stores in the data
field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is thus
no longer needed.

Done using Coccinelle.

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

---
 drivers/power/supply/axp20x_ac_power.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -u -p a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c
--- a/drivers/power/supply/axp20x_ac_power.c
+++ b/drivers/power/supply/axp20x_ac_power.c
@@ -159,7 +159,7 @@ static int axp20x_ac_power_probe(struct
 	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
 	struct power_supply_config psy_cfg = {};
 	struct axp20x_ac_power *power;
-	struct axp_data *axp_data;
+	const struct axp_data *axp_data;
 	static const char * const irq_names[] = { "ACIN_PLUGIN", "ACIN_REMOVAL",
 		NULL };
 	int i, irq, ret;
@@ -176,7 +176,7 @@ static int axp20x_ac_power_probe(struct
 	if (!power)
 		return -ENOMEM;
 
-	axp_data = (struct axp_data *)of_device_get_match_data(&pdev->dev);
+	axp_data = of_device_get_match_data(&pdev->dev);
 
 	if (axp_data->acin_adc) {
 		power->acin_v = devm_iio_channel_get(&pdev->dev, "acin_v");
@@ -230,10 +230,10 @@ static int axp20x_ac_power_probe(struct
 static const struct of_device_id axp20x_ac_power_match[] = {
 	{
 		.compatible = "x-powers,axp202-ac-power-supply",
-		.data = (void *)&axp20x_data,
+		.data = &axp20x_data,
 	}, {
 		.compatible = "x-powers,axp221-ac-power-supply",
-		.data = (void *)&axp22x_data,
+		.data = &axp22x_data,
 	}, { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, axp20x_ac_power_match);


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
  (?)
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: kernel-janitors, Wolfram Sang, linux-arm-kernel, linux-rockchip,
	linux-i2c, linux-kernel

This driver creates a number of const structures that it stores in
the data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is thus
no longer needed.

Done using Coccinelle.

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

---
 drivers/i2c/busses/i2c-rk3x.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff -u -p a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -194,7 +194,7 @@ struct rk3x_i2c_soc_data {
 struct rk3x_i2c {
 	struct i2c_adapter adap;
 	struct device *dev;
-	struct rk3x_i2c_soc_data *soc_data;
+	const struct rk3x_i2c_soc_data *soc_data;
 
 	/* Hardware resources */
 	void __iomem *regs;
@@ -1164,27 +1164,27 @@ static const struct rk3x_i2c_soc_data rk
 static const struct of_device_id rk3x_i2c_match[] = {
 	{
 		.compatible = "rockchip,rv1108-i2c",
-		.data = (void *)&rv1108_soc_data
+		.data = &rv1108_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3066-i2c",
-		.data = (void *)&rk3066_soc_data
+		.data = &rk3066_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3188-i2c",
-		.data = (void *)&rk3188_soc_data
+		.data = &rk3188_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3228-i2c",
-		.data = (void *)&rk3228_soc_data
+		.data = &rk3228_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3288-i2c",
-		.data = (void *)&rk3288_soc_data
+		.data = &rk3288_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3399-i2c",
-		.data = (void *)&rk3399_soc_data
+		.data = &rk3399_soc_data
 	},
 	{},
 };
@@ -1207,7 +1207,7 @@ static int rk3x_i2c_probe(struct platfor
 		return -ENOMEM;
 
 	match = of_match_node(rk3x_i2c_match, np);
-	i2c->soc_data = (struct rk3x_i2c_soc_data *)match->data;
+	i2c->soc_data = match->data;
 
 	/* use common interface to get I2C timing properties */
 	i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a number of const structures that it stores in
the data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is thus
no longer needed.

Done using Coccinelle.

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

---
 drivers/i2c/busses/i2c-rk3x.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff -u -p a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -194,7 +194,7 @@ struct rk3x_i2c_soc_data {
 struct rk3x_i2c {
 	struct i2c_adapter adap;
 	struct device *dev;
-	struct rk3x_i2c_soc_data *soc_data;
+	const struct rk3x_i2c_soc_data *soc_data;
 
 	/* Hardware resources */
 	void __iomem *regs;
@@ -1164,27 +1164,27 @@ static const struct rk3x_i2c_soc_data rk
 static const struct of_device_id rk3x_i2c_match[] = {
 	{
 		.compatible = "rockchip,rv1108-i2c",
-		.data = (void *)&rv1108_soc_data
+		.data = &rv1108_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3066-i2c",
-		.data = (void *)&rk3066_soc_data
+		.data = &rk3066_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3188-i2c",
-		.data = (void *)&rk3188_soc_data
+		.data = &rk3188_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3228-i2c",
-		.data = (void *)&rk3228_soc_data
+		.data = &rk3228_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3288-i2c",
-		.data = (void *)&rk3288_soc_data
+		.data = &rk3288_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3399-i2c",
-		.data = (void *)&rk3399_soc_data
+		.data = &rk3399_soc_data
 	},
 	{},
 };
@@ -1207,7 +1207,7 @@ static int rk3x_i2c_probe(struct platfor
 		return -ENOMEM;
 
 	match = of_match_node(rk3x_i2c_match, np);
-	i2c->soc_data = (struct rk3x_i2c_soc_data *)match->data;
+	i2c->soc_data = match->data;
 
 	/* use common interface to get I2C timing properties */
 	i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a number of const structures that it stores in
the data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Furthermore, adding const to the declaration of the location that
receives a const value from such a field ensures that the compiler
will continue to check that the value is not modified.  The
const-discarding cast on the extraction from the data field is thus
no longer needed.

Done using Coccinelle.

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

---
 drivers/i2c/busses/i2c-rk3x.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff -u -p a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -194,7 +194,7 @@ struct rk3x_i2c_soc_data {
 struct rk3x_i2c {
 	struct i2c_adapter adap;
 	struct device *dev;
-	struct rk3x_i2c_soc_data *soc_data;
+	const struct rk3x_i2c_soc_data *soc_data;
 
 	/* Hardware resources */
 	void __iomem *regs;
@@ -1164,27 +1164,27 @@ static const struct rk3x_i2c_soc_data rk
 static const struct of_device_id rk3x_i2c_match[] = {
 	{
 		.compatible = "rockchip,rv1108-i2c",
-		.data = (void *)&rv1108_soc_data
+		.data = &rv1108_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3066-i2c",
-		.data = (void *)&rk3066_soc_data
+		.data = &rk3066_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3188-i2c",
-		.data = (void *)&rk3188_soc_data
+		.data = &rk3188_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3228-i2c",
-		.data = (void *)&rk3228_soc_data
+		.data = &rk3228_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3288-i2c",
-		.data = (void *)&rk3288_soc_data
+		.data = &rk3288_soc_data
 	},
 	{
 		.compatible = "rockchip,rk3399-i2c",
-		.data = (void *)&rk3399_soc_data
+		.data = &rk3399_soc_data
 	},
 	{},
 };
@@ -1207,7 +1207,7 @@ static int rk3x_i2c_probe(struct platfor
 		return -ENOMEM;
 
 	match = of_match_node(rk3x_i2c_match, np);
-	i2c->soc_data = (struct rk3x_i2c_soc_data *)match->data;
+	i2c->soc_data = match->data;
 
 	/* use common interface to get I2C timing properties */
 	i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 08/12] pinctrl: axp209: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kernel-janitors, Chen-Yu Tsai, linux-gpio, linux-kernel

The return value of of_device_get_match_data has type const void *.
The desc field of the pctl structure also has a const type, so there
is no need for the const-discarding cast between them.

Done using Coccinelle.

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

---
 drivers/pinctrl/pinctrl-axp209.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c
--- a/drivers/pinctrl/pinctrl-axp209.c
+++ b/drivers/pinctrl/pinctrl-axp209.c
@@ -414,7 +414,7 @@ static int axp20x_pctl_probe(struct plat
 	pctl->chip.direction_input	= axp20x_gpio_input;
 	pctl->chip.direction_output	= axp20x_gpio_output;
 
-	pctl->desc = (struct axp20x_pctrl_desc *)of_device_get_match_data(dev);
+	pctl->desc = of_device_get_match_data(dev);
 
 	pctl->chip.ngpio		= pctl->desc->npins;
 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 08/12] pinctrl: axp209: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Linus Walleij; +Cc: kernel-janitors, Chen-Yu Tsai, linux-gpio, linux-kernel

The return value of of_device_get_match_data has type const void *.
The desc field of the pctl structure also has a const type, so there
is no need for the const-discarding cast between them.

Done using Coccinelle.

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

---
 drivers/pinctrl/pinctrl-axp209.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c
--- a/drivers/pinctrl/pinctrl-axp209.c
+++ b/drivers/pinctrl/pinctrl-axp209.c
@@ -414,7 +414,7 @@ static int axp20x_pctl_probe(struct plat
 	pctl->chip.direction_input	= axp20x_gpio_input;
 	pctl->chip.direction_output	= axp20x_gpio_output;
 
-	pctl->desc = (struct axp20x_pctrl_desc *)of_device_get_match_data(dev);
+	pctl->desc = of_device_get_match_data(dev);
 
 	pctl->chip.ngpio		= pctl->desc->npins;
 


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 09/12] mtd: fsl-quadspi: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Han Xu
  Cc: kernel-janitors, Cyrille Pitchen, Marek Vasut, David Woodhouse,
	Brian Norris, Boris Brezillon, Richard Weinberger, linux-mtd,
	linux-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

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

---
 drivers/mtd/spi-nor/fsl-quadspi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -u -p a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -801,10 +801,10 @@ static int fsl_qspi_nor_setup_last(struc
 }
 
 static const struct of_device_id fsl_qspi_dt_ids[] = {
-	{ .compatible = "fsl,vf610-qspi", .data = (void *)&vybrid_data, },
-	{ .compatible = "fsl,imx6sx-qspi", .data = (void *)&imx6sx_data, },
-	{ .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, },
-	{ .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, },
+	{ .compatible = "fsl,vf610-qspi", .data = &vybrid_data, },
+	{ .compatible = "fsl,imx6sx-qspi", .data = &imx6sx_data, },
+	{ .compatible = "fsl,imx7d-qspi", .data = &imx7d_data, },
+	{ .compatible = "fsl,imx6ul-qspi", .data = &imx6ul_data, },
 	{ .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, },
 	{ /* sentinel */ }
 };

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 09/12] mtd: fsl-quadspi: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Han Xu
  Cc: kernel-janitors, Cyrille Pitchen, Marek Vasut, David Woodhouse,
	Brian Norris, Boris Brezillon, Richard Weinberger, linux-mtd,
	linux-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

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

---
 drivers/mtd/spi-nor/fsl-quadspi.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -u -p a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -801,10 +801,10 @@ static int fsl_qspi_nor_setup_last(struc
 }
 
 static const struct of_device_id fsl_qspi_dt_ids[] = {
-	{ .compatible = "fsl,vf610-qspi", .data = (void *)&vybrid_data, },
-	{ .compatible = "fsl,imx6sx-qspi", .data = (void *)&imx6sx_data, },
-	{ .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, },
-	{ .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, },
+	{ .compatible = "fsl,vf610-qspi", .data = &vybrid_data, },
+	{ .compatible = "fsl,imx6sx-qspi", .data = &imx6sx_data, },
+	{ .compatible = "fsl,imx7d-qspi", .data = &imx7d_data, },
+	{ .compatible = "fsl,imx6ul-qspi", .data = &imx6ul_data, },
 	{ .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, },
 	{ /* sentinel */ }
 };


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 10/12] spi: spi-fsl-dspi: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: kernel-janitors, linux-spi, linux-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

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

---
 drivers/spi/spi-fsl-dspi.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 02d3ed7..0630962 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -903,10 +903,9 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
 }
 
 static const struct of_device_id fsl_dspi_dt_ids[] = {
-	{ .compatible = "fsl,vf610-dspi", .data = (void *)&vf610_data, },
-	{ .compatible = "fsl,ls1021a-v1.0-dspi",
-		.data = (void *)&ls1021a_v1_data, },
-	{ .compatible = "fsl,ls2085a-dspi", .data = (void *)&ls2085a_data, },
+	{ .compatible = "fsl,vf610-dspi", .data = &vf610_data, },
+	{ .compatible = "fsl,ls1021a-v1.0-dspi", .data = &ls1021a_v1_data, },
+	{ .compatible = "fsl,ls2085a-dspi", .data = &ls2085a_data, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fsl_dspi_dt_ids);

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [PATCH 10/12] spi: spi-fsl-dspi: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: kernel-janitors, linux-spi, linux-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

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

---
 drivers/spi/spi-fsl-dspi.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 02d3ed7..0630962 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -903,10 +903,9 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
 }
 
 static const struct of_device_id fsl_dspi_dt_ids[] = {
-	{ .compatible = "fsl,vf610-dspi", .data = (void *)&vf610_data, },
-	{ .compatible = "fsl,ls1021a-v1.0-dspi",
-		.data = (void *)&ls1021a_v1_data, },
-	{ .compatible = "fsl,ls2085a-dspi", .data = (void *)&ls2085a_data, },
+	{ .compatible = "fsl,vf610-dspi", .data = &vf610_data, },
+	{ .compatible = "fsl,ls1021a-v1.0-dspi", .data = &ls1021a_v1_data, },
+	{ .compatible = "fsl,ls2085a-dspi", .data = &ls2085a_data, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fsl_dspi_dt_ids);

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [PATCH 11/12] iio: common: ssp_sensors: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: kernel-janitors, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

Add const to the declaration of the location that receives a value
from the data field to ensure that the compiler will continue to check
that the value is not modified and remove the const-dropping cast on
the access to the data field.

Done using Coccinelle.

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

---
 drivers/iio/common/ssp_sensors/ssp.h     |    2 +-
 drivers/iio/common/ssp_sensors/ssp_dev.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/iio/common/ssp_sensors/ssp.h b/drivers/iio/common/ssp_sensors/ssp.h
--- a/drivers/iio/common/ssp_sensors/ssp.h
+++ b/drivers/iio/common/ssp_sensors/ssp.h
@@ -188,7 +188,7 @@ struct ssp_sensorhub_info {
  */
 struct ssp_data {
 	struct spi_device *spi;
-	struct ssp_sensorhub_info *sensorhub_info;
+	const struct ssp_sensorhub_info *sensorhub_info;
 	struct timer_list wdt_timer;
 	struct work_struct work_wdt;
 	struct delayed_work work_refresh;
diff -u -p a/drivers/iio/common/ssp_sensors/ssp_dev.c b/drivers/iio/common/ssp_sensors/ssp_dev.c
--- a/drivers/iio/common/ssp_sensors/ssp_dev.c
+++ b/drivers/iio/common/ssp_sensors/ssp_dev.c
@@ -486,7 +486,7 @@ static struct ssp_data *ssp_parse_dt(str
 	if (!match)
 		goto err_mcu_reset_gpio;
 
-	data->sensorhub_info = (struct ssp_sensorhub_info *)match->data;
+	data->sensorhub_info = match->data;
 
 	dev_set_drvdata(dev, data);
 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 11/12] iio: common: ssp_sensors: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: kernel-janitors, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

Add const to the declaration of the location that receives a value
from the data field to ensure that the compiler will continue to check
that the value is not modified and remove the const-dropping cast on
the access to the data field.

Done using Coccinelle.

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

---
 drivers/iio/common/ssp_sensors/ssp.h     |    2 +-
 drivers/iio/common/ssp_sensors/ssp_dev.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/iio/common/ssp_sensors/ssp.h b/drivers/iio/common/ssp_sensors/ssp.h
--- a/drivers/iio/common/ssp_sensors/ssp.h
+++ b/drivers/iio/common/ssp_sensors/ssp.h
@@ -188,7 +188,7 @@ struct ssp_sensorhub_info {
  */
 struct ssp_data {
 	struct spi_device *spi;
-	struct ssp_sensorhub_info *sensorhub_info;
+	const struct ssp_sensorhub_info *sensorhub_info;
 	struct timer_list wdt_timer;
 	struct work_struct work_wdt;
 	struct delayed_work work_refresh;
diff -u -p a/drivers/iio/common/ssp_sensors/ssp_dev.c b/drivers/iio/common/ssp_sensors/ssp_dev.c
--- a/drivers/iio/common/ssp_sensors/ssp_dev.c
+++ b/drivers/iio/common/ssp_sensors/ssp_dev.c
@@ -486,7 +486,7 @@ static struct ssp_data *ssp_parse_dt(str
 	if (!match)
 		goto err_mcu_reset_gpio;
 
-	data->sensorhub_info = (struct ssp_sensorhub_info *)match->data;
+	data->sensorhub_info = match->data;
 
 	dev_set_drvdata(dev, data);
 


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 12/12] power: reset: account for const type of of_device_id.data
  2018-01-02 13:27 ` Julia Lawall
  (?)
@ 2018-01-02 13:28   ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: kernel-janitors, Sebastian Reichel, Alexandre Belloni, linux-pm,
	linux-arm-kernel, linux-kernel

This driver creates a const structure that it stores in the data
field of an of_device_id array.

Add const to the declaration of the location that receives a value
from the data field to ensure that the compiler will continue to check
that the value is not modified and remove the const-dropping cast on
the access to the data field.

Done using Coccinelle.

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

---
 drivers/power/reset/at91-sama5d2_shdwc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
--- a/drivers/power/reset/at91-sama5d2_shdwc.c
+++ b/drivers/power/reset/at91-sama5d2_shdwc.c
@@ -68,7 +68,7 @@ struct shdwc_config {
 };
 
 struct shdwc {
-	struct shdwc_config *cfg;
+	const struct shdwc_config *cfg;
 	void __iomem *at91_shdwc_base;
 };
 
@@ -260,7 +260,7 @@ static int __init at91_shdwc_probe(struc
 	}
 
 	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
-	at91_shdwc->cfg = (struct shdwc_config *)(match->data);
+	at91_shdwc->cfg = match->data;
 
 	sclk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(sclk))

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 12/12] power: reset: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a const structure that it stores in the data
field of an of_device_id array.

Add const to the declaration of the location that receives a value
from the data field to ensure that the compiler will continue to check
that the value is not modified and remove the const-dropping cast on
the access to the data field.

Done using Coccinelle.

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

---
 drivers/power/reset/at91-sama5d2_shdwc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
--- a/drivers/power/reset/at91-sama5d2_shdwc.c
+++ b/drivers/power/reset/at91-sama5d2_shdwc.c
@@ -68,7 +68,7 @@ struct shdwc_config {
 };
 
 struct shdwc {
-	struct shdwc_config *cfg;
+	const struct shdwc_config *cfg;
 	void __iomem *at91_shdwc_base;
 };
 
@@ -260,7 +260,7 @@ static int __init at91_shdwc_probe(struc
 	}
 
 	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
-	at91_shdwc->cfg = (struct shdwc_config *)(match->data);
+	at91_shdwc->cfg = match->data;
 
 	sclk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(sclk))


^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 12/12] power: reset: account for const type of of_device_id.data
@ 2018-01-02 13:28   ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-02 13:28 UTC (permalink / raw)
  To: linux-arm-kernel

This driver creates a const structure that it stores in the data
field of an of_device_id array.

Add const to the declaration of the location that receives a value
from the data field to ensure that the compiler will continue to check
that the value is not modified and remove the const-dropping cast on
the access to the data field.

Done using Coccinelle.

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

---
 drivers/power/reset/at91-sama5d2_shdwc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
--- a/drivers/power/reset/at91-sama5d2_shdwc.c
+++ b/drivers/power/reset/at91-sama5d2_shdwc.c
@@ -68,7 +68,7 @@ struct shdwc_config {
 };
 
 struct shdwc {
-	struct shdwc_config *cfg;
+	const struct shdwc_config *cfg;
 	void __iomem *at91_shdwc_base;
 };
 
@@ -260,7 +260,7 @@ static int __init at91_shdwc_probe(struc
 	}
 
 	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
-	at91_shdwc->cfg = (struct shdwc_config *)(match->data);
+	at91_shdwc->cfg = match->data;
 
 	sclk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(sclk))

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
  (?)
@ 2018-01-02 15:36     ` Gregory CLEMENT
  -1 siblings, 0 replies; 85+ messages in thread
From: Gregory CLEMENT @ 2018-01-02 15:36 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jason Cooper, Andrew Lunn, Linus Walleij, kernel-janitors,
	linux-kernel, linux-gpio, linux-arm-kernel,
	Sebastian Hesselbarth

Hi Julia,
 
 On mar., janv. 02 2018, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>


Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

Thanks,

Gregory


PS: actually the intent was not to do a const-discarding cast it was
just a useless cast! :)


>
> ---
>  drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff -u -p a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> @@ -1006,11 +1006,11 @@ static int armada_37xx_pinctrl_register(
>  static const struct of_device_id armada_37xx_pinctrl_of_match[] = {
>  	{
>  		.compatible = "marvell,armada3710-sb-pinctrl",
> -		.data = (void *)&armada_37xx_pin_sb,
> +		.data = &armada_37xx_pin_sb,
>  	},
>  	{
>  		.compatible = "marvell,armada3710-nb-pinctrl",
> -		.data = (void *)&armada_37xx_pin_nb,
> +		.data = &armada_37xx_pin_nb,
>  	},
>  	{ },
>  };
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
@ 2018-01-02 15:36     ` Gregory CLEMENT
  0 siblings, 0 replies; 85+ messages in thread
From: Gregory CLEMENT @ 2018-01-02 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia,
 
 On mar., janv. 02 2018, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>


Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

Thanks,

Gregory


PS: actually the intent was not to do a const-discarding cast it was
just a useless cast! :)


>
> ---
>  drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff -u -p a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> @@ -1006,11 +1006,11 @@ static int armada_37xx_pinctrl_register(
>  static const struct of_device_id armada_37xx_pinctrl_of_match[] = {
>  	{
>  		.compatible = "marvell,armada3710-sb-pinctrl",
> -		.data = (void *)&armada_37xx_pin_sb,
> +		.data = &armada_37xx_pin_sb,
>  	},
>  	{
>  		.compatible = "marvell,armada3710-nb-pinctrl",
> -		.data = (void *)&armada_37xx_pin_nb,
> +		.data = &armada_37xx_pin_nb,
>  	},
>  	{ },
>  };
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
@ 2018-01-02 15:36     ` Gregory CLEMENT
  0 siblings, 0 replies; 85+ messages in thread
From: Gregory CLEMENT @ 2018-01-02 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia,
 
 On mar., janv. 02 2018, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>


Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

Thanks,

Gregory


PS: actually the intent was not to do a const-discarding cast it was
just a useless cast! :)


>
> ---
>  drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff -u -p a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
> @@ -1006,11 +1006,11 @@ static int armada_37xx_pinctrl_register(
>  static const struct of_device_id armada_37xx_pinctrl_of_match[] = {
>  	{
>  		.compatible = "marvell,armada3710-sb-pinctrl",
> -		.data = (void *)&armada_37xx_pin_sb,
> +		.data = &armada_37xx_pin_sb,
>  	},
>  	{
>  		.compatible = "marvell,armada3710-nb-pinctrl",
> -		.data = (void *)&armada_37xx_pin_nb,
> +		.data = &armada_37xx_pin_nb,
>  	},
>  	{ },
>  };
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 02/12] pinctrl: at91-pio4: account for const type of of_device_id.data
  2018-01-02 13:27   ` Julia Lawall
  (?)
@ 2018-01-03  7:58     ` Linus Walleij
  -1 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  7:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Ludovic Desroches, kernel-janitors, Nicolas Ferre,
	Alexandre Belloni, Linux ARM, linux-gpio, linux-kernel

On Tue, Jan 2, 2018 at 2:27 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> This driver creates a const structure that it stores in the data field
> of an of_device_id array.
>
> Adding const to the declaration of the location that receives the
> const value from the data field ensures that the compiler will
> continue to check that the value is not modified.  Furthermore, the
> const-discarding cast on the extraction from the data field is no
> longer needed.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 02/12] pinctrl: at91-pio4: account for const type of of_device_id.data
@ 2018-01-03  7:58     ` Linus Walleij
  0 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 2, 2018 at 2:27 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> This driver creates a const structure that it stores in the data field
> of an of_device_id array.
>
> Adding const to the declaration of the location that receives the
> const value from the data field ensures that the compiler will
> continue to check that the value is not modified.  Furthermore, the
> const-discarding cast on the extraction from the data field is no
> longer needed.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 02/12] pinctrl: at91-pio4: account for const type of of_device_id.data
@ 2018-01-03  7:58     ` Linus Walleij
  0 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 2, 2018 at 2:27 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> This driver creates a const structure that it stores in the data field
> of an of_device_id array.
>
> Adding const to the declaration of the location that receives the
> const value from the data field ensures that the compiler will
> continue to check that the value is not modified.  Furthermore, the
> const-discarding cast on the extraction from the data field is no
> longer needed.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 08/12] pinctrl: axp209: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
@ 2018-01-03  7:59     ` Linus Walleij
  -1 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  7:59 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Chen-Yu Tsai, linux-gpio, linux-kernel

On Tue, Jan 2, 2018 at 2:28 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The return value of of_device_get_match_data has type const void *.
> The desc field of the pctl structure also has a const type, so there
> is no need for the const-discarding cast between them.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 08/12] pinctrl: axp209: account for const type of of_device_id.data
@ 2018-01-03  7:59     ` Linus Walleij
  0 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  7:59 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Chen-Yu Tsai, linux-gpio, linux-kernel

On Tue, Jan 2, 2018 at 2:28 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The return value of of_device_get_match_data has type const void *.
> The desc field of the pctl structure also has a const type, so there
> is no need for the const-discarding cast between them.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
  (?)
@ 2018-01-03  8:03     ` Linus Walleij
  -1 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  8:03 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jason Cooper, kernel-janitors, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Linux ARM, linux-gpio, linux-kernel

On Tue, Jan 2, 2018 at 2:28 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied with Gregory's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
@ 2018-01-03  8:03     ` Linus Walleij
  0 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  8:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 2, 2018 at 2:28 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied with Gregory's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 05/12] pinctrl: armada-37xx: account for const type of of_device_id.data
@ 2018-01-03  8:03     ` Linus Walleij
  0 siblings, 0 replies; 85+ messages in thread
From: Linus Walleij @ 2018-01-03  8:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 2, 2018 at 2:28 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
>
> Done using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied with Gregory's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Applied "spi: sirf: account for const type of of_device_id.data" to the spi tree
  2018-01-02 13:27   ` Julia Lawall
  (?)
@ 2018-01-03 12:15     ` Mark Brown
  -1 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:15 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mark Brown, Mark Brown, kernel-janitors, Barry Song, linux-spi,
	linux-arm-kernel, linux-kernel, linux-spi

The patch

   spi: sirf: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 9e327ce71f3894e7e6b57f5c15a0dfa5be79f44e Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:27:59 +0100
Subject: [PATCH] spi: sirf: account for const type of of_device_id.data

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index bbb1a275f718..f009d76f96b1 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Applied "spi: sirf: account for const type of of_device_id.data" to the spi tree
@ 2018-01-03 12:15     ` Mark Brown
  0 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: sirf: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 9e327ce71f3894e7e6b57f5c15a0dfa5be79f44e Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:27:59 +0100
Subject: [PATCH] spi: sirf: account for const type of of_device_id.data

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index bbb1a275f718..f009d76f96b1 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Applied "spi: sirf: account for const type of of_device_id.data" to the spi tree
@ 2018-01-03 12:15     ` Mark Brown
  0 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: sirf: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 9e327ce71f3894e7e6b57f5c15a0dfa5be79f44e Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:27:59 +0100
Subject: [PATCH] spi: sirf: account for const type of of_device_id.data

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index bbb1a275f718..f009d76f96b1 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
@ 2018-01-03 12:22     ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 85+ messages in thread
From: Lorenzo Pieralisi @ 2018-01-03 12:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Stanimir Varbanov, kernel-janitors, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel

On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
> This driver creates various const structures that it stores in the
> data field of an of_device_id array.
> 
> Adding const to the declaration of the location that receives the
> const value from the data field ensures that the compiler will
> continue to check that the value is not modified.  Furthermore, the
> const-discarding cast on the extraction from the data field is no
> longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/pci/dwc/pcie-qcom.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Hi Julia,

I am happy to take this patch through the PCI tree unless you see a
problem with that, please let me know.

Thanks,
Lorenzo

> diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> --- a/drivers/pci/dwc/pcie-qcom.c
> +++ b/drivers/pci/dwc/pcie-qcom.c
> @@ -171,7 +171,7 @@ struct qcom_pcie {
>  	union qcom_pcie_resources res;
>  	struct phy *phy;
>  	struct gpio_desc *reset;
> -	struct qcom_pcie_ops *ops;
> +	const struct qcom_pcie_ops *ops;
>  };
>  
>  #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
> @@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
>  
>  	pcie->pci = pci;
>  
> -	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
> +	pcie->ops = of_device_get_match_data(dev);
>  
>  	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
>  	if (IS_ERR(pcie->reset))
> 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
@ 2018-01-03 12:22     ` Lorenzo Pieralisi
  0 siblings, 0 replies; 85+ messages in thread
From: Lorenzo Pieralisi @ 2018-01-03 12:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Stanimir Varbanov, kernel-janitors, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel

On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
> This driver creates various const structures that it stores in the
> data field of an of_device_id array.
> 
> Adding const to the declaration of the location that receives the
> const value from the data field ensures that the compiler will
> continue to check that the value is not modified.  Furthermore, the
> const-discarding cast on the extraction from the data field is no
> longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/pci/dwc/pcie-qcom.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Hi Julia,

I am happy to take this patch through the PCI tree unless you see a
problem with that, please let me know.

Thanks,
Lorenzo

> diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> --- a/drivers/pci/dwc/pcie-qcom.c
> +++ b/drivers/pci/dwc/pcie-qcom.c
> @@ -171,7 +171,7 @@ struct qcom_pcie {
>  	union qcom_pcie_resources res;
>  	struct phy *phy;
>  	struct gpio_desc *reset;
> -	struct qcom_pcie_ops *ops;
> +	const struct qcom_pcie_ops *ops;
>  };
>  
>  #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
> @@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
>  
>  	pcie->pci = pci;
>  
> -	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
> +	pcie->ops = of_device_get_match_data(dev);
>  
>  	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
>  	if (IS_ERR(pcie->reset))
> 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Applied "spi: spi-fsl-dspi: account for const type of of_device_id.data" to the spi tree
@ 2018-01-03 12:22     ` Mark Brown
  0 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mark Brown, Mark Brown, kernel-janitors, linux-spi, linux-kernel,
	linux-spi

The patch

   spi: spi-fsl-dspi: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 230c08b2acf65863ac5905ea1fa93106bdd20af3 Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:28:06 +0100
Subject: [PATCH] spi: spi-fsl-dspi: account for const type of
 of_device_id.data

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-fsl-dspi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 02d3ed7f2558..0630962ce442 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -903,10 +903,9 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
 }
 
 static const struct of_device_id fsl_dspi_dt_ids[] = {
-	{ .compatible = "fsl,vf610-dspi", .data = (void *)&vf610_data, },
-	{ .compatible = "fsl,ls1021a-v1.0-dspi",
-		.data = (void *)&ls1021a_v1_data, },
-	{ .compatible = "fsl,ls2085a-dspi", .data = (void *)&ls2085a_data, },
+	{ .compatible = "fsl,vf610-dspi", .data = &vf610_data, },
+	{ .compatible = "fsl,ls1021a-v1.0-dspi", .data = &ls1021a_v1_data, },
+	{ .compatible = "fsl,ls2085a-dspi", .data = &ls2085a_data, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fsl_dspi_dt_ids);
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Applied "spi: spi-fsl-dspi: account for const type of of_device_id.data" to the spi tree
@ 2018-01-03 12:22     ` Mark Brown
  0 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:22 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Mark Brown

The patch

   spi: spi-fsl-dspi: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 230c08b2acf65863ac5905ea1fa93106bdd20af3 Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:28:06 +0100
Subject: [PATCH] spi: spi-fsl-dspi: account for const type of
 of_device_id.data

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-fsl-dspi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 02d3ed7f2558..0630962ce442 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -903,10 +903,9 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
 }
 
 static const struct of_device_id fsl_dspi_dt_ids[] = {
-	{ .compatible = "fsl,vf610-dspi", .data = (void *)&vf610_data, },
-	{ .compatible = "fsl,ls1021a-v1.0-dspi",
-		.data = (void *)&ls1021a_v1_data, },
-	{ .compatible = "fsl,ls2085a-dspi", .data = (void *)&ls2085a_data, },
+	{ .compatible = "fsl,vf610-dspi", .data = &vf610_data, },
+	{ .compatible = "fsl,ls1021a-v1.0-dspi", .data = &ls1021a_v1_data, },
+	{ .compatible = "fsl,ls2085a-dspi", .data = &ls2085a_data, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fsl_dspi_dt_ids);
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Applied "spi: spi-fsl-dspi: account for const type of of_device_id.data" to the spi tree
@ 2018-01-03 12:22     ` Mark Brown
  0 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mark Brown, Mark Brown, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-spi-u79uwXL29TY76Z2rM5mHXA

The patch

   spi: spi-fsl-dspi: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 230c08b2acf65863ac5905ea1fa93106bdd20af3 Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
Date: Tue, 2 Jan 2018 14:28:06 +0100
Subject: [PATCH] spi: spi-fsl-dspi: account for const type of
 of_device_id.data

This driver creates a number of const structures that it stores in the
data field of an of_device_id array.

The data field of an of_device_id structure has type const void *, so
there is no need for a const-discarding cast when putting const values
into such a structure.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/spi/spi-fsl-dspi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 02d3ed7f2558..0630962ce442 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -903,10 +903,9 @@ static irqreturn_t dspi_interrupt(int irq, void *dev_id)
 }
 
 static const struct of_device_id fsl_dspi_dt_ids[] = {
-	{ .compatible = "fsl,vf610-dspi", .data = (void *)&vf610_data, },
-	{ .compatible = "fsl,ls1021a-v1.0-dspi",
-		.data = (void *)&ls1021a_v1_data, },
-	{ .compatible = "fsl,ls2085a-dspi", .data = (void *)&ls2085a_data, },
+	{ .compatible = "fsl,vf610-dspi", .data = &vf610_data, },
+	{ .compatible = "fsl,ls1021a-v1.0-dspi", .data = &ls1021a_v1_data, },
+	{ .compatible = "fsl,ls2085a-dspi", .data = &ls2085a_data, },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fsl_dspi_dt_ids);
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Applied "spi: sirf: account for const type of of_device_id.data" to the spi tree
  2018-01-02 13:27   ` Julia Lawall
  (?)
@ 2018-01-03 12:22     ` Mark Brown
  -1 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Mark Brown, Mark Brown, kernel-janitors, Barry Song, linux-spi,
	linux-arm-kernel, linux-kernel, linux-spi

The patch

   spi: sirf: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 9e327ce71f3894e7e6b57f5c15a0dfa5be79f44e Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:27:59 +0100
Subject: [PATCH] spi: sirf: account for const type of of_device_id.data

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index bbb1a275f718..f009d76f96b1 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Applied "spi: sirf: account for const type of of_device_id.data" to the spi tree
@ 2018-01-03 12:22     ` Mark Brown
  0 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:22 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: sirf: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 9e327ce71f3894e7e6b57f5c15a0dfa5be79f44e Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:27:59 +0100
Subject: [PATCH] spi: sirf: account for const type of of_device_id.data

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index bbb1a275f718..f009d76f96b1 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;
-- 
2.15.1


^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Applied "spi: sirf: account for const type of of_device_id.data" to the spi tree
@ 2018-01-03 12:22     ` Mark Brown
  0 siblings, 0 replies; 85+ messages in thread
From: Mark Brown @ 2018-01-03 12:22 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   spi: sirf: account for const type of of_device_id.data

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.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 9e327ce71f3894e7e6b57f5c15a0dfa5be79f44e Mon Sep 17 00:00:00 2001
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Tue, 2 Jan 2018 14:27:59 +0100
Subject: [PATCH] spi: sirf: account for const type of of_device_id.data

This driver creates various const structures that it stores in the
data field of an of_device_id array.

Adding const to the declaration of the location that receives the
const value from the data field ensures that the compiler will
continue to check that the value is not modified.  Furthermore, the
const-discarding cast on the extraction from the data field is no
longer needed.

Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-sirf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index bbb1a275f718..f009d76f96b1 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -1072,7 +1072,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	struct sirfsoc_spi *sspi;
 	struct spi_master *master;
 	struct resource *mem_res;
-	struct sirf_spi_comp_data *spi_comp_data;
+	const struct sirf_spi_comp_data *spi_comp_data;
 	int irq;
 	int ret;
 	const struct of_device_id *match;
@@ -1092,7 +1092,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 	sspi->fifo_full_offset = ilog2(sspi->fifo_size);
-	spi_comp_data = (struct sirf_spi_comp_data *)match->data;
+	spi_comp_data = match->data;
 	sspi->regs = spi_comp_data->regs;
 	sspi->type = spi_comp_data->type;
 	sspi->fifo_level_chk_mask = (sspi->fifo_size / 4) - 1;
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
  2018-01-03 12:22     ` Lorenzo Pieralisi
@ 2018-01-03 12:38       ` Stanimir Varbanov
  -1 siblings, 0 replies; 85+ messages in thread
From: Stanimir Varbanov @ 2018-01-03 12:38 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, linux-pci, linux-arm-msm, linux-kernel

Hi Lorenzo,

On 01/03/2018 02:22 PM, Lorenzo Pieralisi wrote:
> On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
>> This driver creates various const structures that it stores in the
>> data field of an of_device_id array.
>>
>> Adding const to the declaration of the location that receives the
>> const value from the data field ensures that the compiler will
>> continue to check that the value is not modified.  Furthermore, the
>> const-discarding cast on the extraction from the data field is no
>> longer needed.
>>
>> Done using Coccinelle.
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>>
>> ---
>>  drivers/pci/dwc/pcie-qcom.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Hi Julia,

Probably that is addressed to me :)

> 
> I am happy to take this patch through the PCI tree unless you see a
> problem with that, please let me know.

The patch looks fine.

Acked-by: Stanimir Varbanov <svarbanov@mm-sol.com>

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
@ 2018-01-03 12:38       ` Stanimir Varbanov
  0 siblings, 0 replies; 85+ messages in thread
From: Stanimir Varbanov @ 2018-01-03 12:38 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Julia Lawall
  Cc: kernel-janitors, Bjorn Helgaas, linux-pci, linux-arm-msm, linux-kernel

Hi Lorenzo,

On 01/03/2018 02:22 PM, Lorenzo Pieralisi wrote:
> On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
>> This driver creates various const structures that it stores in the
>> data field of an of_device_id array.
>>
>> Adding const to the declaration of the location that receives the
>> const value from the data field ensures that the compiler will
>> continue to check that the value is not modified.  Furthermore, the
>> const-discarding cast on the extraction from the data field is no
>> longer needed.
>>
>> Done using Coccinelle.
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>>
>> ---
>>  drivers/pci/dwc/pcie-qcom.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Hi Julia,

Probably that is addressed to me :)

> 
> I am happy to take this patch through the PCI tree unless you see a
> problem with that, please let me know.

The patch looks fine.

Acked-by: Stanimir Varbanov <svarbanov@mm-sol.com>

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
  2018-01-03 12:22     ` Lorenzo Pieralisi
@ 2018-01-03 12:38       ` Julia Lawall
  -1 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-03 12:38 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Stanimir Varbanov, kernel-janitors, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel



On Wed, 3 Jan 2018, Lorenzo Pieralisi wrote:

> On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
> > This driver creates various const structures that it stores in the
> > data field of an of_device_id array.
> >
> > Adding const to the declaration of the location that receives the
> > const value from the data field ensures that the compiler will
> > continue to check that the value is not modified.  Furthermore, the
> > const-discarding cast on the extraction from the data field is no
> > longer needed.
> >
> > Done using Coccinelle.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> >  drivers/pci/dwc/pcie-qcom.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Hi Julia,
>
> I am happy to take this patch through the PCI tree unless you see a
> problem with that, please let me know.

Please take it.  Thanks.

julia

>
> Thanks,
> Lorenzo
>
> > diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> > --- a/drivers/pci/dwc/pcie-qcom.c
> > +++ b/drivers/pci/dwc/pcie-qcom.c
> > @@ -171,7 +171,7 @@ struct qcom_pcie {
> >  	union qcom_pcie_resources res;
> >  	struct phy *phy;
> >  	struct gpio_desc *reset;
> > -	struct qcom_pcie_ops *ops;
> > +	const struct qcom_pcie_ops *ops;
> >  };
> >
> >  #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
> > @@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
> >
> >  	pcie->pci = pci;
> >
> > -	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
> > +	pcie->ops = of_device_get_match_data(dev);
> >
> >  	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
> >  	if (IS_ERR(pcie->reset))
> >
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
@ 2018-01-03 12:38       ` Julia Lawall
  0 siblings, 0 replies; 85+ messages in thread
From: Julia Lawall @ 2018-01-03 12:38 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Stanimir Varbanov, kernel-janitors, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel



On Wed, 3 Jan 2018, Lorenzo Pieralisi wrote:

> On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
> > This driver creates various const structures that it stores in the
> > data field of an of_device_id array.
> >
> > Adding const to the declaration of the location that receives the
> > const value from the data field ensures that the compiler will
> > continue to check that the value is not modified.  Furthermore, the
> > const-discarding cast on the extraction from the data field is no
> > longer needed.
> >
> > Done using Coccinelle.
> >
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> >  drivers/pci/dwc/pcie-qcom.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> Hi Julia,
>
> I am happy to take this patch through the PCI tree unless you see a
> problem with that, please let me know.

Please take it.  Thanks.

julia

>
> Thanks,
> Lorenzo
>
> > diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> > --- a/drivers/pci/dwc/pcie-qcom.c
> > +++ b/drivers/pci/dwc/pcie-qcom.c
> > @@ -171,7 +171,7 @@ struct qcom_pcie {
> >  	union qcom_pcie_resources res;
> >  	struct phy *phy;
> >  	struct gpio_desc *reset;
> > -	struct qcom_pcie_ops *ops;
> > +	const struct qcom_pcie_ops *ops;
> >  };
> >
> >  #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
> > @@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
> >
> >  	pcie->pci = pci;
> >
> > -	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
> > +	pcie->ops = of_device_get_match_data(dev);
> >
> >  	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
> >  	if (IS_ERR(pcie->reset))
> >
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
  2018-01-03 12:38       ` Julia Lawall
@ 2018-01-03 18:23         ` Lorenzo Pieralisi
  -1 siblings, 0 replies; 85+ messages in thread
From: Lorenzo Pieralisi @ 2018-01-03 18:23 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Stanimir Varbanov, kernel-janitors, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel

On Wed, Jan 03, 2018 at 01:38:27PM +0100, Julia Lawall wrote:
> 
> 
> On Wed, 3 Jan 2018, Lorenzo Pieralisi wrote:
> 
> > On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
> > > This driver creates various const structures that it stores in the
> > > data field of an of_device_id array.
> > >
> > > Adding const to the declaration of the location that receives the
> > > const value from the data field ensures that the compiler will
> > > continue to check that the value is not modified.  Furthermore, the
> > > const-discarding cast on the extraction from the data field is no
> > > longer needed.
> > >
> > > Done using Coccinelle.
> > >
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > >
> > > ---
> > >  drivers/pci/dwc/pcie-qcom.c |    4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Hi Julia,
> >
> > I am happy to take this patch through the PCI tree unless you see a
> > problem with that, please let me know.
> 
> Please take it.  Thanks.

Applied to pci/dwc for v4.16, thanks.

Lorenzo

> julia
> 
> >
> > Thanks,
> > Lorenzo
> >
> > > diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> > > --- a/drivers/pci/dwc/pcie-qcom.c
> > > +++ b/drivers/pci/dwc/pcie-qcom.c
> > > @@ -171,7 +171,7 @@ struct qcom_pcie {
> > >  	union qcom_pcie_resources res;
> > >  	struct phy *phy;
> > >  	struct gpio_desc *reset;
> > > -	struct qcom_pcie_ops *ops;
> > > +	const struct qcom_pcie_ops *ops;
> > >  };
> > >
> > >  #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
> > > @@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
> > >
> > >  	pcie->pci = pci;
> > >
> > > -	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
> > > +	pcie->ops = of_device_get_match_data(dev);
> > >
> > >  	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
> > >  	if (IS_ERR(pcie->reset))
> > >
> > --
> > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data
@ 2018-01-03 18:23         ` Lorenzo Pieralisi
  0 siblings, 0 replies; 85+ messages in thread
From: Lorenzo Pieralisi @ 2018-01-03 18:23 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Stanimir Varbanov, kernel-janitors, Bjorn Helgaas, linux-pci,
	linux-arm-msm, linux-kernel

On Wed, Jan 03, 2018 at 01:38:27PM +0100, Julia Lawall wrote:
> 
> 
> On Wed, 3 Jan 2018, Lorenzo Pieralisi wrote:
> 
> > On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote:
> > > This driver creates various const structures that it stores in the
> > > data field of an of_device_id array.
> > >
> > > Adding const to the declaration of the location that receives the
> > > const value from the data field ensures that the compiler will
> > > continue to check that the value is not modified.  Furthermore, the
> > > const-discarding cast on the extraction from the data field is no
> > > longer needed.
> > >
> > > Done using Coccinelle.
> > >
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > >
> > > ---
> > >  drivers/pci/dwc/pcie-qcom.c |    4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Hi Julia,
> >
> > I am happy to take this patch through the PCI tree unless you see a
> > problem with that, please let me know.
> 
> Please take it.  Thanks.

Applied to pci/dwc for v4.16, thanks.

Lorenzo

> julia
> 
> >
> > Thanks,
> > Lorenzo
> >
> > > diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> > > --- a/drivers/pci/dwc/pcie-qcom.c
> > > +++ b/drivers/pci/dwc/pcie-qcom.c
> > > @@ -171,7 +171,7 @@ struct qcom_pcie {
> > >  	union qcom_pcie_resources res;
> > >  	struct phy *phy;
> > >  	struct gpio_desc *reset;
> > > -	struct qcom_pcie_ops *ops;
> > > +	const struct qcom_pcie_ops *ops;
> > >  };
> > >
> > >  #define to_qcom_pcie(x)		dev_get_drvdata((x)->dev)
> > > @@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo
> > >
> > >  	pcie->pci = pci;
> > >
> > > -	pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev);
> > > +	pcie->ops = of_device_get_match_data(dev);
> > >
> > >  	pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW);
> > >  	if (IS_ERR(pcie->reset))
> > >
> > --
> > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 12/12] power: reset: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
  (?)
@ 2018-01-05 13:24     ` Alexandre Belloni
  -1 siblings, 0 replies; 85+ messages in thread
From: Alexandre Belloni @ 2018-01-05 13:24 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Nicolas Ferre, kernel-janitors, Sebastian Reichel, linux-pm,
	linux-arm-kernel, linux-kernel

On 02/01/2018 at 14:28:08 +0100, Julia Lawall wrote:
> This driver creates a const structure that it stores in the data
> field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 12/12] power: reset: account for const type of of_device_id.data
@ 2018-01-05 13:24     ` Alexandre Belloni
  0 siblings, 0 replies; 85+ messages in thread
From: Alexandre Belloni @ 2018-01-05 13:24 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/01/2018 at 14:28:08 +0100, Julia Lawall wrote:
> This driver creates a const structure that it stores in the data
> field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 12/12] power: reset: account for const type of of_device_id.data
@ 2018-01-05 13:24     ` Alexandre Belloni
  0 siblings, 0 replies; 85+ messages in thread
From: Alexandre Belloni @ 2018-01-05 13:24 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/01/2018 at 14:28:08 +0100, Julia Lawall wrote:
> This driver creates a const structure that it stores in the data
> field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 11/12] iio: common: ssp_sensors: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
@ 2018-01-06 12:23     ` Jonathan Cameron
  -1 siblings, 0 replies; 85+ messages in thread
From: Jonathan Cameron @ 2018-01-06 12:23 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

On Tue,  2 Jan 2018 14:28:07 +0100
Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> This driver creates a number of const structures that it stores in the
> data field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Thanks. Applied to the togreg branch of iio.git and pushed out
as testing for the autobuilders to play with it.

Jonathan

> 
> ---
>  drivers/iio/common/ssp_sensors/ssp.h     |    2 +-
>  drivers/iio/common/ssp_sensors/ssp_dev.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff -u -p a/drivers/iio/common/ssp_sensors/ssp.h b/drivers/iio/common/ssp_sensors/ssp.h
> --- a/drivers/iio/common/ssp_sensors/ssp.h
> +++ b/drivers/iio/common/ssp_sensors/ssp.h
> @@ -188,7 +188,7 @@ struct ssp_sensorhub_info {
>   */
>  struct ssp_data {
>  	struct spi_device *spi;
> -	struct ssp_sensorhub_info *sensorhub_info;
> +	const struct ssp_sensorhub_info *sensorhub_info;
>  	struct timer_list wdt_timer;
>  	struct work_struct work_wdt;
>  	struct delayed_work work_refresh;
> diff -u -p a/drivers/iio/common/ssp_sensors/ssp_dev.c b/drivers/iio/common/ssp_sensors/ssp_dev.c
> --- a/drivers/iio/common/ssp_sensors/ssp_dev.c
> +++ b/drivers/iio/common/ssp_sensors/ssp_dev.c
> @@ -486,7 +486,7 @@ static struct ssp_data *ssp_parse_dt(str
>  	if (!match)
>  		goto err_mcu_reset_gpio;
>  
> -	data->sensorhub_info = (struct ssp_sensorhub_info *)match->data;
> +	data->sensorhub_info = match->data;
>  
>  	dev_set_drvdata(dev, data);
>  
> 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 11/12] iio: common: ssp_sensors: account for const type of of_device_id.data
@ 2018-01-06 12:23     ` Jonathan Cameron
  0 siblings, 0 replies; 85+ messages in thread
From: Jonathan Cameron @ 2018-01-06 12:23 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel

On Tue,  2 Jan 2018 14:28:07 +0100
Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> This driver creates a number of const structures that it stores in the
> data field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Thanks. Applied to the togreg branch of iio.git and pushed out
as testing for the autobuilders to play with it.

Jonathan

> 
> ---
>  drivers/iio/common/ssp_sensors/ssp.h     |    2 +-
>  drivers/iio/common/ssp_sensors/ssp_dev.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff -u -p a/drivers/iio/common/ssp_sensors/ssp.h b/drivers/iio/common/ssp_sensors/ssp.h
> --- a/drivers/iio/common/ssp_sensors/ssp.h
> +++ b/drivers/iio/common/ssp_sensors/ssp.h
> @@ -188,7 +188,7 @@ struct ssp_sensorhub_info {
>   */
>  struct ssp_data {
>  	struct spi_device *spi;
> -	struct ssp_sensorhub_info *sensorhub_info;
> +	const struct ssp_sensorhub_info *sensorhub_info;
>  	struct timer_list wdt_timer;
>  	struct work_struct work_wdt;
>  	struct delayed_work work_refresh;
> diff -u -p a/drivers/iio/common/ssp_sensors/ssp_dev.c b/drivers/iio/common/ssp_sensors/ssp_dev.c
> --- a/drivers/iio/common/ssp_sensors/ssp_dev.c
> +++ b/drivers/iio/common/ssp_sensors/ssp_dev.c
> @@ -486,7 +486,7 @@ static struct ssp_data *ssp_parse_dt(str
>  	if (!match)
>  		goto err_mcu_reset_gpio;
>  
> -	data->sensorhub_info = (struct ssp_sensorhub_info *)match->data;
> +	data->sensorhub_info = match->data;
>  
>  	dev_set_drvdata(dev, data);
>  
> 


^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 09/12] mtd: fsl-quadspi: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
@ 2018-01-07 18:08     ` Cyrille Pitchen
  -1 siblings, 0 replies; 85+ messages in thread
From: Cyrille Pitchen @ 2018-01-07 18:08 UTC (permalink / raw)
  To: Julia Lawall, Han Xu
  Cc: kernel-janitors, Marek Vasut, David Woodhouse, Brian Norris,
	Boris Brezillon, Richard Weinberger, linux-mtd, linux-kernel

Le 02/01/2018 à 14:28, Julia Lawall a écrit :
> This driver creates a number of const structures that it stores in the
> data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Applied to the spi-nor/next branch of linux-mtd

Thanks!

> ---
>  drivers/mtd/spi-nor/fsl-quadspi.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff -u -p a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
> --- a/drivers/mtd/spi-nor/fsl-quadspi.c
> +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
> @@ -801,10 +801,10 @@ static int fsl_qspi_nor_setup_last(struc
>  }
>  
>  static const struct of_device_id fsl_qspi_dt_ids[] = {
> -	{ .compatible = "fsl,vf610-qspi", .data = (void *)&vybrid_data, },
> -	{ .compatible = "fsl,imx6sx-qspi", .data = (void *)&imx6sx_data, },
> -	{ .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, },
> -	{ .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, },
> +	{ .compatible = "fsl,vf610-qspi", .data = &vybrid_data, },
> +	{ .compatible = "fsl,imx6sx-qspi", .data = &imx6sx_data, },
> +	{ .compatible = "fsl,imx7d-qspi", .data = &imx7d_data, },
> +	{ .compatible = "fsl,imx6ul-qspi", .data = &imx6ul_data, },
>  	{ .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, },
>  	{ /* sentinel */ }
>  };
> 
> 

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 09/12] mtd: fsl-quadspi: account for const type of of_device_id.data
@ 2018-01-07 18:08     ` Cyrille Pitchen
  0 siblings, 0 replies; 85+ messages in thread
From: Cyrille Pitchen @ 2018-01-07 18:08 UTC (permalink / raw)
  To: Julia Lawall, Han Xu
  Cc: kernel-janitors, Marek Vasut, David Woodhouse, Brian Norris,
	Boris Brezillon, Richard Weinberger, linux-mtd, linux-kernel

Le 02/01/2018 à 14:28, Julia Lawall a écrit :
> This driver creates a number of const structures that it stores in the
> data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Applied to the spi-nor/next branch of linux-mtd

Thanks!

> ---
>  drivers/mtd/spi-nor/fsl-quadspi.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff -u -p a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
> --- a/drivers/mtd/spi-nor/fsl-quadspi.c
> +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
> @@ -801,10 +801,10 @@ static int fsl_qspi_nor_setup_last(struc
>  }
>  
>  static const struct of_device_id fsl_qspi_dt_ids[] = {
> -	{ .compatible = "fsl,vf610-qspi", .data = (void *)&vybrid_data, },
> -	{ .compatible = "fsl,imx6sx-qspi", .data = (void *)&imx6sx_data, },
> -	{ .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, },
> -	{ .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, },
> +	{ .compatible = "fsl,vf610-qspi", .data = &vybrid_data, },
> +	{ .compatible = "fsl,imx6sx-qspi", .data = &imx6sx_data, },
> +	{ .compatible = "fsl,imx7d-qspi", .data = &imx7d_data, },
> +	{ .compatible = "fsl,imx6ul-qspi", .data = &imx6ul_data, },
>  	{ .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, },
>  	{ /* sentinel */ }
>  };
> 
> 


^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 06/12] power: supply: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
@ 2018-01-09 16:22     ` Sebastian Reichel
  -1 siblings, 0 replies; 85+ messages in thread
From: Sebastian Reichel @ 2018-01-09 16:22 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Chen-Yu Tsai, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2302 bytes --]

Hi,

On Tue, Jan 02, 2018 at 02:28:02PM +0100, Julia Lawall wrote:
> This driver creates two const structures that it stores in the data
> field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/axp20x_ac_power.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff -u -p a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c
> --- a/drivers/power/supply/axp20x_ac_power.c
> +++ b/drivers/power/supply/axp20x_ac_power.c
> @@ -159,7 +159,7 @@ static int axp20x_ac_power_probe(struct
>  	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
>  	struct power_supply_config psy_cfg = {};
>  	struct axp20x_ac_power *power;
> -	struct axp_data *axp_data;
> +	const struct axp_data *axp_data;
>  	static const char * const irq_names[] = { "ACIN_PLUGIN", "ACIN_REMOVAL",
>  		NULL };
>  	int i, irq, ret;
> @@ -176,7 +176,7 @@ static int axp20x_ac_power_probe(struct
>  	if (!power)
>  		return -ENOMEM;
>  
> -	axp_data = (struct axp_data *)of_device_get_match_data(&pdev->dev);
> +	axp_data = of_device_get_match_data(&pdev->dev);
>  
>  	if (axp_data->acin_adc) {
>  		power->acin_v = devm_iio_channel_get(&pdev->dev, "acin_v");
> @@ -230,10 +230,10 @@ static int axp20x_ac_power_probe(struct
>  static const struct of_device_id axp20x_ac_power_match[] = {
>  	{
>  		.compatible = "x-powers,axp202-ac-power-supply",
> -		.data = (void *)&axp20x_data,
> +		.data = &axp20x_data,
>  	}, {
>  		.compatible = "x-powers,axp221-ac-power-supply",
> -		.data = (void *)&axp22x_data,
> +		.data = &axp22x_data,
>  	}, { /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, axp20x_ac_power_match);
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 06/12] power: supply: account for const type of of_device_id.data
@ 2018-01-09 16:22     ` Sebastian Reichel
  0 siblings, 0 replies; 85+ messages in thread
From: Sebastian Reichel @ 2018-01-09 16:22 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Chen-Yu Tsai, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2302 bytes --]

Hi,

On Tue, Jan 02, 2018 at 02:28:02PM +0100, Julia Lawall wrote:
> This driver creates two const structures that it stores in the data
> field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/axp20x_ac_power.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff -u -p a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c
> --- a/drivers/power/supply/axp20x_ac_power.c
> +++ b/drivers/power/supply/axp20x_ac_power.c
> @@ -159,7 +159,7 @@ static int axp20x_ac_power_probe(struct
>  	struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent);
>  	struct power_supply_config psy_cfg = {};
>  	struct axp20x_ac_power *power;
> -	struct axp_data *axp_data;
> +	const struct axp_data *axp_data;
>  	static const char * const irq_names[] = { "ACIN_PLUGIN", "ACIN_REMOVAL",
>  		NULL };
>  	int i, irq, ret;
> @@ -176,7 +176,7 @@ static int axp20x_ac_power_probe(struct
>  	if (!power)
>  		return -ENOMEM;
>  
> -	axp_data = (struct axp_data *)of_device_get_match_data(&pdev->dev);
> +	axp_data = of_device_get_match_data(&pdev->dev);
>  
>  	if (axp_data->acin_adc) {
>  		power->acin_v = devm_iio_channel_get(&pdev->dev, "acin_v");
> @@ -230,10 +230,10 @@ static int axp20x_ac_power_probe(struct
>  static const struct of_device_id axp20x_ac_power_match[] = {
>  	{
>  		.compatible = "x-powers,axp202-ac-power-supply",
> -		.data = (void *)&axp20x_data,
> +		.data = &axp20x_data,
>  	}, {
>  		.compatible = "x-powers,axp221-ac-power-supply",
> -		.data = (void *)&axp22x_data,
> +		.data = &axp22x_data,
>  	}, { /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, axp20x_ac_power_match);
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 12/12] power: reset: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
  (?)
@ 2018-01-09 16:22     ` Sebastian Reichel
  -1 siblings, 0 replies; 85+ messages in thread
From: Sebastian Reichel @ 2018-01-09 16:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Nicolas Ferre, kernel-janitors, Alexandre Belloni, linux-pm,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

Hi,

On Tue, Jan 02, 2018 at 02:28:08PM +0100, Julia Lawall wrote:
> This driver creates a const structure that it stores in the data
> field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/reset/at91-sama5d2_shdwc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -u -p a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
> --- a/drivers/power/reset/at91-sama5d2_shdwc.c
> +++ b/drivers/power/reset/at91-sama5d2_shdwc.c
> @@ -68,7 +68,7 @@ struct shdwc_config {
>  };
>  
>  struct shdwc {
> -	struct shdwc_config *cfg;
> +	const struct shdwc_config *cfg;
>  	void __iomem *at91_shdwc_base;
>  };
>  
> @@ -260,7 +260,7 @@ static int __init at91_shdwc_probe(struc
>  	}
>  
>  	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
> -	at91_shdwc->cfg = (struct shdwc_config *)(match->data);
> +	at91_shdwc->cfg = match->data;
>  
>  	sclk = devm_clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(sclk))
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 12/12] power: reset: account for const type of of_device_id.data
@ 2018-01-09 16:22     ` Sebastian Reichel
  0 siblings, 0 replies; 85+ messages in thread
From: Sebastian Reichel @ 2018-01-09 16:22 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]

Hi,

On Tue, Jan 02, 2018 at 02:28:08PM +0100, Julia Lawall wrote:
> This driver creates a const structure that it stores in the data
> field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/reset/at91-sama5d2_shdwc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -u -p a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
> --- a/drivers/power/reset/at91-sama5d2_shdwc.c
> +++ b/drivers/power/reset/at91-sama5d2_shdwc.c
> @@ -68,7 +68,7 @@ struct shdwc_config {
>  };
>  
>  struct shdwc {
> -	struct shdwc_config *cfg;
> +	const struct shdwc_config *cfg;
>  	void __iomem *at91_shdwc_base;
>  };
>  
> @@ -260,7 +260,7 @@ static int __init at91_shdwc_probe(struc
>  	}
>  
>  	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
> -	at91_shdwc->cfg = (struct shdwc_config *)(match->data);
> +	at91_shdwc->cfg = match->data;
>  
>  	sclk = devm_clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(sclk))
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 12/12] power: reset: account for const type of of_device_id.data
@ 2018-01-09 16:22     ` Sebastian Reichel
  0 siblings, 0 replies; 85+ messages in thread
From: Sebastian Reichel @ 2018-01-09 16:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, Jan 02, 2018 at 02:28:08PM +0100, Julia Lawall wrote:
> This driver creates a const structure that it stores in the data
> field of an of_device_id array.
> 
> Add const to the declaration of the location that receives a value
> from the data field to ensure that the compiler will continue to check
> that the value is not modified and remove the const-dropping cast on
> the access to the data field.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/reset/at91-sama5d2_shdwc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -u -p a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
> --- a/drivers/power/reset/at91-sama5d2_shdwc.c
> +++ b/drivers/power/reset/at91-sama5d2_shdwc.c
> @@ -68,7 +68,7 @@ struct shdwc_config {
>  };
>  
>  struct shdwc {
> -	struct shdwc_config *cfg;
> +	const struct shdwc_config *cfg;
>  	void __iomem *at91_shdwc_base;
>  };
>  
> @@ -260,7 +260,7 @@ static int __init at91_shdwc_probe(struc
>  	}
>  
>  	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
> -	at91_shdwc->cfg = (struct shdwc_config *)(match->data);
> +	at91_shdwc->cfg = match->data;
>  
>  	sclk = devm_clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(sclk))
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180109/4c51cf66/attachment.sig>

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
  (?)
@ 2018-01-15 18:24     ` Wolfram Sang
  -1 siblings, 0 replies; 85+ messages in thread
From: Wolfram Sang @ 2018-01-15 18:24 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Heiko Stuebner, kernel-janitors, linux-arm-kernel,
	linux-rockchip, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2604 bytes --]

On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> This driver creates a number of const structures that it stores in
> the data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Heiko, you okay with the patch?

> 
> ---
>  drivers/i2c/busses/i2c-rk3x.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff -u -p a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -194,7 +194,7 @@ struct rk3x_i2c_soc_data {
>  struct rk3x_i2c {
>  	struct i2c_adapter adap;
>  	struct device *dev;
> -	struct rk3x_i2c_soc_data *soc_data;
> +	const struct rk3x_i2c_soc_data *soc_data;
>  
>  	/* Hardware resources */
>  	void __iomem *regs;
> @@ -1164,27 +1164,27 @@ static const struct rk3x_i2c_soc_data rk
>  static const struct of_device_id rk3x_i2c_match[] = {
>  	{
>  		.compatible = "rockchip,rv1108-i2c",
> -		.data = (void *)&rv1108_soc_data
> +		.data = &rv1108_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3066-i2c",
> -		.data = (void *)&rk3066_soc_data
> +		.data = &rk3066_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3188-i2c",
> -		.data = (void *)&rk3188_soc_data
> +		.data = &rk3188_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3228-i2c",
> -		.data = (void *)&rk3228_soc_data
> +		.data = &rk3228_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3288-i2c",
> -		.data = (void *)&rk3288_soc_data
> +		.data = &rk3288_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3399-i2c",
> -		.data = (void *)&rk3399_soc_data
> +		.data = &rk3399_soc_data
>  	},
>  	{},
>  };
> @@ -1207,7 +1207,7 @@ static int rk3x_i2c_probe(struct platfor
>  		return -ENOMEM;
>  
>  	match = of_match_node(rk3x_i2c_match, np);
> -	i2c->soc_data = (struct rk3x_i2c_soc_data *)match->data;
> +	i2c->soc_data = match->data;
>  
>  	/* use common interface to get I2C timing properties */
>  	i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-15 18:24     ` Wolfram Sang
  0 siblings, 0 replies; 85+ messages in thread
From: Wolfram Sang @ 2018-01-15 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2604 bytes --]

On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> This driver creates a number of const structures that it stores in
> the data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Heiko, you okay with the patch?

> 
> ---
>  drivers/i2c/busses/i2c-rk3x.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff -u -p a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -194,7 +194,7 @@ struct rk3x_i2c_soc_data {
>  struct rk3x_i2c {
>  	struct i2c_adapter adap;
>  	struct device *dev;
> -	struct rk3x_i2c_soc_data *soc_data;
> +	const struct rk3x_i2c_soc_data *soc_data;
>  
>  	/* Hardware resources */
>  	void __iomem *regs;
> @@ -1164,27 +1164,27 @@ static const struct rk3x_i2c_soc_data rk
>  static const struct of_device_id rk3x_i2c_match[] = {
>  	{
>  		.compatible = "rockchip,rv1108-i2c",
> -		.data = (void *)&rv1108_soc_data
> +		.data = &rv1108_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3066-i2c",
> -		.data = (void *)&rk3066_soc_data
> +		.data = &rk3066_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3188-i2c",
> -		.data = (void *)&rk3188_soc_data
> +		.data = &rk3188_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3228-i2c",
> -		.data = (void *)&rk3228_soc_data
> +		.data = &rk3228_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3288-i2c",
> -		.data = (void *)&rk3288_soc_data
> +		.data = &rk3288_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3399-i2c",
> -		.data = (void *)&rk3399_soc_data
> +		.data = &rk3399_soc_data
>  	},
>  	{},
>  };
> @@ -1207,7 +1207,7 @@ static int rk3x_i2c_probe(struct platfor
>  		return -ENOMEM;
>  
>  	match = of_match_node(rk3x_i2c_match, np);
> -	i2c->soc_data = (struct rk3x_i2c_soc_data *)match->data;
> +	i2c->soc_data = match->data;
>  
>  	/* use common interface to get I2C timing properties */
>  	i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-15 18:24     ` Wolfram Sang
  0 siblings, 0 replies; 85+ messages in thread
From: Wolfram Sang @ 2018-01-15 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> This driver creates a number of const structures that it stores in
> the data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Heiko, you okay with the patch?

> 
> ---
>  drivers/i2c/busses/i2c-rk3x.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff -u -p a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -194,7 +194,7 @@ struct rk3x_i2c_soc_data {
>  struct rk3x_i2c {
>  	struct i2c_adapter adap;
>  	struct device *dev;
> -	struct rk3x_i2c_soc_data *soc_data;
> +	const struct rk3x_i2c_soc_data *soc_data;
>  
>  	/* Hardware resources */
>  	void __iomem *regs;
> @@ -1164,27 +1164,27 @@ static const struct rk3x_i2c_soc_data rk
>  static const struct of_device_id rk3x_i2c_match[] = {
>  	{
>  		.compatible = "rockchip,rv1108-i2c",
> -		.data = (void *)&rv1108_soc_data
> +		.data = &rv1108_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3066-i2c",
> -		.data = (void *)&rk3066_soc_data
> +		.data = &rk3066_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3188-i2c",
> -		.data = (void *)&rk3188_soc_data
> +		.data = &rk3188_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3228-i2c",
> -		.data = (void *)&rk3228_soc_data
> +		.data = &rk3228_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3288-i2c",
> -		.data = (void *)&rk3288_soc_data
> +		.data = &rk3288_soc_data
>  	},
>  	{
>  		.compatible = "rockchip,rk3399-i2c",
> -		.data = (void *)&rk3399_soc_data
> +		.data = &rk3399_soc_data
>  	},
>  	{},
>  };
> @@ -1207,7 +1207,7 @@ static int rk3x_i2c_probe(struct platfor
>  		return -ENOMEM;
>  
>  	match = of_match_node(rk3x_i2c_match, np);
> -	i2c->soc_data = (struct rk3x_i2c_soc_data *)match->data;
> +	i2c->soc_data = match->data;
>  
>  	/* use common interface to get I2C timing properties */
>  	i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180115/5c0ecea0/attachment.sig>

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
  2018-01-15 18:24     ` Wolfram Sang
  (?)
@ 2018-01-17 11:00       ` Heiko Stuebner
  -1 siblings, 0 replies; 85+ messages in thread
From: Heiko Stuebner @ 2018-01-17 11:00 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Julia Lawall, kernel-janitors, linux-arm-kernel, linux-rockchip,
	linux-i2c, linux-kernel

Am Montag, 15. Januar 2018, 19:24:56 CET schrieb Wolfram Sang:
> On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> > This driver creates a number of const structures that it stores in
> > the data field of an of_device_id array.
> > 
> > The data field of an of_device_id structure has type const void *, so
> > there is no need for a const-discarding cast when putting const values
> > into such a structure.
> > 
> > Furthermore, adding const to the declaration of the location that
> > receives a const value from such a field ensures that the compiler
> > will continue to check that the value is not modified.  The
> > const-discarding cast on the extraction from the data field is thus
> > no longer needed.
> > 
> > Done using Coccinelle.
> > 
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Heiko, you okay with the patch?

Looks good to me and does not seem to contain any changes related
to actual functionality, so
Reviewed-by: Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-17 11:00       ` Heiko Stuebner
  0 siblings, 0 replies; 85+ messages in thread
From: Heiko Stuebner @ 2018-01-17 11:00 UTC (permalink / raw)
  To: linux-arm-kernel

Am Montag, 15. Januar 2018, 19:24:56 CET schrieb Wolfram Sang:
> On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> > This driver creates a number of const structures that it stores in
> > the data field of an of_device_id array.
> > 
> > The data field of an of_device_id structure has type const void *, so
> > there is no need for a const-discarding cast when putting const values
> > into such a structure.
> > 
> > Furthermore, adding const to the declaration of the location that
> > receives a const value from such a field ensures that the compiler
> > will continue to check that the value is not modified.  The
> > const-discarding cast on the extraction from the data field is thus
> > no longer needed.
> > 
> > Done using Coccinelle.
> > 
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Heiko, you okay with the patch?

Looks good to me and does not seem to contain any changes related
to actual functionality, so
Reviewed-by: Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-17 11:00       ` Heiko Stuebner
  0 siblings, 0 replies; 85+ messages in thread
From: Heiko Stuebner @ 2018-01-17 11:00 UTC (permalink / raw)
  To: linux-arm-kernel

Am Montag, 15. Januar 2018, 19:24:56 CET schrieb Wolfram Sang:
> On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> > This driver creates a number of const structures that it stores in
> > the data field of an of_device_id array.
> > 
> > The data field of an of_device_id structure has type const void *, so
> > there is no need for a const-discarding cast when putting const values
> > into such a structure.
> > 
> > Furthermore, adding const to the declaration of the location that
> > receives a const value from such a field ensures that the compiler
> > will continue to check that the value is not modified.  The
> > const-discarding cast on the extraction from the data field is thus
> > no longer needed.
> > 
> > Done using Coccinelle.
> > 
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Heiko, you okay with the patch?

Looks good to me and does not seem to contain any changes related
to actual functionality, so
Reviewed-by: Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
  2018-01-02 13:28   ` Julia Lawall
  (?)
@ 2018-01-17 23:12     ` Wolfram Sang
  -1 siblings, 0 replies; 85+ messages in thread
From: Wolfram Sang @ 2018-01-17 23:12 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Heiko Stuebner, kernel-janitors, linux-arm-kernel,
	linux-rockchip, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> This driver creates a number of const structures that it stores in
> the data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* Re: [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-17 23:12     ` Wolfram Sang
  0 siblings, 0 replies; 85+ messages in thread
From: Wolfram Sang @ 2018-01-17 23:12 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> This driver creates a number of const structures that it stores in
> the data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [PATCH 07/12] i2c: rk3x: account for const type of of_device_id.data
@ 2018-01-17 23:12     ` Wolfram Sang
  0 siblings, 0 replies; 85+ messages in thread
From: Wolfram Sang @ 2018-01-17 23:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 02, 2018 at 02:28:03PM +0100, Julia Lawall wrote:
> This driver creates a number of const structures that it stores in
> the data field of an of_device_id array.
> 
> The data field of an of_device_id structure has type const void *, so
> there is no need for a const-discarding cast when putting const values
> into such a structure.
> 
> Furthermore, adding const to the declaration of the location that
> receives a const value from such a field ensures that the compiler
> will continue to check that the value is not modified.  The
> const-discarding cast on the extraction from the data field is thus
> no longer needed.
> 
> Done using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Applied to for-next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180118/4b380b13/attachment.sig>

^ permalink raw reply	[flat|nested] 85+ messages in thread

end of thread, other threads:[~2018-01-17 23:12 UTC | newest]

Thread overview: 85+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02 13:27 [PATCH 00/12] account for const type of of_device_id.data Julia Lawall
2018-01-02 13:27 ` Julia Lawall
2018-01-02 13:27 ` Julia Lawall
2018-01-02 13:27 ` Julia Lawall
2018-01-02 13:27 ` [PATCH 01/12] PM / AVS: rockchip-io: " Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-02 13:27 ` [PATCH 02/12] pinctrl: at91-pio4: " Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-03  7:58   ` Linus Walleij
2018-01-03  7:58     ` Linus Walleij
2018-01-03  7:58     ` Linus Walleij
2018-01-02 13:27 ` [PATCH 03/12] spi: sirf: " Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-02 13:27   ` Julia Lawall
2018-01-03 12:15   ` Applied "spi: sirf: account for const type of of_device_id.data" to the spi tree Mark Brown
2018-01-03 12:15     ` Mark Brown
2018-01-03 12:15     ` Mark Brown
2018-01-03 12:22   ` Mark Brown
2018-01-03 12:22     ` Mark Brown
2018-01-03 12:22     ` Mark Brown
2018-01-02 13:28 ` [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-03 12:22   ` Lorenzo Pieralisi
2018-01-03 12:22     ` Lorenzo Pieralisi
2018-01-03 12:38     ` Stanimir Varbanov
2018-01-03 12:38       ` Stanimir Varbanov
2018-01-03 12:38     ` Julia Lawall
2018-01-03 12:38       ` Julia Lawall
2018-01-03 18:23       ` Lorenzo Pieralisi
2018-01-03 18:23         ` Lorenzo Pieralisi
2018-01-02 13:28 ` [PATCH 05/12] pinctrl: armada-37xx: " Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-02 15:36   ` Gregory CLEMENT
2018-01-02 15:36     ` Gregory CLEMENT
2018-01-02 15:36     ` Gregory CLEMENT
2018-01-03  8:03   ` Linus Walleij
2018-01-03  8:03     ` Linus Walleij
2018-01-03  8:03     ` Linus Walleij
2018-01-02 13:28 ` [PATCH 06/12] power: supply: " Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-09 16:22   ` Sebastian Reichel
2018-01-09 16:22     ` Sebastian Reichel
2018-01-02 13:28 ` [PATCH 07/12] i2c: rk3x: " Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-15 18:24   ` Wolfram Sang
2018-01-15 18:24     ` Wolfram Sang
2018-01-15 18:24     ` Wolfram Sang
2018-01-17 11:00     ` Heiko Stuebner
2018-01-17 11:00       ` Heiko Stuebner
2018-01-17 11:00       ` Heiko Stuebner
2018-01-17 23:12   ` Wolfram Sang
2018-01-17 23:12     ` Wolfram Sang
2018-01-17 23:12     ` Wolfram Sang
2018-01-02 13:28 ` [PATCH 08/12] pinctrl: axp209: " Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-03  7:59   ` Linus Walleij
2018-01-03  7:59     ` Linus Walleij
2018-01-02 13:28 ` [PATCH 09/12] mtd: fsl-quadspi: " Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-07 18:08   ` Cyrille Pitchen
2018-01-07 18:08     ` Cyrille Pitchen
2018-01-02 13:28 ` [PATCH 10/12] spi: spi-fsl-dspi: " Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-03 12:22   ` Applied "spi: spi-fsl-dspi: account for const type of of_device_id.data" to the spi tree Mark Brown
2018-01-03 12:22     ` Mark Brown
2018-01-03 12:22     ` Mark Brown
2018-01-02 13:28 ` [PATCH 11/12] iio: common: ssp_sensors: account for const type of of_device_id.data Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-06 12:23   ` Jonathan Cameron
2018-01-06 12:23     ` Jonathan Cameron
2018-01-02 13:28 ` [PATCH 12/12] power: reset: " Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-02 13:28   ` Julia Lawall
2018-01-05 13:24   ` Alexandre Belloni
2018-01-05 13:24     ` Alexandre Belloni
2018-01-05 13:24     ` Alexandre Belloni
2018-01-09 16:22   ` Sebastian Reichel
2018-01-09 16:22     ` Sebastian Reichel
2018-01-09 16:22     ` Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.