diff mbox

[1/2] CLK: SPEAr: make structure field and function argument as const

Message ID 1508251114-7042-2-git-send-email-bhumirks@gmail.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Bhumika Goyal Oct. 17, 2017, 2:38 p.m. UTC
Make the masks field of clk_aux structure const as it do not modify the
fields of the aux_clk_masks structure it points to.

Make the struct aux_clk_masks *aux argument of the function
clk_register_aux as const as the argument is only stored in the masks
field of a clk_aux structure which is now made const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/clk/spear/clk-aux-synth.c | 2 +-
 drivers/clk/spear/clk.h           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Julia Lawall Oct. 17, 2017, 2:42 p.m. UTC | #1
On Tue, 17 Oct 2017, Bhumika Goyal wrote:

> Make the masks field of clk_aux structure const as it do not modify the
> fields of the aux_clk_masks structure it points to.
>
> Make the struct aux_clk_masks *aux argument of the function
> clk_register_aux as const as the argument is only stored in the masks
> field of a clk_aux structure which is now made const.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>  drivers/clk/spear/clk-aux-synth.c | 2 +-
>  drivers/clk/spear/clk.h           | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c
> index f271c35..8bea5df 100644
> --- a/drivers/clk/spear/clk-aux-synth.c
> +++ b/drivers/clk/spear/clk-aux-synth.c
> @@ -136,7 +136,7 @@ static int clk_aux_set_rate(struct clk_hw *hw, unsigned long drate,
>
>  struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
>  		const char *parent_name, unsigned long flags, void __iomem *reg,
> -		struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
> +	        const struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
>  		u8 rtbl_cnt, spinlock_t *lock, struct clk **gate_clk)
>  {
>  	struct clk_aux *aux;
> diff --git a/drivers/clk/spear/clk.h b/drivers/clk/spear/clk.h
> index 9834944..b9d28b3 100644
> --- a/drivers/clk/spear/clk.h
> +++ b/drivers/clk/spear/clk.h
> @@ -49,7 +49,7 @@ struct aux_rate_tbl {
>  struct clk_aux {
>  	struct			clk_hw hw;
>  	void __iomem		*reg;
> -	struct aux_clk_masks	*masks;
> +        const struct aux_clk_masks *masks;

There are spaces before const here.

julia

>  	struct aux_rate_tbl	*rtbl;
>  	u8			rtbl_cnt;
>  	spinlock_t		*lock;
> @@ -112,7 +112,7 @@ typedef unsigned long (*clk_calc_rate)(struct clk_hw *hw, unsigned long prate,
>  /* clk register routines */
>  struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
>  		const char *parent_name, unsigned long flags, void __iomem *reg,
> -		struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
> +		const struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
>  		u8 rtbl_cnt, spinlock_t *lock, struct clk **gate_clk);
>  struct clk *clk_register_frac(const char *name, const char *parent_name,
>  		unsigned long flags, void __iomem *reg,
> --
> 1.9.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Viresh Kumar Oct. 18, 2017, 3:48 a.m. UTC | #2
On 17-10-17, 16:42, Julia Lawall wrote:
> 
> 
> On Tue, 17 Oct 2017, Bhumika Goyal wrote:
> 
> > Make the masks field of clk_aux structure const as it do not modify the
> > fields of the aux_clk_masks structure it points to.
> >
> > Make the struct aux_clk_masks *aux argument of the function
> > clk_register_aux as const as the argument is only stored in the masks
> > field of a clk_aux structure which is now made const.
> >
> > Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> > ---
> >  drivers/clk/spear/clk-aux-synth.c | 2 +-
> >  drivers/clk/spear/clk.h           | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c
> > index f271c35..8bea5df 100644
> > --- a/drivers/clk/spear/clk-aux-synth.c
> > +++ b/drivers/clk/spear/clk-aux-synth.c
> > @@ -136,7 +136,7 @@ static int clk_aux_set_rate(struct clk_hw *hw, unsigned long drate,
> >
> >  struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
> >  		const char *parent_name, unsigned long flags, void __iomem *reg,
> > -		struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
> > +	        const struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
> >  		u8 rtbl_cnt, spinlock_t *lock, struct clk **gate_clk)
> >  {
> >  	struct clk_aux *aux;
> > diff --git a/drivers/clk/spear/clk.h b/drivers/clk/spear/clk.h
> > index 9834944..b9d28b3 100644
> > --- a/drivers/clk/spear/clk.h
> > +++ b/drivers/clk/spear/clk.h
> > @@ -49,7 +49,7 @@ struct aux_rate_tbl {
> >  struct clk_aux {
> >  	struct			clk_hw hw;
> >  	void __iomem		*reg;
> > -	struct aux_clk_masks	*masks;
> > +        const struct aux_clk_masks *masks;
> 
> There are spaces before const here.

Fix that and add my:

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Stephen Boyd Nov. 2, 2017, 6:22 a.m. UTC | #3
On 10/17, Bhumika Goyal wrote:
> Make the masks field of clk_aux structure const as it do not modify the
> fields of the aux_clk_masks structure it points to.
> 
> Make the struct aux_clk_masks *aux argument of the function
> clk_register_aux as const as the argument is only stored in the masks
> field of a clk_aux structure which is now made const.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---

Applied to clk-next
diff mbox

Patch

diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c
index f271c35..8bea5df 100644
--- a/drivers/clk/spear/clk-aux-synth.c
+++ b/drivers/clk/spear/clk-aux-synth.c
@@ -136,7 +136,7 @@  static int clk_aux_set_rate(struct clk_hw *hw, unsigned long drate,
 
 struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
 		const char *parent_name, unsigned long flags, void __iomem *reg,
-		struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
+	        const struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
 		u8 rtbl_cnt, spinlock_t *lock, struct clk **gate_clk)
 {
 	struct clk_aux *aux;
diff --git a/drivers/clk/spear/clk.h b/drivers/clk/spear/clk.h
index 9834944..b9d28b3 100644
--- a/drivers/clk/spear/clk.h
+++ b/drivers/clk/spear/clk.h
@@ -49,7 +49,7 @@  struct aux_rate_tbl {
 struct clk_aux {
 	struct			clk_hw hw;
 	void __iomem		*reg;
-	struct aux_clk_masks	*masks;
+        const struct aux_clk_masks *masks;
 	struct aux_rate_tbl	*rtbl;
 	u8			rtbl_cnt;
 	spinlock_t		*lock;
@@ -112,7 +112,7 @@  typedef unsigned long (*clk_calc_rate)(struct clk_hw *hw, unsigned long prate,
 /* clk register routines */
 struct clk *clk_register_aux(const char *aux_name, const char *gate_name,
 		const char *parent_name, unsigned long flags, void __iomem *reg,
-		struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
+		const struct aux_clk_masks *masks, struct aux_rate_tbl *rtbl,
 		u8 rtbl_cnt, spinlock_t *lock, struct clk **gate_clk);
 struct clk *clk_register_frac(const char *name, const char *parent_name,
 		unsigned long flags, void __iomem *reg,