linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] CLK: SPEAr: make structure field, function arg and strutcure const
@ 2017-10-17 14:38 Bhumika Goyal
  2017-10-17 14:38 ` [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const Bhumika Goyal
  2017-10-17 14:38 ` [PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const Bhumika Goyal
  0 siblings, 2 replies; 7+ messages in thread
From: Bhumika Goyal @ 2017-10-17 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

Make structure field and function argument as const. After this change, 
make the structures as const.

Bhumika Goyal (2):
  CLK: SPEAr: make structure field and function argument as const
  CLK: SPEAr: make aux_clk_masks structures const

 drivers/clk/spear/clk-aux-synth.c   | 4 ++--
 drivers/clk/spear/clk.h             | 4 ++--
 drivers/clk/spear/spear1310_clock.c | 2 +-
 drivers/clk/spear/spear1340_clock.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

-- 
1.9.1

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

* [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const
  2017-10-17 14:38 [PATCH 0/2] CLK: SPEAr: make structure field, function arg and strutcure const Bhumika Goyal
@ 2017-10-17 14:38 ` Bhumika Goyal
  2017-10-17 14:42   ` Julia Lawall
  2017-11-02  6:22   ` Stephen Boyd
  2017-10-17 14:38 ` [PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const Bhumika Goyal
  1 sibling, 2 replies; 7+ messages in thread
From: Bhumika Goyal @ 2017-10-17 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

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;
 	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

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

* [PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const
  2017-10-17 14:38 [PATCH 0/2] CLK: SPEAr: make structure field, function arg and strutcure const Bhumika Goyal
  2017-10-17 14:38 ` [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const Bhumika Goyal
@ 2017-10-17 14:38 ` Bhumika Goyal
  2017-10-18  3:47   ` Viresh Kumar
  1 sibling, 1 reply; 7+ messages in thread
From: Bhumika Goyal @ 2017-10-17 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

Make these const as they are either stored in the masks 'const' field
of a clk_aux structure or passed to the function clk_register_aux 
having the argument as const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/clk/spear/clk-aux-synth.c   | 2 +-
 drivers/clk/spear/spear1310_clock.c | 2 +-
 drivers/clk/spear/spear1340_clock.c | 2 +-
 3 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 8bea5df..2f145e3 100644
--- a/drivers/clk/spear/clk-aux-synth.c
+++ b/drivers/clk/spear/clk-aux-synth.c
@@ -29,7 +29,7 @@
 
 #define to_clk_aux(_hw) container_of(_hw, struct clk_aux, hw)
 
-static struct aux_clk_masks default_aux_masks = {
+static const  struct aux_clk_masks default_aux_masks = {
 	.eq_sel_mask = AUX_EQ_SEL_MASK,
 	.eq_sel_shift = AUX_EQ_SEL_SHIFT,
 	.eq1_mask = AUX_EQ1_SEL,
diff --git a/drivers/clk/spear/spear1310_clock.c b/drivers/clk/spear/spear1310_clock.c
index 2f86e3f..591248c 100644
--- a/drivers/clk/spear/spear1310_clock.c
+++ b/drivers/clk/spear/spear1310_clock.c
@@ -284,7 +284,7 @@
 };
 
 /* i2s prescaler1 masks */
-static struct aux_clk_masks i2s_prs1_masks = {
+static const struct aux_clk_masks i2s_prs1_masks = {
 	.eq_sel_mask = AUX_EQ_SEL_MASK,
 	.eq_sel_shift = SPEAR1310_I2S_PRS1_EQ_SEL_SHIFT,
 	.eq1_mask = AUX_EQ1_SEL,
diff --git a/drivers/clk/spear/spear1340_clock.c b/drivers/clk/spear/spear1340_clock.c
index cbb19a9..e5bc8c8 100644
--- a/drivers/clk/spear/spear1340_clock.c
+++ b/drivers/clk/spear/spear1340_clock.c
@@ -323,7 +323,7 @@
 };
 
 /* i2s prescaler1 masks */
-static struct aux_clk_masks i2s_prs1_masks = {
+static const struct aux_clk_masks i2s_prs1_masks = {
 	.eq_sel_mask = AUX_EQ_SEL_MASK,
 	.eq_sel_shift = SPEAR1340_I2S_PRS1_EQ_SEL_SHIFT,
 	.eq1_mask = AUX_EQ1_SEL,
-- 
1.9.1

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

* [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const
  2017-10-17 14:38 ` [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const Bhumika Goyal
@ 2017-10-17 14:42   ` Julia Lawall
  2017-10-18  3:48     ` Viresh Kumar
  2017-11-02  6:22   ` Stephen Boyd
  1 sibling, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2017-10-17 14:42 UTC (permalink / raw)
  To: linux-arm-kernel



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
>
>

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

* [PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const
  2017-10-17 14:38 ` [PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const Bhumika Goyal
@ 2017-10-18  3:47   ` Viresh Kumar
  0 siblings, 0 replies; 7+ messages in thread
From: Viresh Kumar @ 2017-10-18  3:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 17-10-17, 16:38, Bhumika Goyal wrote:
> Make these const as they are either stored in the masks 'const' field
> of a clk_aux structure or passed to the function clk_register_aux 
> having the argument as const.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>  drivers/clk/spear/clk-aux-synth.c   | 2 +-
>  drivers/clk/spear/spear1310_clock.c | 2 +-
>  drivers/clk/spear/spear1340_clock.c | 2 +-
>  3 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 8bea5df..2f145e3 100644
> --- a/drivers/clk/spear/clk-aux-synth.c
> +++ b/drivers/clk/spear/clk-aux-synth.c
> @@ -29,7 +29,7 @@
>  
>  #define to_clk_aux(_hw) container_of(_hw, struct clk_aux, hw)
>  
> -static struct aux_clk_masks default_aux_masks = {
> +static const  struct aux_clk_masks default_aux_masks = {
>  	.eq_sel_mask = AUX_EQ_SEL_MASK,
>  	.eq_sel_shift = AUX_EQ_SEL_SHIFT,
>  	.eq1_mask = AUX_EQ1_SEL,
> diff --git a/drivers/clk/spear/spear1310_clock.c b/drivers/clk/spear/spear1310_clock.c
> index 2f86e3f..591248c 100644
> --- a/drivers/clk/spear/spear1310_clock.c
> +++ b/drivers/clk/spear/spear1310_clock.c
> @@ -284,7 +284,7 @@
>  };
>  
>  /* i2s prescaler1 masks */
> -static struct aux_clk_masks i2s_prs1_masks = {
> +static const struct aux_clk_masks i2s_prs1_masks = {
>  	.eq_sel_mask = AUX_EQ_SEL_MASK,
>  	.eq_sel_shift = SPEAR1310_I2S_PRS1_EQ_SEL_SHIFT,
>  	.eq1_mask = AUX_EQ1_SEL,
> diff --git a/drivers/clk/spear/spear1340_clock.c b/drivers/clk/spear/spear1340_clock.c
> index cbb19a9..e5bc8c8 100644
> --- a/drivers/clk/spear/spear1340_clock.c
> +++ b/drivers/clk/spear/spear1340_clock.c
> @@ -323,7 +323,7 @@
>  };
>  
>  /* i2s prescaler1 masks */
> -static struct aux_clk_masks i2s_prs1_masks = {
> +static const struct aux_clk_masks i2s_prs1_masks = {
>  	.eq_sel_mask = AUX_EQ_SEL_MASK,
>  	.eq_sel_shift = SPEAR1340_I2S_PRS1_EQ_SEL_SHIFT,
>  	.eq1_mask = AUX_EQ1_SEL,

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const
  2017-10-17 14:42   ` Julia Lawall
@ 2017-10-18  3:48     ` Viresh Kumar
  0 siblings, 0 replies; 7+ messages in thread
From: Viresh Kumar @ 2017-10-18  3:48 UTC (permalink / raw)
  To: linux-arm-kernel

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>

-- 
viresh

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

* [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const
  2017-10-17 14:38 ` [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const Bhumika Goyal
  2017-10-17 14:42   ` Julia Lawall
@ 2017-11-02  6:22   ` Stephen Boyd
  1 sibling, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2017-11-02  6:22 UTC (permalink / raw)
  To: linux-arm-kernel

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

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2017-11-02  6:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17 14:38 [PATCH 0/2] CLK: SPEAr: make structure field, function arg and strutcure const Bhumika Goyal
2017-10-17 14:38 ` [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const Bhumika Goyal
2017-10-17 14:42   ` Julia Lawall
2017-10-18  3:48     ` Viresh Kumar
2017-11-02  6:22   ` Stephen Boyd
2017-10-17 14:38 ` [PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const Bhumika Goyal
2017-10-18  3:47   ` Viresh Kumar

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).