Skip to contentSkip to conversation

ARM:i.MX fix compile errors and warnings

PATCH New Jason Liu 4 participants 14 messages Nov 2, 2011 – Nov 3, 2011

Subsystems (4)
lore
Share & tools
lore

Jason Liu

author
#0 lore raw

v3 cover ARM:i.MX fix compile errors and warnings

This patch-set fix the compile errors and warnings on i.MX

Jason Liu (3):
ARM:i.MX: fix build error in tzic/avic.c ARM:i.MX: fix the build error in clock-mx51-mx53.c ARM:i.MX: fix the compile warnings in clock-mx51-mx53.c

 arch/arm/mach-mx5/clock-mx51-mx53.c |    4 ++++
 arch/arm/plat-mxc/avic.c            |    1 +
 arch/arm/plat-mxc/tzic.c            |    1 +
 3 files changed, 6 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH v3 1/3 ARM:i.MX: fix build error in tzic/avic.c

arch/arm/plat-mxc/tzic.c:105: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'tzic_handle_irq'

---
 arch/arm/plat-mxc/avic.c |    1 +
 arch/arm/plat-mxc/tzic.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/avic.c +1 -0
index 8875fb4..55f1569 100644
@@ -22,6 +22,7 @@
 #include <linux/io.h>
 #include <mach/common.h>
 #include <asm/mach/irq.h>
+#include <asm/exception.h>
 #include <mach/hardware.h>
 
 #include "irq-common.h"
arch/arm/plat-mxc/tzic.c +1 -0
index e993a18..a3c164c 100644
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 
 #include <asm/mach/irq.h>
+#include <asm/exception.h>
 
 #include <mach/hardware.h>
 #include <mach/common.h>
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH 1/1 ARM: mx25: Add the missing IIM base definition

In reply to Jason Liu

This fix the mx25 building issue of no IIM base definition

Cc Sascha Hauer <[email protected]>
---
 arch/arm/plat-mxc/include/mach/mx25.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/include/mach/mx25.h +1 -0
index 8dcab80..ccebf5b 100644
@@ -41,6 +41,7 @@
 #define MX25_SSI2_BASE_ADDR		0x50014000
 #define MX25_SSI1_BASE_ADDR		0x50034000
 #define MX25_NFC_BASE_ADDR		0xbb000000
+#define MX25_IIM_BASE_ADDR		0x53ff0000
 #define MX25_DRYICE_BASE_ADDR		0x53ffc000
 #define MX25_ESDHC1_BASE_ADDR		0x53fb4000
 #define MX25_ESDHC2_BASE_ADDR		0x53fb8000
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 1/1 ARM: mx25: Add the missing IIM base definition

Hi, Sascha

2011/11/2 Jason Liu <[email protected]>:

Quoted 13 lines

This fix the mx25 building issue of no IIM base definition

Cc Sascha Hauer <[email protected]>

---
?arch/arm/plat-mxc/include/mach/mx25.h | ? ?1 +
?1 files changed, 1 insertions(+), 0 deletions(-)

arch/arm/plat-mxc/include/mach/mx25.h +0 -0
index 8dcab80..ccebf5b 100644
@@ -41,6 +41,7 @@
Quoted 7 lines

?#define MX25_SSI2_BASE_ADDR ? ? ? ? ? ?0x50014000 ?#define MX25_SSI1_BASE_ADDR ? ? ? ? ? ?0x50034000 ?#define MX25_NFC_BASE_ADDR ? ? ? ? ? ? 0xbb000000 +#define MX25_IIM_BASE_ADDR ? ? ? ? ? ? 0x53ff0000 ?#define MX25_DRYICE_BASE_ADDR ? ? ? ? ?0x53ffc000 ?#define MX25_ESDHC1_BASE_ADDR ? ? ? ? ?0x53fb4000 ?#define MX25_ESDHC2_BASE_ADDR ? ? ? ? ?0x53fb8000

Please ignore this patch, sorry for that.

Jason Liu

Quoted 10 lines

--
1.7.4.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#4 lore raw

PATCH 1/1 slub: doc: update the slabinfo.c file path

In reply to Jason Liu

slabinfo.c has been moved from Documentaion/vm/ to tools/slub/ by commit:0d24db337e6d81c0c620ab65cc6947bd6553f742

Update the slub.txt doc to reflect this change too.

Cc Christoph Lameter <[email protected]>
---
 Documentation/vm/00-INDEX |    2 --
 Documentation/vm/slub.txt |    2 +-
 2 files changed, 1 insertions(+), 3 deletions(-)
Documentation/vm/00-INDEX +0 -2
index dca82d7..5481c8b 100644
@@ -30,8 +30,6 @@ page_migration
 	- description of page migration in NUMA systems.
 pagemap.txt
 	- pagemap, from the userspace perspective
-slabinfo.c
-	- source code for a tool to get reports about slabs.
 slub.txt
 	- a short users guide for SLUB.
 unevictable-lru.txt
Documentation/vm/slub.txt +1 -1
index 07375e7..f464f47 100644
@@ -17,7 +17,7 @@ data and perform operation on the slabs. By default slabinfo only lists
 slabs that have data in them. See "slabinfo -h" for more options when
 running the command. slabinfo can be compiled with
 
-gcc -o slabinfo Documentation/vm/slabinfo.c
+gcc -o slabinfo tools/slub/slabinfo.c
 
 Some of the modes of operation of slabinfo require that slub debugging
 be enabled on the command line. F.e. no tracking information will be
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 1/1 slub: doc: update the slabinfo.c file path

Quoted 7 lines · Jason Liu

slabinfo.c has been moved from Documentaion/vm/ to tools/slub/ by commit:0d24db337e6d81c0c620ab65cc6947bd6553f742

Update the slub.txt doc to reflect this change too.

Cc Christoph Lameter <[email protected]>

This patch shouldn't be part of this patch set; there is nothing IMX specific with it. It is purely a stand-alone bug fix and, therefore, it should stand completely alone as its own patch.

You're not even copying it to those who you claim to be doing so in the commit log above.

It should be copied to the appropriate people and mailing lists.

#6 lore raw

PATCH 1/1 slub: doc: update the slabinfo.c file path

2011/11/2 Russell King - ARM Linux <[email protected]>:

Quoted 9 lines · Jason Liu
Quoted 7 lines

slabinfo.c has been moved from Documentaion/vm/ to tools/slub/ by commit:0d24db337e6d81c0c620ab65cc6947bd6553f742

Update the slub.txt doc to reflect this change too.

Cc Christoph Lameter <[email protected]>
Quoted 8 lines

This patch shouldn't be part of this patch set; there is nothing IMX specific with it. ?It is purely a stand-alone bug fix and, therefore, it should stand completely alone as its own patch.

You're not even copying it to those who you claim to be doing so in the commit log above.

It should be copied to the appropriate people and mailing lists.

Please ignore this patch since this patch has already gone to the next. Sorry for that.

Jason Liu

Quoted 7 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#7 lore raw

PATCH v3 2/3 ARM:i.MX: fix the build error in clock-mx51-mx53.c

In reply to Jason Liu

arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'clk_get_freq_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1643: error: implicit declaration of function 'for_each_compatible_node' arch/arm/mach-mx5/clock-mx51-mx53.c:1643: error: expected ';' before '{' token

---
 arch/arm/mach-mx5/clock-mx51-mx53.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/clock-mx51-mx53.c +2 -0
index 2aacf41..7c373b83 100644
@@ -1637,6 +1637,7 @@ int __init mx53_clocks_init(unsigned long ckil, unsigned long osc,
 static void __init clk_get_freq_dt(unsigned long *ckil, unsigned long *osc,
 				   unsigned long *ckih1, unsigned long *ckih2)
 {
+#ifdef CONFIG_OF
 	struct device_node *np;
 
 	/* retrieve the freqency of fixed clocks from device tree */
@@ -1654,6 +1655,7 @@ static void __init clk_get_freq_dt(unsigned long *ckil, unsigned long *osc,
 		else if (of_device_is_compatible(np, "fsl,imx-ckih2"))
 			*ckih2 = rate;
 	}
+#endif
 }
 
 int __init mx51_clocks_init_dt(void)
Signature · 1 line
1.7.4.1
author
#8 lore raw

PATCH v3 3/3 ARM:i.MX: fix the compile warnings in clock-mx51-mx53.c

In reply to Jason Liu

arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'clk_get_freq_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1640: warning: unused variable 'np' arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx53_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih2' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx51_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih2' is used uninitialized in this function

---
 arch/arm/mach-mx5/clock-mx51-mx53.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/clock-mx51-mx53.c +2 -0
index 7c373b83..e352a5a 100644
@@ -1662,6 +1662,7 @@ int __init mx51_clocks_init_dt(void)
 {
 	unsigned long ckil, osc, ckih1, ckih2;
 
+	ckil = osc = ckih1 = ckih2 = 0;
 	clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 	return mx51_clocks_init(ckil, osc, ckih1, ckih2);
 }
@@ -1670,6 +1671,7 @@ int __init mx53_clocks_init_dt(void)
 {
 	unsigned long ckil, osc, ckih1, ckih2;
 
+	ckil = osc = ckih1 = ckih2 = 0;
 	clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 	return mx53_clocks_init(ckil, osc, ckih1, ckih2);
 }
Signature · 1 line
1.7.4.1
maintainer
#9 lore raw

PATCH v3 3/3 ARM:i.MX: fix the compile warnings in clock-mx51-mx53.c

Quoted 4 lines · Jason Liu

arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'clk_get_freq_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1640: warning: unused variable 'np' arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx53_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckil' is used uninitialized in this function

Quoted 8 lines

arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih2' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx51_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih2' is used uninitialized in this function

You only get this warning because you have put the code in clk_get_freq_dt into #ifdef CONFIG_OF in the last patch. Instead please put the whole block including clk_get_freq_dt, mx51_clocks_init_dt and mx53_clocks_init_dt into #ifdef CONFIG_OF.

Sascha

Quoted 31 lines
---
 arch/arm/mach-mx5/clock-mx51-mx53.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/clock-mx51-mx53.c +2 -0
index 7c373b83..e352a5a 100644
@@ -1662,6 +1662,7 @@ int __init mx51_clocks_init_dt(void)
 {
 	unsigned long ckil, osc, ckih1, ckih2;
 
+	ckil = osc = ckih1 = ckih2 = 0;
 	clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 	return mx51_clocks_init(ckil, osc, ckih1, ckih2);
 }
@@ -1670,6 +1671,7 @@ int __init mx53_clocks_init_dt(void)
 {
 	unsigned long ckil, osc, ckih1, ckih2;
 
+	ckil = osc = ckih1 = ckih2 = 0;
 	clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 	return mx53_clocks_init(ckil, osc, ckih1, ckih2);
 }
Signature · 1 line
1.7.4.1
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#10 lore raw

PATCH v3 3/3 ARM:i.MX: fix the compile warnings in clock-mx51-mx53.c

2011/11/3 Sascha Hauer <[email protected]>:

Quoted 13 lines · Jason Liu
Quoted 11 lines

arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'clk_get_freq_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx53_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih2' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx51_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih2' is used uninitialized in this function

Quoted 4 lines

You only get this warning because you have put the code in clk_get_freq_dt into #ifdef CONFIG_OF in the last patch. Instead please put the whole block including clk_get_freq_dt, mx51_clocks_init_dt and mx53_clocks_init_dt into #ifdef CONFIG_OF.

Yes, I can put #ifdef CONFIG_OF to cover the whole block including clk_get_freq_dt/
mx51_clocks_init_dt/mx53_clocks_init_dt, but after enable CONFIG_OF, you still will
meet these compiling warnings.

But refer to grant before, we don't need place #ifdef CONFIG_OF #endif into the .c file, no-matter enable device_tree support or not. I'm not sure why we still
meet compile error, shawn, any comments?

Jason Liu

Quoted 45 lines

Sascha

Quoted 27 lines

---
?arch/arm/mach-mx5/clock-mx51-mx53.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/mach-mx5/clock-mx51-mx53.c +2 -1
index 7c373b83..e352a5a 100644
@@ -1662,6 +1662,7 @@ int __init mx51_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx51_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
@@ -1670,6 +1671,7 @@ int __init mx53_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx53_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
--
Quoted 4 lines

1.7.4.1

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#11 lore raw

PATCH v3 3/3 ARM:i.MX: fix the compile warnings in clock-mx51-mx53.c

Quoted 19 lines · Jason Liu

2011/11/3 Sascha Hauer <[email protected]>:

Quoted 13 lines · Jason Liu
Quoted 11 lines

arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'clk_get_freq_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx53_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih2' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx51_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih2' is used uninitialized in this function

Quoted 4 lines

You only get this warning because you have put the code in clk_get_freq_dt into #ifdef CONFIG_OF in the last patch. Instead please put the whole block including clk_get_freq_dt, mx51_clocks_init_dt and mx53_clocks_init_dt into #ifdef CONFIG_OF.

Quoted 5 lines

Yes, I can put #ifdef CONFIG_OF to cover the whole block including clk_get_freq_dt/
mx51_clocks_init_dt/mx53_clocks_init_dt, but after enable CONFIG_OF, you still will
meet these compiling warnings.

I just tried it and no, I do not get any compiler warnings.

When passing the address of a variable to a function gcc considers this variable as initialized after that, unless the function is a static inline function and gcc can see that it actually does not get initialized.
I hope this hasn't changed with gcc 4.6

Quoted 5 lines

But refer to grant before, we don't need place #ifdef CONFIG_OF #endif into the .c file, no-matter enable device_tree support or not. I'm not sure why we still
meet compile error, shawn, any comments?

for_each_compatible_node is inside #ifdef CONFIG_OF in the header file. So unless there are plans to provide some dummy stub for this without CONFIG_OF I see no way around these ifdefs.

Quoted 49 lines

Jason Liu

Quoted 45 lines

Sascha

Quoted 27 lines

---
?arch/arm/mach-mx5/clock-mx51-mx53.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/mach-mx5/clock-mx51-mx53.c +2 -1
index 7c373b83..e352a5a 100644
@@ -1662,6 +1662,7 @@ int __init mx51_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx51_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
@@ -1670,6 +1671,7 @@ int __init mx53_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx53_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
--
Quoted 4 lines

1.7.4.1

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#12 lore raw

PATCH v3 3/3 ARM:i.MX: fix the compile warnings in clock-mx51-mx53.c

2011/11/3 Sascha Hauer <[email protected]>:

Quoted 20 lines · Jason Liu
Quoted 19 lines

2011/11/3 Sascha Hauer <[email protected]>:

Quoted 17 lines · Jason Liu
Quoted 11 lines

arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'clk_get_freq_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx53_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih2' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx51_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih2' is used uninitialized in this function

You only get this warning because you have put the code in clk_get_freq_dt into #ifdef CONFIG_OF in the last patch. Instead please put the whole block including clk_get_freq_dt, mx51_clocks_init_dt and mx53_clocks_init_dt into #ifdef CONFIG_OF.

Quoted 7 lines
Quoted 5 lines

Yes, I can put #ifdef CONFIG_OF to cover the whole block including clk_get_freq_dt/
mx51_clocks_init_dt/mx53_clocks_init_dt, but after enable CONFIG_OF, you still will
meet these compiling warnings.

I just tried it and no, I do not get any compiler warnings.

OK, thanks.

Quoted 6 lines

When passing the address of a variable to a function gcc considers this variable as initialized after that, unless the function is a static inline function and gcc can see that it actually does not get initialized.
I hope this hasn't changed with gcc 4.6

you right. After move the #ifdef to cover all the dt related, I did not get any compile
warnings. I will update this patch soon. see v2 for it.

Jason Liu

Quoted 67 lines
Quoted 6 lines

But refer to grant before, we don't need place #ifdef CONFIG_OF #endif into the .c file, no-matter enable device_tree support or not. I'm not sure why we still
meet compile error, shawn, any comments?

for_each_compatible_node is inside #ifdef CONFIG_OF in the header file. So unless there are plans to provide some dummy stub for this without CONFIG_OF I see no way around these ifdefs.

Quoted 49 lines

Jason Liu

Quoted 45 lines

Sascha

Quoted 27 lines

---
?arch/arm/mach-mx5/clock-mx51-mx53.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/mach-mx5/clock-mx51-mx53.c +2 -1
index 7c373b83..e352a5a 100644
@@ -1662,6 +1662,7 @@ int __init mx51_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx51_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
@@ -1670,6 +1671,7 @@ int __init mx53_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx53_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
--
Quoted 4 lines

1.7.4.1

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |
#13 lore raw

PATCH v3 3/3 ARM:i.MX: fix the compile warnings in clock-mx51-mx53.c

2011/11/3 Jason Liu <[email protected]>:

Quoted 38 lines

2011/11/3 Sascha Hauer <[email protected]>:

Quoted 20 lines · Jason Liu
Quoted 19 lines

2011/11/3 Sascha Hauer <[email protected]>:

Quoted 17 lines · Jason Liu
Quoted 11 lines

arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'clk_get_freq_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx53_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1673: warning: 'ckih2' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c: In function 'mx51_clocks_init_dt':
arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckil' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'osc' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih1' is used uninitialized in this function arch/arm/mach-mx5/clock-mx51-mx53.c:1665: warning: 'ckih2' is used uninitialized in this function

You only get this warning because you have put the code in clk_get_freq_dt into #ifdef CONFIG_OF in the last patch. Instead please put the whole block including clk_get_freq_dt, mx51_clocks_init_dt and mx53_clocks_init_dt into #ifdef CONFIG_OF.

Quoted 7 lines
Quoted 5 lines

Yes, I can put #ifdef CONFIG_OF to cover the whole block including clk_get_freq_dt/
mx51_clocks_init_dt/mx53_clocks_init_dt, but after enable CONFIG_OF, you still will
meet these compiling warnings.

I just tried it and no, I do not get any compiler warnings.

OK, thanks.

Quoted 6 lines

When passing the address of a variable to a function gcc considers this variable as initialized after that, unless the function is a static inline function and gcc can see that it actually does not get initialized.
I hope this hasn't changed with gcc 4.6

Quoted 3 lines

you right. After move the #ifdef to cover all the dt related, I did not get any compile
warnings. I will update this patch soon. see v2 for it.

The version for this patch-set is messed up by my local script. In fact, this initial version should be v1 (not v3) and the following is v2. I will be careful
to not run into this issue later. sorry for the reader who confuse about it.

Quoted 71 lines

Jason Liu

Quoted 67 lines
Quoted 6 lines

But refer to grant before, we don't need place #ifdef CONFIG_OF #endif into the .c file, no-matter enable device_tree support or not. I'm not sure why we still
meet compile error, shawn, any comments?

for_each_compatible_node is inside #ifdef CONFIG_OF in the header file. So unless there are plans to provide some dummy stub for this without CONFIG_OF I see no way around these ifdefs.

Quoted 49 lines

Jason Liu

Quoted 45 lines

Sascha

Quoted 27 lines

---
?arch/arm/mach-mx5/clock-mx51-mx53.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/mach-mx5/clock-mx51-mx53.c +2 -1
index 7c373b83..e352a5a 100644
@@ -1662,6 +1662,7 @@ int __init mx51_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx51_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
@@ -1670,6 +1671,7 @@ int __init mx53_clocks_init_dt(void)
 ?{
 ? ? ? unsigned long ckil, osc, ckih1, ckih2;
 
+ ? ? ckil = osc = ckih1 = ckih2 = 0;
 ? ? ? clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 ? ? ? return mx53_clocks_init(ckil, osc, ckih1, ckih2);
 ?}
--
Quoted 4 lines

1.7.4.1

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |