linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] constify clk_ops structure
@ 2018-10-27  5:47 Julia Lawall
  2018-10-27  5:47 ` [PATCH 1/8] clk: max77686: " Julia Lawall
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Julia Lawall @ 2018-10-27  5:47 UTC (permalink / raw)
  To: dri-devel
  Cc: kernel-janitors, linux-clk, linux-kernel, linux-arm-kernel,
	linux-samsung-soc, linux-arm-msm, freedreno

Declare as const clk_ops structures that are only stored in const fields or
passed to functions with const parameters.

Identified and transformed using Coccinelle.

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

---

 arch/arm/mach-vexpress/spc.c             |    2 +-
 drivers/clk/clk-max77686.c               |    2 +-
 drivers/clk/clk-palmas.c                 |    2 +-
 drivers/clk/clk-s2mps11.c                |    2 +-
 drivers/clk/pistachio/clk-pll.c          |    8 ++++----
 drivers/clk/pxa/clk-pxa.c                |    4 ++--
 drivers/gpu/drm/imx/imx-tve.c            |    2 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8996.c |    2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

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

* [PATCH 1/8] clk: max77686: constify clk_ops structure
  2018-10-27  5:47 [PATCH 0/8] constify clk_ops structure Julia Lawall
@ 2018-10-27  5:47 ` Julia Lawall
  2018-10-29  7:49   ` Krzysztof Kozlowski
  2018-11-06 17:41   ` Stephen Boyd
  2018-10-27  5:47 ` [PATCH 3/8] clk: palmas: " Julia Lawall
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Julia Lawall @ 2018-10-27  5:47 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: kernel-janitors, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Michael Turquette, Stephen Boyd, linux-kernel, linux-clk

The clk_ops structure is only stored in the ops field of a
clk_init_data structure.  This field is const, so the clk_ops
structure can be const as well.

Identified and transformed using Coccinelle.

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

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

diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
index 02551fe4b87c..22c937644c93 100644
--- a/drivers/clk/clk-max77686.c
+++ b/drivers/clk/clk-max77686.c
@@ -137,7 +137,7 @@ static unsigned long max77686_recalc_rate(struct clk_hw *hw,
 	return 32768;
 }
 
-static struct clk_ops max77686_clk_ops = {
+static const struct clk_ops max77686_clk_ops = {
 	.prepare	= max77686_clk_prepare,
 	.unprepare	= max77686_clk_unprepare,
 	.is_prepared	= max77686_clk_is_prepared,


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

* [PATCH 3/8] clk: palmas: constify clk_ops structure
  2018-10-27  5:47 [PATCH 0/8] constify clk_ops structure Julia Lawall
  2018-10-27  5:47 ` [PATCH 1/8] clk: max77686: " Julia Lawall
@ 2018-10-27  5:47 ` Julia Lawall
  2018-11-06 17:42   ` Stephen Boyd
  2018-10-27  5:47 ` [PATCH 4/8] clk: pistachio: constify clk_ops structures Julia Lawall
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2018-10-27  5:47 UTC (permalink / raw)
  To: Michael Turquette; +Cc: kernel-janitors, Stephen Boyd, linux-clk, linux-kernel

The clk_ops structure is only stored in the ops field of clk_init_data
structures.  This field is const, so the clk_ops structure can be
const as well.

Identified and transformed using Coccinelle.

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

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

diff --git a/drivers/clk/clk-palmas.c b/drivers/clk/clk-palmas.c
index e9612e7068e9..e41a3a9f7528 100644
--- a/drivers/clk/clk-palmas.c
+++ b/drivers/clk/clk-palmas.c
@@ -115,7 +115,7 @@ static int palmas_clks_is_prepared(struct clk_hw *hw)
 	return !!(val & cinfo->clk_desc->enable_mask);
 }
 
-static struct clk_ops palmas_clks_ops = {
+static const struct clk_ops palmas_clks_ops = {
 	.prepare	= palmas_clks_prepare,
 	.unprepare	= palmas_clks_unprepare,
 	.is_prepared	= palmas_clks_is_prepared,


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

* [PATCH 4/8] clk: pistachio: constify clk_ops structures
  2018-10-27  5:47 [PATCH 0/8] constify clk_ops structure Julia Lawall
  2018-10-27  5:47 ` [PATCH 1/8] clk: max77686: " Julia Lawall
  2018-10-27  5:47 ` [PATCH 3/8] clk: palmas: " Julia Lawall
@ 2018-10-27  5:47 ` Julia Lawall
  2018-11-06 17:42   ` Stephen Boyd
  2018-10-27  5:47 ` [PATCH 5/8] clk: pxa: " Julia Lawall
  2018-10-27  5:47 ` [PATCH 6/8] clk: s2mps11: constify clk_ops structure Julia Lawall
  4 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2018-10-27  5:47 UTC (permalink / raw)
  To: Michael Turquette; +Cc: kernel-janitors, Stephen Boyd, linux-clk, linux-kernel

These clk_ops structures are only stored in the ops field of a
clk_init_data structure.  This field is const, so the clk_ops
structures can be const as well.

Identified and transformed using Coccinelle.

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

---
 drivers/clk/pistachio/clk-pll.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/pistachio/clk-pll.c b/drivers/clk/pistachio/clk-pll.c
index 7e8daab9025b..312c3580187f 100644
--- a/drivers/clk/pistachio/clk-pll.c
+++ b/drivers/clk/pistachio/clk-pll.c
@@ -298,7 +298,7 @@ static unsigned long pll_gf40lp_frac_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static struct clk_ops pll_gf40lp_frac_ops = {
+static const struct clk_ops pll_gf40lp_frac_ops = {
 	.enable = pll_gf40lp_frac_enable,
 	.disable = pll_gf40lp_frac_disable,
 	.is_enabled = pll_gf40lp_frac_is_enabled,
@@ -307,7 +307,7 @@ static struct clk_ops pll_gf40lp_frac_ops = {
 	.set_rate = pll_gf40lp_frac_set_rate,
 };
 
-static struct clk_ops pll_gf40lp_frac_fixed_ops = {
+static const struct clk_ops pll_gf40lp_frac_fixed_ops = {
 	.enable = pll_gf40lp_frac_enable,
 	.disable = pll_gf40lp_frac_disable,
 	.is_enabled = pll_gf40lp_frac_is_enabled,
@@ -430,7 +430,7 @@ static unsigned long pll_gf40lp_laint_recalc_rate(struct clk_hw *hw,
 	return rate;
 }
 
-static struct clk_ops pll_gf40lp_laint_ops = {
+static const struct clk_ops pll_gf40lp_laint_ops = {
 	.enable = pll_gf40lp_laint_enable,
 	.disable = pll_gf40lp_laint_disable,
 	.is_enabled = pll_gf40lp_laint_is_enabled,
@@ -439,7 +439,7 @@ static struct clk_ops pll_gf40lp_laint_ops = {
 	.set_rate = pll_gf40lp_laint_set_rate,
 };
 
-static struct clk_ops pll_gf40lp_laint_fixed_ops = {
+static const struct clk_ops pll_gf40lp_laint_fixed_ops = {
 	.enable = pll_gf40lp_laint_enable,
 	.disable = pll_gf40lp_laint_disable,
 	.is_enabled = pll_gf40lp_laint_is_enabled,


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

* [PATCH 5/8] clk: pxa: constify clk_ops structures
  2018-10-27  5:47 [PATCH 0/8] constify clk_ops structure Julia Lawall
                   ` (2 preceding siblings ...)
  2018-10-27  5:47 ` [PATCH 4/8] clk: pistachio: constify clk_ops structures Julia Lawall
@ 2018-10-27  5:47 ` Julia Lawall
  2018-11-06 17:42   ` Stephen Boyd
  2018-10-27  5:47 ` [PATCH 6/8] clk: s2mps11: constify clk_ops structure Julia Lawall
  4 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2018-10-27  5:47 UTC (permalink / raw)
  To: Michael Turquette; +Cc: kernel-janitors, Stephen Boyd, linux-clk, linux-kernel

These clk_ops structures are only passed to a call to
clk_register_composite where the corresponding parameters
are const, so the clk_ops structure can be const as well.

Identified and transformed using Coccinelle.

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

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

diff --git a/drivers/clk/pxa/clk-pxa.c b/drivers/clk/pxa/clk-pxa.c
index b80dc9d5855c..42627bf8a09e 100644
--- a/drivers/clk/pxa/clk-pxa.c
+++ b/drivers/clk/pxa/clk-pxa.c
@@ -70,7 +70,7 @@ static unsigned long cken_recalc_rate(struct clk_hw *hw,
 	return clk_fixed_factor_ops.recalc_rate(&fix->hw, parent_rate);
 }
 
-static struct clk_ops cken_rate_ops = {
+static const struct clk_ops cken_rate_ops = {
 	.recalc_rate = cken_recalc_rate,
 };
 
@@ -83,7 +83,7 @@ static u8 cken_get_parent(struct clk_hw *hw)
 	return pclk->is_in_low_power() ? 0 : 1;
 }
 
-static struct clk_ops cken_mux_ops = {
+static const struct clk_ops cken_mux_ops = {
 	.get_parent = cken_get_parent,
 	.set_parent = dummy_clk_set_parent,
 };


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

* [PATCH 6/8] clk: s2mps11: constify clk_ops structure
  2018-10-27  5:47 [PATCH 0/8] constify clk_ops structure Julia Lawall
                   ` (3 preceding siblings ...)
  2018-10-27  5:47 ` [PATCH 5/8] clk: pxa: " Julia Lawall
@ 2018-10-27  5:47 ` Julia Lawall
  2018-10-29  0:43   ` Chanwoo Choi
  2018-11-06 17:43   ` Stephen Boyd
  4 siblings, 2 replies; 13+ messages in thread
From: Julia Lawall @ 2018-10-27  5:47 UTC (permalink / raw)
  To: Sangbeom Kim
  Cc: kernel-janitors, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Michael Turquette, Stephen Boyd, linux-kernel, linux-samsung-soc,
	linux-clk

The clk_ops structure is only stored in the ops fields of
clk_init_data structures.  This field is const, so the clk_ops
structure can be const as well.

Identified and transformed using Coccinelle.

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

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

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 5b419b82f7ca..2ce370c804aa 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -71,7 +71,7 @@ static unsigned long s2mps11_clk_recalc_rate(struct clk_hw *hw,
 	return 32768;
 }
 
-static struct clk_ops s2mps11_clk_ops = {
+static const struct clk_ops s2mps11_clk_ops = {
 	.prepare	= s2mps11_clk_prepare,
 	.unprepare	= s2mps11_clk_unprepare,
 	.is_prepared	= s2mps11_clk_is_prepared,


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

* Re: [PATCH 6/8] clk: s2mps11: constify clk_ops structure
  2018-10-27  5:47 ` [PATCH 6/8] clk: s2mps11: constify clk_ops structure Julia Lawall
@ 2018-10-29  0:43   ` Chanwoo Choi
  2018-11-06 17:43   ` Stephen Boyd
  1 sibling, 0 replies; 13+ messages in thread
From: Chanwoo Choi @ 2018-10-29  0:43 UTC (permalink / raw)
  To: Julia Lawall, Sangbeom Kim
  Cc: kernel-janitors, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Michael Turquette, Stephen Boyd, linux-kernel, linux-samsung-soc,
	linux-clk

On 2018년 10월 27일 14:47, Julia Lawall wrote:
> The clk_ops structure is only stored in the ops fields of
> clk_init_data structures.  This field is const, so the clk_ops
> structure can be const as well.
> 
> Identified and transformed using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/clk/clk-s2mps11.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
> index 5b419b82f7ca..2ce370c804aa 100644
> --- a/drivers/clk/clk-s2mps11.c
> +++ b/drivers/clk/clk-s2mps11.c
> @@ -71,7 +71,7 @@ static unsigned long s2mps11_clk_recalc_rate(struct clk_hw *hw,
>  	return 32768;
>  }
>  
> -static struct clk_ops s2mps11_clk_ops = {
> +static const struct clk_ops s2mps11_clk_ops = {
>  	.prepare	= s2mps11_clk_prepare,
>  	.unprepare	= s2mps11_clk_unprepare,
>  	.is_prepared	= s2mps11_clk_is_prepared,
> 
> 
> 

Looks good to me.
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

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

* Re: [PATCH 1/8] clk: max77686: constify clk_ops structure
  2018-10-27  5:47 ` [PATCH 1/8] clk: max77686: " Julia Lawall
@ 2018-10-29  7:49   ` Krzysztof Kozlowski
  2018-11-06 17:41   ` Stephen Boyd
  1 sibling, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2018-10-29  7:49 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: Chanwoo Choi, kernel-janitors,
	Bartłomiej Żołnierkiewicz, mturquette, sboyd,
	linux-kernel, linux-clk

On Sat, 27 Oct 2018 at 08:23, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
>
> The clk_ops structure is only stored in the ops field of a
> clk_init_data structure.  This field is const, so the clk_ops
> structure can be const as well.
>
> Identified and transformed using Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/clk/clk-max77686.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Re: [PATCH 1/8] clk: max77686: constify clk_ops structure
  2018-10-27  5:47 ` [PATCH 1/8] clk: max77686: " Julia Lawall
  2018-10-29  7:49   ` Krzysztof Kozlowski
@ 2018-11-06 17:41   ` Stephen Boyd
  1 sibling, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2018-11-06 17:41 UTC (permalink / raw)
  To: Chanwoo Choi, Julia Lawall
  Cc: kernel-janitors, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Michael Turquette, linux-kernel, linux-clk

Quoting Julia Lawall (2018-10-26 22:47:35)
> The clk_ops structure is only stored in the ops field of a
> clk_init_data structure.  This field is const, so the clk_ops
> structure can be const as well.
> 
> Identified and transformed using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Applied to clk-next


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

* Re: [PATCH 3/8] clk: palmas: constify clk_ops structure
  2018-10-27  5:47 ` [PATCH 3/8] clk: palmas: " Julia Lawall
@ 2018-11-06 17:42   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2018-11-06 17:42 UTC (permalink / raw)
  To: Julia Lawall, Michael Turquette; +Cc: kernel-janitors, linux-clk, linux-kernel

Quoting Julia Lawall (2018-10-26 22:47:37)
> The clk_ops structure is only stored in the ops field of clk_init_data
> structures.  This field is const, so the clk_ops structure can be
> const as well.
> 
> Identified and transformed using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Applied to clk-next


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

* Re: [PATCH 4/8] clk: pistachio: constify clk_ops structures
  2018-10-27  5:47 ` [PATCH 4/8] clk: pistachio: constify clk_ops structures Julia Lawall
@ 2018-11-06 17:42   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2018-11-06 17:42 UTC (permalink / raw)
  To: Julia Lawall, Michael Turquette; +Cc: kernel-janitors, linux-clk, linux-kernel

Quoting Julia Lawall (2018-10-26 22:47:38)
> These clk_ops structures are only stored in the ops field of a
> clk_init_data structure.  This field is const, so the clk_ops
> structures can be const as well.
> 
> Identified and transformed using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Applied to clk-next


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

* Re: [PATCH 5/8] clk: pxa: constify clk_ops structures
  2018-10-27  5:47 ` [PATCH 5/8] clk: pxa: " Julia Lawall
@ 2018-11-06 17:42   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2018-11-06 17:42 UTC (permalink / raw)
  To: Julia Lawall, Michael Turquette; +Cc: kernel-janitors, linux-clk, linux-kernel

Quoting Julia Lawall (2018-10-26 22:47:39)
> These clk_ops structures are only passed to a call to
> clk_register_composite where the corresponding parameters
> are const, so the clk_ops structure can be const as well.
> 
> Identified and transformed using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Applied to clk-next


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

* Re: [PATCH 6/8] clk: s2mps11: constify clk_ops structure
  2018-10-27  5:47 ` [PATCH 6/8] clk: s2mps11: constify clk_ops structure Julia Lawall
  2018-10-29  0:43   ` Chanwoo Choi
@ 2018-11-06 17:43   ` Stephen Boyd
  1 sibling, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2018-11-06 17:43 UTC (permalink / raw)
  To: Julia Lawall, Sangbeom Kim
  Cc: kernel-janitors, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Michael Turquette, linux-kernel, linux-samsung-soc, linux-clk

Quoting Julia Lawall (2018-10-26 22:47:40)
> The clk_ops structure is only stored in the ops fields of
> clk_init_data structures.  This field is const, so the clk_ops
> structure can be const as well.
> 
> Identified and transformed using Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Applied to clk-next


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

end of thread, other threads:[~2018-11-06 17:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-27  5:47 [PATCH 0/8] constify clk_ops structure Julia Lawall
2018-10-27  5:47 ` [PATCH 1/8] clk: max77686: " Julia Lawall
2018-10-29  7:49   ` Krzysztof Kozlowski
2018-11-06 17:41   ` Stephen Boyd
2018-10-27  5:47 ` [PATCH 3/8] clk: palmas: " Julia Lawall
2018-11-06 17:42   ` Stephen Boyd
2018-10-27  5:47 ` [PATCH 4/8] clk: pistachio: constify clk_ops structures Julia Lawall
2018-11-06 17:42   ` Stephen Boyd
2018-10-27  5:47 ` [PATCH 5/8] clk: pxa: " Julia Lawall
2018-11-06 17:42   ` Stephen Boyd
2018-10-27  5:47 ` [PATCH 6/8] clk: s2mps11: constify clk_ops structure Julia Lawall
2018-10-29  0:43   ` Chanwoo Choi
2018-11-06 17:43   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).