diff mbox series

[6/8] clk: s2mps11: constify clk_ops structure

Message ID 1540619262-22681-7-git-send-email-Julia.Lawall@lip6.fr (mailing list archive)
State Accepted, archived
Headers show
Series constify clk_ops structure | expand

Commit Message

Julia Lawall Oct. 27, 2018, 5:47 a.m. UTC
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(-)

Comments

Chanwoo Choi Oct. 29, 2018, 12:43 a.m. UTC | #1
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>
Stephen Boyd Nov. 6, 2018, 5:43 p.m. UTC | #2
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
diff mbox series

Patch

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,