Skip to contentSkip to conversation

omap3: board.c - Fix compile warnings

PATCH New Pali Rohár 3 participants 7 messages Jan 14, 2012 – Jan 15, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap3: board.c - Fix compile warnings

* This patch fix compile warnings when CONFIG_SYS_L2CACHE_OFF is enabled

board.c:48:13: warning: ?omap3_invalidate_l2_cache_secure? declared ?static? but never defined board.c:373:13: warning: ?omap3_update_aux_cr? defined but not used

---
 arch/arm/cpu/armv7/omap3/board.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/omap3/board.c +5 -0
index 1f33c63..52514ae 100644
@@ -45,7 +45,10 @@
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 static void omap3_setup_aux_cr(void);
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
 static void omap3_invalidate_l2_cache_secure(void);
+#endif
 
 static const struct gpio_bank gpio_bank_34xx[6] = {
 	{ (void *)OMAP34XX_GPIO1_BASE, METHOD_GPIO_24XX },
@@ -370,6 +373,7 @@ static void omap3_update_aux_cr_secure(u32 set_bits, u32 clear_bits)
 	}
 }
 
+#ifndef CONFIG_SYS_L2CACHE_OFF
 static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)
 {
 	u32 acr;
@@ -382,6 +386,7 @@ static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)
 	/* Write ACR - affects non-secure banked bits */
 	asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));
 }
+#endif
 
 static void omap3_setup_aux_cr(void)
 {
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 omap3: board.c - Fix compile warnings

Quoted 16 lines

* This patch fix compile warnings when CONFIG_SYS_L2CACHE_OFF is enabled

   board.c:48:13: warning: ?omap3_invalidate_l2_cache_secure? declared

?static? but never defined board.c:373:13: warning: ?omap3_update_aux_cr? defined but not used

---
 arch/arm/cpu/armv7/omap3/board.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644

arch/arm/cpu/armv7/omap3/board.c line 51

Quoted 7 lines
arch/arm/cpu/armv7/omap3/board.c +3 -0
@@ -45,7 +45,10 @@
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 static void omap3_setup_aux_cr(void);
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
 static void omap3_invalidate_l2_cache_secure(void);
+#endif

This is due to the ordering, right ? Now, split this into two patches, because you're actually doing two unrelated things.

Quoted 13 lines
arch/arm/cpu/armv7/omap3/board.c +1 -0
 static const struct gpio_bank gpio_bank_34xx[6] = {
 	{ (void *)OMAP34XX_GPIO1_BASE, METHOD_GPIO_24XX },
@@ -370,6 +373,7 @@ static void omap3_update_aux_cr_secure(u32 set_bits,
 u32 clear_bits) }
 }
 
+#ifndef CONFIG_SYS_L2CACHE_OFF
 static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)
 {
 	u32 acr;
@@ -382,6 +386,7 @@ static void omap3_update_aux_cr(u32 set_bits, u32

clear_bits) /* Write ACR - affects non-secure banked bits */

arch/arm/cpu/armv7/omap3/board.c static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits) · line 389

Quoted 3 lines
arch/arm/cpu/armv7/omap3/board.c +1 -0
 	asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));
 }
+#endif

Just move this function a few lines below instead of adding more CPP bloat.

Quoted 3 lines

static void omap3_setup_aux_cr(void)
{

Also, does this manifest on omap4 too?

M

#2 lore raw

PATCH 1/1 omap3: board.c - Fix compile warnings

Quoted 60 lines
Quoted 19 lines

* This patch fix compile warnings when CONFIG_SYS_L2CACHE_OFF is enabled

   board.c:48:13: warning: ?omap3_invalidate_l2_cache_secure? declared

?static? but never defined board.c:373:13: warning: ?omap3_update_aux_cr? defined but not used

---

 arch/arm/cpu/armv7/omap3/board.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644

arch/arm/cpu/armv7/omap3/board.c +0 -0
@@ -45,7 +45,10 @@
 

arch/arm/cpu/armv7/omap3/board.c

Quoted 10 lines
arch/arm/cpu/armv7/omap3/board.c +3 -0
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 static void omap3_setup_aux_cr(void);
 
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
 
 static void omap3_invalidate_l2_cache_secure(void);
 
+#endif

This is due to the ordering, right ? Now, split this into two patches, because you're actually doing two unrelated things.

Quoted 19 lines

static const struct gpio_bank gpio_bank_34xx[6] = {

arch/arm/cpu/armv7/omap3/board.c +1 -0
 	{ (void *)OMAP34XX_GPIO1_BASE, METHOD_GPIO_24XX },
@@ -370,6 +373,7 @@ static void omap3_update_aux_cr_secure(u32 set_bits,
 u32 clear_bits) }
 
 }
 
+#ifndef CONFIG_SYS_L2CACHE_OFF
 
 static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)

{

arch/arm/cpu/armv7/omap3/board.c +0 -0
 	u32 acr;
@@ -382,6 +386,7 @@ static void omap3_update_aux_cr(u32 set_bits, u32

clear_bits) /* Write ACR - affects non-secure banked bits */

arch/arm/cpu/armv7/omap3/board.c static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits) · line 389

Quoted 5 lines
arch/arm/cpu/armv7/omap3/board.c +1 -0
 	asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));
 
 }
 
+#endif

Just move this function a few lines below instead of adding more CPP bloat.

Quoted 6 lines
Quoted 2 lines

static void omap3_setup_aux_cr(void)
{

Also, does this manifest on omap4 too?

M

And one last thing ... Cc appropriate maintainers please

#3 lore raw

PATCH 1/1 omap3: board.c - Fix compile warnings

In reply to Marek Vasut
Quoted 26 lines · On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
Quoted 26 lines

* This patch fix compile warnings when CONFIG_SYS_L2CACHE_OFF is enabled

   board.c:48:13: warning: ?omap3_invalidate_l2_cache_secure? declared

?static? but never defined board.c:373:13: warning: ?omap3_update_aux_cr? defined but not used

---

 arch/arm/cpu/armv7/omap3/board.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644

arch/arm/cpu/armv7/omap3/board.c +2 -0
@@ -45,7 +45,10 @@
 
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 static void omap3_setup_aux_cr(void);
 
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
 
Quoted 6 lines

arch/arm/cpu/armv7/omap3/board.c

Quoted 3 lines
arch/arm/cpu/armv7/omap3/board.c +1 -0
 static void omap3_invalidate_l2_cache_secure(void);
 
+#endif

This is due to the ordering, right ? Now, split this into two patches, because you're actually doing two unrelated things.

No, function omap3_invalidate_l2_cache_secure is defined in block #ifndef CONFIG_SYS_L2CACHE_OFF. So declaration should be in #ifndef too.

Quoted 20 lines
Quoted 20 lines

static const struct gpio_bank gpio_bank_34xx[6] = {

arch/arm/cpu/armv7/omap3/board.c +1 -0
 	{ (void *)OMAP34XX_GPIO1_BASE, METHOD_GPIO_24XX },
@@ -370,6 +373,7 @@ static void omap3_update_aux_cr_secure(u32 set_bits,
 u32 clear_bits) }
 
 }
 
+#ifndef CONFIG_SYS_L2CACHE_OFF
 
 static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)

{

arch/arm/cpu/armv7/omap3/board.c +0 -0
 	u32 acr;
@@ -382,6 +386,7 @@ static void omap3_update_aux_cr(u32 set_bits, u32

clear_bits) /* Write ACR - affects non-secure banked bits */

Quoted 7 lines

arch/arm/cpu/armv7/omap3/board.c static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits) · line 389

Quoted 5 lines
arch/arm/cpu/armv7/omap3/board.c +1 -0
 	asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));
 
 }
 
+#endif

Just move this function a few lines below instead of adding more CPP bloat.

Function omap3_update_aux_cr is called only when CONFIG_SYS_L2CACHE_OFF is not defined, so adding #ifndef is needed.

Quoted 7 lines
Quoted 3 lines

static void omap3_setup_aux_cr(void)
{

Also, does this manifest on omap4 too?

M

Signature · 9 lines
Pali Roh?r
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120115/9b4be01f/attachment.pgp>
#4 lore raw

PATCH 1/1 omap3: board.c - Fix compile warnings

Quoted 30 lines · On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
Quoted 29 lines
Quoted 29 lines

* This patch fix compile warnings when CONFIG_SYS_L2CACHE_OFF is enabled

   board.c:48:13: warning: ?omap3_invalidate_l2_cache_secure? declared

?static? but never defined board.c:373:13: warning:
?omap3_update_aux_cr? defined but not used

---

 arch/arm/cpu/armv7/omap3/board.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644

arch/arm/cpu/armv7/omap3/board.c +2 -0
@@ -45,7 +45,10 @@
 
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 static void omap3_setup_aux_cr(void);
 
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
 
 static void omap3_invalidate_l2_cache_secure(void);
Quoted 7 lines
Quoted 4 lines

arch/arm/cpu/armv7/omap3/board.c line 54

Quoted 1 line
arch/arm/cpu/armv7/omap3/board.c +1 -0
+#endif

This is due to the ordering, right ? Now, split this into two patches, because you're actually doing two unrelated things.

No, function omap3_invalidate_l2_cache_secure is defined in block #ifndef CONFIG_SYS_L2CACHE_OFF. So declaration should be in #ifndef too.

Well ... I didn't object to that. I was just pointing out you're fixing forward declaration to undefined function. You should make a separate patch for that and explain it in the changelog so it's easily bisectable.

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines

static const struct gpio_bank gpio_bank_34xx[6] = {

arch/arm/cpu/armv7/omap3/board.c +1 -0
 	{ (void *)OMAP34XX_GPIO1_BASE, METHOD_GPIO_24XX },
@@ -370,6 +373,7 @@ static void omap3_update_aux_cr_secure(u32
 set_bits, u32 clear_bits) }
 
 }
 
+#ifndef CONFIG_SYS_L2CACHE_OFF
 
 static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)

{

arch/arm/cpu/armv7/omap3/board.c +0 -0
 	u32 acr;
@@ -382,6 +386,7 @@ static void omap3_update_aux_cr(u32 set_bits, u32

clear_bits) /* Write ACR - affects non-secure banked bits */

asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));

}

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

+#endif

Just move this function a few lines below instead of adding more CPP bloat.

Function omap3_update_aux_cr is called only when CONFIG_SYS_L2CACHE_OFF is not defined, so adding #ifndef is needed.

Sigh ... move this function to the whole #ifndef block a few lines under that function.

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

static void omap3_setup_aux_cr(void)
{

Also, does this manifest on omap4 too?

M

#5 lore raw

PATCH 1/1 omap3: board.c - Fix compile warnings

In reply to Pali Rohár
Quoted 29 lines · Pali Roh?r
Quoted 28 lines · On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
Quoted 28 lines

?* This patch fix compile warnings when CONFIG_SYS_L2CACHE_OFF is enabled

? ?board.c:48:13: warning: ?omap3_invalidate_l2_cache_secure? declared

?static? but never defined board.c:373:13: warning: ?omap3_update_aux_cr? defined but not used

---

?arch/arm/cpu/armv7/omap3/board.c | ? ?5 +++++
?1 files changed, 5 insertions(+), 0 deletions(-)

(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644

arch/arm/cpu/armv7/omap3/board.c +0 -0
@@ -45,7 +45,10 @@
 

?/* Declarations */
?extern omap3_sysinfo sysinfo;
?static void omap3_setup_aux_cr(void);

arch/arm/cpu/armv7/omap3/board.c +2 -0
+
+#ifndef CONFIG_SYS_L2CACHE_OFF

?static void omap3_invalidate_l2_cache_secure(void);

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

+#endif

This is due to the ordering, right ? Now, split this into two patches, because you're actually doing two unrelated things.

No, function omap3_invalidate_l2_cache_secure is defined in block #ifndef CONFIG_SYS_L2CACHE_OFF. So declaration should be in #ifndef too.

Right, but if we move the function to be just before it's used, inside the existing ifndef block we can remove the prototype instead.

Signature · 1 line
Tom
#6 lore raw

PATCH 1/1 omap3: board.c - Fix compile warnings

Quoted 36 lines · Pali Roh?r
Quoted 35 lines · On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
Quoted 33 lines
Quoted 20 lines

* This patch fix compile warnings when CONFIG_SYS_L2CACHE_OFF is
enabled

   board.c:48:13: warning: ?omap3_invalidate_l2_cache_secure? declared

?static? but never defined board.c:373:13: warning:
?omap3_update_aux_cr? defined but not used

---

 arch/arm/cpu/armv7/omap3/board.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644

arch/arm/cpu/armv7/omap3/board.c +0 -0
@@ -45,7 +45,10 @@
 

arch/arm/cpu/armv7/omap3/board.c

Quoted 10 lines
arch/arm/cpu/armv7/omap3/board.c +3 -0
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 static void omap3_setup_aux_cr(void);
 
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
 
 static void omap3_invalidate_l2_cache_secure(void);
 
+#endif

This is due to the ordering, right ? Now, split this into two patches, because you're actually doing two unrelated things.

Quoted 5 lines
Quoted 2 lines

No, function omap3_invalidate_l2_cache_secure is defined in block #ifndef CONFIG_SYS_L2CACHE_OFF. So declaration should be in #ifndef too.

Right, but if we move the function to be just before it's used, inside the existing ifndef block we can remove the prototype instead.

Yep, it's just an function ordering issue being solved here.

M