Fix compiler warnings in smartreflex.c
Subsystems (3)
PATCH 1/1 Fix compiler warnings in smartreflex.c
Fix these compiler warnings:
smartreflex.c:126: warning: initialization makes integer from pointer without a cast smartreflex.c:134: warning: initialization makes integer from pointer without a cast
--- arch/arm/mach-omap2/smartreflex.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/smartreflex.c +2 -2
@@ -123,7 +123,7 @@ static struct omap_sr sr1 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE), + .srbase_addr = (u32)OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE), };static struct omap_sr sr2 = {
@@ -131,7 +131,7 @@ static struct omap_sr sr2 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE), + .srbase_addr = (u32)OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE), };static struct sr_custom_clk sr1_custom_clk = {
Signature · 1 line
1.5.6
Quoted 14 lines · ext Sanjeev Premi
Fix these compiler warnings:
smartreflex.c:126: warning: initialization makes integer from pointer without a cast smartreflex.c:134: warning: initialization makes integer from pointer without a castSigned-off-by Sanjeev Premi <[email protected]>--- arch/arm/mach-omap2/smartreflex.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-omap2/smartreflex.c +0
-0
arch/arm/mach-omap2/smartreflex.c static struct omap_sr sr1 = { · line 126
Quoted 5 lines
arch/arm/mach-omap2/smartreflex.c +1
-1@@ -123,7 +123,7 @@ static struct omap_sr sr1 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE), + .srbase_addr = (u32)OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE),
please don't. Most likely srbase_addr should move to void __iomem *
Paul, any comments ??
Quoted 19 lines
arch/arm/mach-omap2/smartreflex.c +1
-1};static struct omap_sr sr2 = {@@ -131,7 +131,7 @@ static struct omap_sr sr2 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE), + .srbase_addr = (u32)OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE), };static struct sr_custom_clk sr1_custom_clk = {Signature · 6 lines
1.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
balbi
Quoted 23 lines · ext Felipe Balbi
Quoted 14 lines · ext Sanjeev Premi
Fix these compiler warnings:
smartreflex.c:126: warning: initialization makes integer from pointer without a cast smartreflex.c:134: warning: initialization makes integer from pointer without a castSigned-off-by Sanjeev Premi <[email protected]>--- arch/arm/mach-omap2/smartreflex.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-omap2/smartreflex.c +0
-0arch/arm/mach-omap2/smartreflex.c static struct omap_sr sr1 = { · line 126
Quoted 5 lines
arch/arm/mach-omap2/smartreflex.c +1
-1@@ -123,7 +123,7 @@ static struct omap_sr sr1 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE), + .srbase_addr = (u32)OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE),please don't. Most likely
srbase_addrshould move to void__iomem*
Quoted 1 line
Paul, any comments ??
Took a look at it, the following might be a better ?? (compile tested only)
arch/arm/mach-omap2/smartreflex.c +16 -16
@@ -43,32 +43,32 @@ struct omap_sr {int srid;int is_sr_reset;int is_autocomp_active; -struct clk *clk; -u32 clk_length; -u32 req_opp_no; -u32 opp1_nvalue, opp2_nvalue, opp3_nvalue, opp4_nvalue; +struct clk *clk; +u32 clk_length; +u32 req_opp_no; +u32 opp1_nvalue, opp2_nvalue, opp3_nvalue, opp4_nvalue;u32 opp5_nvalue;u32 senp_mod, senn_mod; -u32 srbase_addr; -u32 vpbase_addr; +void __iomem *srbase_addr; +void __iomem *vpbase_addr; };/* Custom clocks to enable SR specific enable/disable functions. */ struct sr_custom_clk { -struct clk clk;/* meta-clock with custom enable/disable calls */ -struct clk *fck;/* actual functional clock */ -struct omap_sr *sr; +struct clk clk;/* meta-clock with custom enable/disable calls */ +struct clk *fck;/* actual functional clock */ +struct omap_sr *sr; }; -#define SR_REGADDR (offs) (__force void __iomem *)(sr->srbase_addr + offset) +#define SR_REGADDR (offs) (sr->srbase_addr + offset) -static inline void sr_write_reg (struct omap_sr *sr,int offset,u32 value) +static inline void sr_write_reg (struct omap_sr *sr,unsigned offset,u32 value) {__raw_writel (value,SR_REGADDR (offset)); } -static inline void sr_modify_reg (struct omap_sr *sr,int offset,u32 mask, -u32 value) +static inline void sr_modify_reg (struct omap_sr *sr,unsigned offset,u32 mask, +u32 value) {u32 reg_val;
@@ -79,7 +79,7 @@ static inline void sr_modify_reg(struct omap_sr *sr, int offset, u32 mask,__raw_writel (reg_val,SR_REGADDR (offset)); } -static inline u32 sr_read_reg (struct omap_sr *sr,int offset) +static inline u32 sr_read_reg (struct omap_sr *sr,unsigned offset) {return __raw_readl (SR_REGADDR (offset)); }
@@ -136,7 +136,7 @@ static struct omap_sr sr2 = {static struct sr_custom_clk sr1_custom_clk = { .clk = { - .name ="sr1_custom_clk" , + .name ="sr1_custom_clk" , .enable = sr_clk_enable, .disable = sr_clk_disable, },
@@ -145,7 +145,7 @@ static struct sr_custom_clk sr1_custom_clk = {static struct sr_custom_clk sr2_custom_clk = { .clk = { - .name ="sr2_custom_clk" , + .name ="sr2_custom_clk" , .enable = sr_clk_enable, .disable = sr_clk_disable, },
Quoted 27 lines
Quoted 20 lines
arch/arm/mach-omap2/smartreflex.c +1
-1};static struct omap_sr sr2 = {@@ -131,7 +131,7 @@ static struct omap_sr sr2 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE), + .srbase_addr = (u32)OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE), };static struct sr_custom_clk sr1_custom_clk = {Signature · 6 lines
1.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlSignature · 5 lines
balbi -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
balbi
Quoted 35 lines
-----Original Message-----
From: Felipe Balbi [mailto:[email protected]]
Sent: Friday, October 10, 2008 6:24 PM
To: ext Felipe Balbi
Cc: Premi, Sanjeev; [email protected]; Paul Walmsley
Subject: Re: [PATCH] Fix compiler warnings insmartreflex.cQuoted 12 lines · ext Felipe Balbi
Quoted 11 lines · ext Sanjeev Premi
Fix these compiler warnings:
smartreflex.c:126: warning: initialization makes integer from pointer without a cast
smartreflex.c:134: warning: initialization makes integer from pointer without a castSigned-off-by Sanjeev Premi <[email protected]>--- arch/arm/mach-omap2/smartreflex.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)Quoted 11 lines
arch/arm/mach-omap2/smartreflex.c static struct omap_sr sr1 = { · line 126
Quoted 11 lines
arch/arm/mach-omap2/smartreflex.c +1
-1@@ -123,7 +123,7 @@ static struct omap_sr sr1 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE), + .srbase_addr =(u32)OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE),
Quoted 1 line
Quoted 6 lines
Quoted 3 lines
please don't. Most likely
srbase_addrshould move to void__iomem*Paul, any comments ??
Took a look at it, the following might be a better ?? (compile tested only)
Looks good. I will try on my evm immediately.
Quoted 124 lines
arch/arm/mach-omap2/smartreflex.c +6
-7@@ -43,32 +43,32 @@ struct omap_sr {int srid;int is_sr_reset;int is_autocomp_active; -struct clk *clk; -u32 clk_length; -u32 req_opp_no; -u32 opp1_nvalue, opp2_nvalue, opp3_nvalue, opp4_nvalue; +struct clk *clk; +u32 clk_length; +u32 req_opp_no; +u32 opp1_nvalue, opp2_nvalue, opp3_nvalue, opp4_nvalue;u32 opp5_nvalue;u32 senp_mod, senn_mod; -u32 srbase_addr; -u32 vpbase_addr; +void __iomem *srbase_addr; +void __iomem *vpbase_addr; };/* Custom clocks to enable SR specific enable/disable functions. */ struct sr_custom_clk { -struct clk clk;/* meta-clock with custom enable/disable calls */
arch/arm/mach-omap2/smartreflex.c +1
-2-struct clk *fck;/* actual functional clock */ -struct omap_sr *sr; +struct clk clk;/* meta-clock with custom enable/disable calls */
arch/arm/mach-omap2/smartreflex.c +2
-1+struct clk *fck;/* actual functional clock */ +struct omap_sr *sr; }; -#define SR_REGADDR (offs) (__force void __iomem*)(sr->srbase_addr + offset)
arch/arm/mach-omap2/smartreflex.c +1
-1+#define SR_REGADDR (offs) (sr->srbase_addr + offset) -static inline void sr_write_reg(struct omap_sr *sr, intoffset, u32 value)
arch/arm/mach-omap2/smartreflex.c +2
-1+static inline void sr_write_reg (struct omap_sr *sr,unsigned offset, +u32 value) {__raw_writel (value,SR_REGADDR (offset)); } -static inline void sr_modify_reg(struct omap_sr *sr, intoffset, u32 mask,
arch/arm/mach-omap2/smartreflex.c +0
-1-u32 value)
+static inline void sr_modify_reg(structomap_sr*sr, unsigned offset, u32 mask,arch/arm/mach-omap2/smartreflex.c +5
-3+ u32 value) {u32 reg_val;@@ -79,7 +79,7 @@ static inline void sr_modify_reg(struct omap_sr *sr, int offset, u32 mask,__raw_writel (reg_val ,SR_REGADDR (offset )); } -static inline u32 sr_read_reg (struct omap_sr *sr,int offset) +static inline u32 sr_read_reg (struct omap_sr *sr,unsigned offset) { return __raw_readl(SR_REGADDR(offset)); } @@ -136,7 +136,7 @@ static struct omap_sr sr2 = { static struct sr_custom_clk sr1_custom_clk = { .clk = { - .name ="sr1_custom_clk" , + .name ="sr1_custom_clk" , .enable = sr_clk_enable, .disable = sr_clk_disable, },@@ -145,7 +145,7 @@ static struct sr_custom_clk sr1_custom_clk = {static struct sr_custom_clk sr2_custom_clk = { .clk = { - .name ="sr2_custom_clk" , + .name ="sr2_custom_clk" , .enable = sr_clk_enable, .disable = sr_clk_disable, },Quoted 5 lines
Quoted 5 lines
arch/arm/mach-omap2/smartreflex.c +0
-0};Quoted 7 lines
arch/arm/mach-omap2/smartreflex.c static struct omap_sr sr2 = { · line 134
Quoted 7 lines
arch/arm/mach-omap2/smartreflex.c +1
-1static struct omap_sr sr2 = {@@ -131,7 +131,7 @@ static struct omap_sr sr2 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE), + .srbase_addr =(u32)OMAP2_IO_ADDRESS(OMAP34XX_SR2_BASE),
Quoted 11 lines
Quoted 10 lines
arch/arm/mach-omap2/smartreflex.c +0
-1};static struct sr_custom_clk sr1_custom_clk = { --1.5.6
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 4 lines
--
balbi
--
To unsubscribe from this list: send the line "unsubscribelinux-omap"
Quoted 1 line
in the body of a message to [email protected] More
majordomo
Quoted 1 line
--
balbi
Quoted 35 lines · Sanjeev
Quoted 35 lines
-----Original Message-----
From: Felipe Balbi [mailto:[email protected]]
Sent: Friday, October 10, 2008 6:24 PM
To: ext Felipe Balbi
Cc: Premi, Sanjeev; [email protected]; Paul Walmsley
Subject: Re: [PATCH] Fix compiler warnings insmartreflex.cQuoted 12 lines · ext Felipe Balbi
Quoted 11 lines · ext Sanjeev Premi
Fix these compiler warnings:
smartreflex.c:126: warning: initialization makes integer from pointer without a cast
smartreflex.c:134: warning: initialization makes integer from pointer without a castSigned-off-by Sanjeev Premi <[email protected]>--- arch/arm/mach-omap2/smartreflex.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)Quoted 11 lines
arch/arm/mach-omap2/smartreflex.c static struct omap_sr sr1 = { · line 126
Quoted 11 lines
arch/arm/mach-omap2/smartreflex.c +1
-1@@ -123,7 +123,7 @@ static struct omap_sr sr1 = { .is_sr_reset = 1, .is_autocomp_active = 0, .clk_length = 0, - .srbase_addr = OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE), + .srbase_addr =(u32)OMAP2_IO_ADDRESS(OMAP34XX_SR1_BASE),
Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
please don't. Most likely
srbase_addrshould move to void__iomem*Paul, any comments ??
Took a look at it, the following might be a better ?? (compile tested only)
Looks good. I will try on my evm immediately.
please do it. Try it out and resend with you proper signed-off-by line ;-)
You should probably put those whitespace cleanups in a separate patch.
Also, please Cc Kevin when you resend :-D
Signature · 1 line
balbi