All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37 ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: bhumirks, kernel-janitors, linux-samsung-soc, linux-kernel,
	linux-pm, Eduardo Valentin, Zhang Rui, linux-rpi-kernel

The thermal_zone_of_device_ops structures are only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structures themselves can be const.

Done with the help of Coccinelle.

---

 drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
 drivers/thermal/qoriq_thermal.c            |    2 +-
 drivers/thermal/samsung/exynos_tmu.c       |    2 +-
 drivers/thermal/zx2967_thermal.c           |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

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

* [PATCH 0/4] constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37 ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

The thermal_zone_of_device_ops structures are only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structures themselves can be const.

Done with the help of Coccinelle.

---

 drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
 drivers/thermal/qoriq_thermal.c            |    2 +-
 drivers/thermal/samsung/exynos_tmu.c       |    2 +-
 drivers/thermal/zx2967_thermal.c           |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

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

* [PATCH 0/4] constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37 ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

The thermal_zone_of_device_ops structures are only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structures themselves can be const.

Done with the help of Coccinelle.

---

 drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
 drivers/thermal/qoriq_thermal.c            |    2 +-
 drivers/thermal/samsung/exynos_tmu.c       |    2 +-
 drivers/thermal/zx2967_thermal.c           |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

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

* [PATCH 1/4] thermal: qoriq: constify thermal_zone_of_device_ops structures
  2017-08-05 20:37 ` Julia Lawall
@ 2017-08-05 20:37   ` Julia Lawall
  -1 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: Zhang Rui
  Cc: bhumirks, kernel-janitors, Eduardo Valentin, linux-pm, linux-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

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

diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 4362a69..c866cc1 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -188,7 +188,7 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
 	tmu_write(data, TMR_DISABLE, &data->regs->tmr);
 }
 
-static struct thermal_zone_of_device_ops tmu_tz_ops = {
+static const struct thermal_zone_of_device_ops tmu_tz_ops = {
 	.get_temp = tmu_get_temp,
 };
 

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

* [PATCH 1/4] thermal: qoriq: constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37   ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: Zhang Rui
  Cc: bhumirks, kernel-janitors, Eduardo Valentin, linux-pm, linux-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

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

diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 4362a69..c866cc1 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -188,7 +188,7 @@ static void qoriq_tmu_init_device(struct qoriq_tmu_data *data)
 	tmu_write(data, TMR_DISABLE, &data->regs->tmr);
 }
 
-static struct thermal_zone_of_device_ops tmu_tz_ops = {
+static const struct thermal_zone_of_device_ops tmu_tz_ops = {
 	.get_temp = tmu_get_temp,
 };
 


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

* [PATCH 2/4] thermal: zx2967: constify thermal_zone_of_device_ops structures
  2017-08-05 20:37 ` Julia Lawall
@ 2017-08-05 20:37   ` Julia Lawall
  -1 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: Zhang Rui
  Cc: bhumirks, kernel-janitors, Eduardo Valentin, linux-pm, linux-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

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

diff --git a/drivers/thermal/zx2967_thermal.c b/drivers/thermal/zx2967_thermal.c
index a5670ad..6acce0b 100644
--- a/drivers/thermal/zx2967_thermal.c
+++ b/drivers/thermal/zx2967_thermal.c
@@ -111,7 +111,7 @@ static int zx2967_thermal_get_temp(void *data, int *temp)
 	return ret;
 }
 
-static struct thermal_zone_of_device_ops zx2967_of_thermal_ops = {
+static const struct thermal_zone_of_device_ops zx2967_of_thermal_ops = {
 	.get_temp = zx2967_thermal_get_temp,
 };
 

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

* [PATCH 2/4] thermal: zx2967: constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37   ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: Zhang Rui
  Cc: bhumirks, kernel-janitors, Eduardo Valentin, linux-pm, linux-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

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

diff --git a/drivers/thermal/zx2967_thermal.c b/drivers/thermal/zx2967_thermal.c
index a5670ad..6acce0b 100644
--- a/drivers/thermal/zx2967_thermal.c
+++ b/drivers/thermal/zx2967_thermal.c
@@ -111,7 +111,7 @@ static int zx2967_thermal_get_temp(void *data, int *temp)
 	return ret;
 }
 
-static struct thermal_zone_of_device_ops zx2967_of_thermal_ops = {
+static const struct thermal_zone_of_device_ops zx2967_of_thermal_ops = {
 	.get_temp = zx2967_thermal_get_temp,
 };
 


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

* [PATCH 3/4] thermal: exynos: constify thermal_zone_of_device_ops structures
  2017-08-05 20:37 ` Julia Lawall
  (?)
@ 2017-08-05 20:37   ` Julia Lawall
  -1 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: bhumirks, kernel-janitors, Zhang Rui, Eduardo Valentin,
	Kukjin Kim, Krzysztof Kozlowski, linux-pm, linux-samsung-soc,
	linux-arm-kernel, linux-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

---
 drivers/thermal/samsung/exynos_tmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 7b8ef09..ed805c7 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1286,7 +1286,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
 	return 0;
 }
 
-static struct thermal_zone_of_device_ops exynos_sensor_ops = {
+static const struct thermal_zone_of_device_ops exynos_sensor_ops = {
 	.get_temp = exynos_get_temp,
 	.set_emul_temp = exynos_tmu_set_emulation,
 };

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

* [PATCH 3/4] thermal: exynos: constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37   ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

---
 drivers/thermal/samsung/exynos_tmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 7b8ef09..ed805c7 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1286,7 +1286,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
 	return 0;
 }
 
-static struct thermal_zone_of_device_ops exynos_sensor_ops = {
+static const struct thermal_zone_of_device_ops exynos_sensor_ops = {
 	.get_temp = exynos_get_temp,
 	.set_emul_temp = exynos_tmu_set_emulation,
 };


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

* [PATCH 3/4] thermal: exynos: constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37   ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i at p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i at p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e at i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

---
 drivers/thermal/samsung/exynos_tmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 7b8ef09..ed805c7 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1286,7 +1286,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
 	return 0;
 }
 
-static struct thermal_zone_of_device_ops exynos_sensor_ops = {
+static const struct thermal_zone_of_device_ops exynos_sensor_ops = {
 	.get_temp = exynos_get_temp,
 	.set_emul_temp = exynos_tmu_set_emulation,
 };

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

* [PATCH 4/4] thermal: bcm2835: constify thermal_zone_of_device_ops structures
  2017-08-05 20:37 ` Julia Lawall
  (?)
@ 2017-08-05 20:37   ` Julia Lawall
  -1 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: Zhang Rui
  Cc: bhumirks, kernel-janitors, Eduardo Valentin, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Eric Anholt,
	Stefan Wahren, linux-pm, linux-rpi-kernel, linux-arm-kernel,
	linux-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

---
 drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index e6863c8..a4d6a0e 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -145,7 +145,7 @@ static void bcm2835_thermal_debugfs(struct platform_device *pdev)
 	debugfs_create_regset32("regset", 0444, data->debugfsdir, regset);
 }
 
-static struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
+static const struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
 	.get_temp = bcm2835_thermal_get_temp,
 };
 

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

* [PATCH 4/4] thermal: bcm2835: constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37   ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i@p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i@p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

---
 drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index e6863c8..a4d6a0e 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -145,7 +145,7 @@ static void bcm2835_thermal_debugfs(struct platform_device *pdev)
 	debugfs_create_regset32("regset", 0444, data->debugfsdir, regset);
 }
 
-static struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
+static const struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
 	.get_temp = bcm2835_thermal_get_temp,
 };
 


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

* [PATCH 4/4] thermal: bcm2835: constify thermal_zone_of_device_ops structures
@ 2017-08-05 20:37   ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

The thermal_zone_of_device_ops structure is only passed as the fourth
argument to thermal_zone_of_sensor_register, which is declared as const.
Thus the thermal_zone_of_device_ops structure itself can be const.

Done with the help of Coccinelle.

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct thermal_zone_of_device_ops i at p = { ... };

@ok1@
identifier r.i;
expression e1,e2,e3;
position p;
@@
thermal_zone_of_sensor_register(e1,e2,e3,&i at p)

@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct thermal_zone_of_device_ops e;
@@
e at i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct thermal_zone_of_device_ops i = { ... };
// </smpl>

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

---
 drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index e6863c8..a4d6a0e 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -145,7 +145,7 @@ static void bcm2835_thermal_debugfs(struct platform_device *pdev)
 	debugfs_create_regset32("regset", 0444, data->debugfsdir, regset);
 }
 
-static struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
+static const struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
 	.get_temp = bcm2835_thermal_get_temp,
 };
 

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

* Re: [PATCH 4/4] thermal: bcm2835: constify thermal_zone_of_device_ops structures
  2017-08-05 20:37   ` Julia Lawall
  (?)
@ 2017-08-07  6:41     ` Stefan Wahren
  -1 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2017-08-07  6:41 UTC (permalink / raw)
  To: Julia Lawall, Zhang Rui
  Cc: bhumirks, kernel-janitors, Eduardo Valentin, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Eric Anholt,
	linux-pm, linux-rpi-kernel, linux-arm-kernel, linux-kernel

Am 05.08.2017 um 22:37 schrieb Julia Lawall:
> The thermal_zone_of_device_ops structure is only passed as the fourth
> argument to thermal_zone_of_sensor_register, which is declared as const.
> Thus the thermal_zone_of_device_ops structure itself can be const.
>
> Done with the help of Coccinelle.
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct thermal_zone_of_device_ops i@p = { ... };
>
> @ok1@
> identifier r.i;
> expression e1,e2,e3;
> position p;
> @@
> thermal_zone_of_sensor_register(e1,e2,e3,&i@p)
>
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct thermal_zone_of_device_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct thermal_zone_of_device_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Stefan Wahren <stefan.wahren@i2se.com>

>
> ---
>  drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
> index e6863c8..a4d6a0e 100644
> --- a/drivers/thermal/broadcom/bcm2835_thermal.c
> +++ b/drivers/thermal/broadcom/bcm2835_thermal.c
> @@ -145,7 +145,7 @@ static void bcm2835_thermal_debugfs(struct platform_device *pdev)
>  	debugfs_create_regset32("regset", 0444, data->debugfsdir, regset);
>  }
>  
> -static struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
> +static const struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
>  	.get_temp = bcm2835_thermal_get_temp,
>  };
>  
>

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

* Re: [PATCH 4/4] thermal: bcm2835: constify thermal_zone_of_device_ops structures
@ 2017-08-07  6:41     ` Stefan Wahren
  0 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2017-08-07  6:41 UTC (permalink / raw)
  To: linux-arm-kernel

Am 05.08.2017 um 22:37 schrieb Julia Lawall:
> The thermal_zone_of_device_ops structure is only passed as the fourth
> argument to thermal_zone_of_sensor_register, which is declared as const.
> Thus the thermal_zone_of_device_ops structure itself can be const.
>
> Done with the help of Coccinelle.
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct thermal_zone_of_device_ops i@p = { ... };
>
> @ok1@
> identifier r.i;
> expression e1,e2,e3;
> position p;
> @@
> thermal_zone_of_sensor_register(e1,e2,e3,&i@p)
>
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct thermal_zone_of_device_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct thermal_zone_of_device_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Stefan Wahren <stefan.wahren@i2se.com>

>
> ---
>  drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
> index e6863c8..a4d6a0e 100644
> --- a/drivers/thermal/broadcom/bcm2835_thermal.c
> +++ b/drivers/thermal/broadcom/bcm2835_thermal.c
> @@ -145,7 +145,7 @@ static void bcm2835_thermal_debugfs(struct platform_device *pdev)
>  	debugfs_create_regset32("regset", 0444, data->debugfsdir, regset);
>  }
>  
> -static struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
> +static const struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
>  	.get_temp = bcm2835_thermal_get_temp,
>  };
>  
>

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

* [PATCH 4/4] thermal: bcm2835: constify thermal_zone_of_device_ops structures
@ 2017-08-07  6:41     ` Stefan Wahren
  0 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2017-08-07  6:41 UTC (permalink / raw)
  To: linux-arm-kernel

Am 05.08.2017 um 22:37 schrieb Julia Lawall:
> The thermal_zone_of_device_ops structure is only passed as the fourth
> argument to thermal_zone_of_sensor_register, which is declared as const.
> Thus the thermal_zone_of_device_ops structure itself can be const.
>
> Done with the help of Coccinelle.
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct thermal_zone_of_device_ops i at p = { ... };
>
> @ok1@
> identifier r.i;
> expression e1,e2,e3;
> position p;
> @@
> thermal_zone_of_sensor_register(e1,e2,e3,&i at p)
>
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct thermal_zone_of_device_ops e;
> @@
> e at i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct thermal_zone_of_device_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Stefan Wahren <stefan.wahren@i2se.com>

>
> ---
>  drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
> index e6863c8..a4d6a0e 100644
> --- a/drivers/thermal/broadcom/bcm2835_thermal.c
> +++ b/drivers/thermal/broadcom/bcm2835_thermal.c
> @@ -145,7 +145,7 @@ static void bcm2835_thermal_debugfs(struct platform_device *pdev)
>  	debugfs_create_regset32("regset", 0444, data->debugfsdir, regset);
>  }
>  
> -static struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
> +static const struct thermal_zone_of_device_ops bcm2835_thermal_ops = {
>  	.get_temp = bcm2835_thermal_get_temp,
>  };
>  
>

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

* Re: [PATCH 3/4] thermal: exynos: constify thermal_zone_of_device_ops structures
  2017-08-05 20:37   ` Julia Lawall
  (?)
@ 2017-08-07 15:21     ` Bartlomiej Zolnierkiewicz
  -1 siblings, 0 replies; 25+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-08-07 15:21 UTC (permalink / raw)
  To: Julia Lawall, Zhang Rui, Eduardo Valentin
  Cc: bhumirks, kernel-janitors, Kukjin Kim, Krzysztof Kozlowski,
	linux-pm, linux-samsung-soc, linux-arm-kernel, linux-kernel

On Saturday, August 05, 2017 10:37:16 PM Julia Lawall wrote:
> The thermal_zone_of_device_ops structure is only passed as the fourth
> argument to thermal_zone_of_sensor_register, which is declared as const.
> Thus the thermal_zone_of_device_ops structure itself can be const.
> 
> Done with the help of Coccinelle.
> 
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct thermal_zone_of_device_ops i@p = { ... };
> 
> @ok1@
> identifier r.i;
> expression e1,e2,e3;
> position p;
> @@
> thermal_zone_of_sensor_register(e1,e2,e3,&i@p)
> 
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct thermal_zone_of_device_ops e;
> @@
> e@i@p
> 
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct thermal_zone_of_device_ops i = { ... };
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Eduardo/Zhang, Please queue this patch for upstream, thanks!

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* Re: [PATCH 3/4] thermal: exynos: constify thermal_zone_of_device_ops structures
@ 2017-08-07 15:21     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 25+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-08-07 15:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday, August 05, 2017 10:37:16 PM Julia Lawall wrote:
> The thermal_zone_of_device_ops structure is only passed as the fourth
> argument to thermal_zone_of_sensor_register, which is declared as const.
> Thus the thermal_zone_of_device_ops structure itself can be const.
> 
> Done with the help of Coccinelle.
> 
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct thermal_zone_of_device_ops i@p = { ... };
> 
> @ok1@
> identifier r.i;
> expression e1,e2,e3;
> position p;
> @@
> thermal_zone_of_sensor_register(e1,e2,e3,&i@p)
> 
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct thermal_zone_of_device_ops e;
> @@
> e@i@p
> 
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct thermal_zone_of_device_ops i = { ... };
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Eduardo/Zhang, Please queue this patch for upstream, thanks!

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


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

* [PATCH 3/4] thermal: exynos: constify thermal_zone_of_device_ops structures
@ 2017-08-07 15:21     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 25+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-08-07 15:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday, August 05, 2017 10:37:16 PM Julia Lawall wrote:
> The thermal_zone_of_device_ops structure is only passed as the fourth
> argument to thermal_zone_of_sensor_register, which is declared as const.
> Thus the thermal_zone_of_device_ops structure itself can be const.
> 
> Done with the help of Coccinelle.
> 
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct thermal_zone_of_device_ops i at p = { ... };
> 
> @ok1@
> identifier r.i;
> expression e1,e2,e3;
> position p;
> @@
> thermal_zone_of_sensor_register(e1,e2,e3,&i at p)
> 
> @bad@
> position p != {r.p,ok1.p};
> identifier r.i;
> struct thermal_zone_of_device_ops e;
> @@
> e at i@p
> 
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
>  struct thermal_zone_of_device_ops i = { ... };
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Eduardo/Zhang, Please queue this patch for upstream, thanks!

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

* Re: [PATCH 0/4] constify thermal_zone_of_device_ops structures
  2017-08-05 20:37 ` Julia Lawall
  (?)
@ 2017-08-08 13:43   ` Zhang Rui
  -1 siblings, 0 replies; 25+ messages in thread
From: Zhang Rui @ 2017-08-08 13:43 UTC (permalink / raw)
  To: Julia Lawall, linux-arm-kernel
  Cc: bhumirks, kernel-janitors, linux-samsung-soc, linux-kernel,
	linux-pm, Eduardo Valentin, linux-rpi-kernel

On Sat, 2017-08-05 at 22:37 +0200, Julia Lawall wrote:
> The thermal_zone_of_device_ops structures are only passed as the
> fourth
> argument to thermal_zone_of_sensor_register, which is declared as
> const.
> Thus the thermal_zone_of_device_ops structures themselves can be
> const.
> 
> Done with the help of Coccinelle.

I still see the same problem in other thermal drivers, which is not
covered by this patch set. Can we fix them all in one time?

thanks,
rui
> 
> ---
> 
>  drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
>  drivers/thermal/qoriq_thermal.c            |    2 +-
>  drivers/thermal/samsung/exynos_tmu.c       |    2 +-
>  drivers/thermal/zx2967_thermal.c           |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

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

* Re: [PATCH 0/4] constify thermal_zone_of_device_ops structures
@ 2017-08-08 13:43   ` Zhang Rui
  0 siblings, 0 replies; 25+ messages in thread
From: Zhang Rui @ 2017-08-08 13:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2017-08-05 at 22:37 +0200, Julia Lawall wrote:
> The thermal_zone_of_device_ops structures are only passed as the
> fourth
> argument to thermal_zone_of_sensor_register, which is declared as
> const.
> Thus the thermal_zone_of_device_ops structures themselves can be
> const.
> 
> Done with the help of Coccinelle.

I still see the same problem in other thermal drivers, which is not
covered by this patch set. Can we fix them all in one time?

thanks,
rui
> 
> ---
> 
>  drivers/thermal/broadcom/bcm2835_thermal.c |    2 +-
>  drivers/thermal/qoriq_thermal.c            |    2 +-
>  drivers/thermal/samsung/exynos_tmu.c       |    2 +-
>  drivers/thermal/zx2967_thermal.c           |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

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

* [PATCH 0/4] constify thermal_zone_of_device_ops structures
@ 2017-08-08 13:43   ` Zhang Rui
  0 siblings, 0 replies; 25+ messages in thread
From: Zhang Rui @ 2017-08-08 13:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2017-08-05 at 22:37 +0200, Julia Lawall wrote:
> The thermal_zone_of_device_ops structures are only passed as the
> fourth
> argument to thermal_zone_of_sensor_register, which is declared as
> const.
> Thus the thermal_zone_of_device_ops structures themselves can be
> const.
> 
> Done with the help of Coccinelle.

I still see the same problem in other thermal drivers, which is not
covered by this patch set. Can we fix them all in one time?

thanks,
rui
> 
> ---
> 
> ?drivers/thermal/broadcom/bcm2835_thermal.c |????2 +-
> ?drivers/thermal/qoriq_thermal.c????????????|????2 +-
> ?drivers/thermal/samsung/exynos_tmu.c???????|????2 +-
> ?drivers/thermal/zx2967_thermal.c???????????|????2 +-
> ?4 files changed, 4 insertions(+), 4 deletions(-)

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

* Re: [PATCH 0/4] constify thermal_zone_of_device_ops structures
  2017-08-08 13:43   ` Zhang Rui
  (?)
@ 2017-08-08 13:46     ` Julia Lawall
  -1 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-08 13:46 UTC (permalink / raw)
  To: Zhang Rui
  Cc: linux-arm-kernel, bhumirks, kernel-janitors, linux-samsung-soc,
	linux-kernel, linux-pm, Eduardo Valentin, linux-rpi-kernel



On Tue, 8 Aug 2017, Zhang Rui wrote:

> On Sat, 2017-08-05 at 22:37 +0200, Julia Lawall wrote:
> > The thermal_zone_of_device_ops structures are only passed as the
> > fourth
> > argument to thermal_zone_of_sensor_register, which is declared as
> > const.
> > Thus the thermal_zone_of_device_ops structures themselves can be
> > const.
> >
> > Done with the help of Coccinelle.
>
> I still see the same problem in other thermal drivers, which is not
> covered by this patch set. Can we fix them all in one time?

OK.

julia

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

* Re: [PATCH 0/4] constify thermal_zone_of_device_ops structures
@ 2017-08-08 13:46     ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-08 13:46 UTC (permalink / raw)
  To: linux-arm-kernel



On Tue, 8 Aug 2017, Zhang Rui wrote:

> On Sat, 2017-08-05 at 22:37 +0200, Julia Lawall wrote:
> > The thermal_zone_of_device_ops structures are only passed as the
> > fourth
> > argument to thermal_zone_of_sensor_register, which is declared as
> > const.
> > Thus the thermal_zone_of_device_ops structures themselves can be
> > const.
> >
> > Done with the help of Coccinelle.
>
> I still see the same problem in other thermal drivers, which is not
> covered by this patch set. Can we fix them all in one time?

OK.

julia

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

* [PATCH 0/4] constify thermal_zone_of_device_ops structures
@ 2017-08-08 13:46     ` Julia Lawall
  0 siblings, 0 replies; 25+ messages in thread
From: Julia Lawall @ 2017-08-08 13:46 UTC (permalink / raw)
  To: linux-arm-kernel



On Tue, 8 Aug 2017, Zhang Rui wrote:

> On Sat, 2017-08-05 at 22:37 +0200, Julia Lawall wrote:
> > The thermal_zone_of_device_ops structures are only passed as the
> > fourth
> > argument to thermal_zone_of_sensor_register, which is declared as
> > const.
> > Thus the thermal_zone_of_device_ops structures themselves can be
> > const.
> >
> > Done with the help of Coccinelle.
>
> I still see the same problem in other thermal drivers, which is not
> covered by this patch set. Can we fix them all in one time?

OK.

julia

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

end of thread, other threads:[~2017-08-08 13:47 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-05 20:37 [PATCH 0/4] constify thermal_zone_of_device_ops structures Julia Lawall
2017-08-05 20:37 ` Julia Lawall
2017-08-05 20:37 ` Julia Lawall
2017-08-05 20:37 ` [PATCH 1/4] thermal: qoriq: " Julia Lawall
2017-08-05 20:37   ` Julia Lawall
2017-08-05 20:37 ` [PATCH 2/4] thermal: zx2967: " Julia Lawall
2017-08-05 20:37   ` Julia Lawall
2017-08-05 20:37 ` [PATCH 3/4] thermal: exynos: " Julia Lawall
2017-08-05 20:37   ` Julia Lawall
2017-08-05 20:37   ` Julia Lawall
2017-08-07 15:21   ` Bartlomiej Zolnierkiewicz
2017-08-07 15:21     ` Bartlomiej Zolnierkiewicz
2017-08-07 15:21     ` Bartlomiej Zolnierkiewicz
2017-08-05 20:37 ` [PATCH 4/4] thermal: bcm2835: " Julia Lawall
2017-08-05 20:37   ` Julia Lawall
2017-08-05 20:37   ` Julia Lawall
2017-08-07  6:41   ` Stefan Wahren
2017-08-07  6:41     ` Stefan Wahren
2017-08-07  6:41     ` Stefan Wahren
2017-08-08 13:43 ` [PATCH 0/4] " Zhang Rui
2017-08-08 13:43   ` Zhang Rui
2017-08-08 13:43   ` Zhang Rui
2017-08-08 13:46   ` Julia Lawall
2017-08-08 13:46     ` Julia Lawall
2017-08-08 13:46     ` Julia Lawall

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.