CLK: SPEAr: make structure field, function arg and strutcure const
Subsystems (2)
cover CLK: SPEAr: make structure field, function arg and strutcure const
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(-)
Signature · 1 line
1.9.1
PATCH 1/2 CLK: SPEAr: make structure field and function argument as const
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.
--- drivers/clk/spear/clk-aux-synth.c | 2 +- drivers/clk/spear/clk.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/clk/spear/clk-aux-synth.c +1 -1
@@ -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;
drivers/clk/spear/clk.h +2 -2
@@ -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,
Signature · 1 line
1.9.1
Re: [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const
Quoted 31 lines · Bhumika Goyal
Make the masks field of
clk_auxstructure const as it do not modify the fields of theaux_clk_masksstructure it points to.Make the struct
aux_clk_masks*aux argument of the functionclk_register_auxas const as the argument is only stored in the masks field of aclk_auxstructure which is now made const.Signed-off-by Bhumika Goyal <[email protected]>--- drivers/clk/spear/clk-aux-synth.c | 2 +- drivers/clk/spear/clk.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/clk/spear/clk-aux-synth.c +1
-1@@ -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;drivers/clk/spear/clk.h +0
-0
drivers/clk/spear/clk.h struct aux_rate_tbl { · line 52
Quoted 5 lines
drivers/clk/spear/clk.h +1
-1@@ -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
Quoted 16 lines
drivers/clk/spear/clk.h +1
-2struct 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
Viresh Kumar
Acked-byRe: [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const
Quoted 34 lines · Julia Lawall
Quoted 30 lines · Bhumika Goyal
Make the masks field of
clk_auxstructure const as it do not modify the fields of theaux_clk_masksstructure it points to.Make the struct
aux_clk_masks*aux argument of the functionclk_register_auxas const as the argument is only stored in the masks field of aclk_auxstructure which is now made const.Signed-off-by Bhumika Goyal <[email protected]>--- drivers/clk/spear/clk-aux-synth.c | 2 +- drivers/clk/spear/clk.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/clk/spear/clk-aux-synth.c +1
-1@@ -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;drivers/clk/spear/clk.h +0
-0
Quoted 8 lines
drivers/clk/spear/clk.h struct aux_rate_tbl { · line 52
Quoted 6 lines
drivers/clk/spear/clk.h +1
-1@@ -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:
Signature · 1 line
viresh
Stephen Boyd
AppliedRe: [PATCH 1/2] CLK: SPEAr: make structure field and function argument as const
In reply to Bhumika GoyalQuoted 9 lines · Bhumika Goyal
Make the masks field of
clk_auxstructure const as it do not modify the fields of theaux_clk_masksstructure it points to.Make the struct
aux_clk_masks*aux argument of the functionclk_register_auxas const as the argument is only stored in the masks field of aclk_auxstructure which is now made const.Signed-off-by Bhumika Goyal <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 2/2 CLK: SPEAr: make aux_clk_masks structures const
In reply to Bhumika GoyalMake 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.
--- 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(-)
drivers/clk/spear/clk-aux-synth.c +1 -1
@@ -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 ,
drivers/clk/spear/spear1310_clock.c +1 -1
@@ -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 ,
drivers/clk/spear/spear1340_clock.c +1 -1
@@ -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 ,
Signature · 1 line
1.9.1
Re: [PATCH 2/2] CLK: SPEAr: make aux_clk_masks structures const
Quoted 42 lines · Bhumika Goyal
Make these const as they are either stored in the masks 'const' field of a
clk_auxstructure or passed to the functionclk_register_auxhaving the argument as const.Signed-off-by Bhumika Goyal <[email protected]>--- 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(-)drivers/clk/spear/clk-aux-synth.c +1
-1@@ -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 ,drivers/clk/spear/spear1310_clock.c +1
-1@@ -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 ,drivers/clk/spear/spear1340_clock.c +0
-0
drivers/clk/spear/spear1340_clock.c line 329
Quoted 8 lines
drivers/clk/spear/spear1340_clock.c +1
-1@@ -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 ,
Signature · 1 line
viresh