* [U-Boot] [PATCH] omap3: board.c - Fix compile warnings
@ 2012-01-14 18:32 Pali Rohár
2012-01-14 20:12 ` Marek Vasut
0 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2012-01-14 18:32 UTC (permalink / raw)
To: u-boot
* 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
Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
---
arch/arm/cpu/armv7/omap3/board.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 1f33c63..52514ae 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -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)
{
--
1.7.5.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] omap3: board.c - Fix compile warnings
2012-01-14 18:32 [U-Boot] [PATCH] omap3: board.c - Fix compile warnings Pali Rohár
@ 2012-01-14 20:12 ` Marek Vasut
2012-01-14 20:13 ` Marek Vasut
2012-01-14 23:40 ` Pali Rohár
0 siblings, 2 replies; 7+ messages in thread
From: Marek Vasut @ 2012-01-14 20:12 UTC (permalink / raw)
To: u-boot
> * 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
>
> Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
> ---
> arch/arm/cpu/armv7/omap3/board.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/omap3/board.c
> b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644
> --- a/arch/arm/cpu/armv7/omap3/board.c
> +++ b/arch/arm/cpu/armv7/omap3/board.c
> @@ -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.
>
> 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
Just move this function a few lines below instead of adding more CPP bloat.
>
> static void omap3_setup_aux_cr(void)
> {
Also, does this manifest on omap4 too?
M
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] omap3: board.c - Fix compile warnings
2012-01-14 20:12 ` Marek Vasut
@ 2012-01-14 20:13 ` Marek Vasut
2012-01-14 23:40 ` Pali Rohár
1 sibling, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2012-01-14 20:13 UTC (permalink / raw)
To: u-boot
> > * 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
> >
> > Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
> > ---
> >
> > arch/arm/cpu/armv7/omap3/board.c | 5 +++++
> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/cpu/armv7/omap3/board.c
> > b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644
> > --- a/arch/arm/cpu/armv7/omap3/board.c
> > +++ b/arch/arm/cpu/armv7/omap3/board.c
> > @@ -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.
>
> > 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
>
> Just move this function a few lines below instead of adding more CPP bloat.
>
> > static void omap3_setup_aux_cr(void)
> > {
>
> Also, does this manifest on omap4 too?
>
> M
And one last thing ... Cc appropriate maintainers please
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] omap3: board.c - Fix compile warnings
2012-01-14 20:12 ` Marek Vasut
2012-01-14 20:13 ` Marek Vasut
@ 2012-01-14 23:40 ` Pali Rohár
2012-01-14 23:59 ` Marek Vasut
2012-01-15 0:00 ` Tom Rini
1 sibling, 2 replies; 7+ messages in thread
From: Pali Rohár @ 2012-01-14 23:40 UTC (permalink / raw)
To: u-boot
On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
> > * 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
> >
> > Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
> > ---
> >
> > arch/arm/cpu/armv7/omap3/board.c | 5 +++++
> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/cpu/armv7/omap3/board.c
> > b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644
> > --- a/arch/arm/cpu/armv7/omap3/board.c
> > +++ b/arch/arm/cpu/armv7/omap3/board.c
> > @@ -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.
No, function omap3_invalidate_l2_cache_secure is defined in block #ifndef
CONFIG_SYS_L2CACHE_OFF. So declaration should be in #ifndef too.
>
> > 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
>
> 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.
>
> > static void omap3_setup_aux_cr(void)
> > {
>
> Also, does this manifest on omap4 too?
>
> M
--
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>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] omap3: board.c - Fix compile warnings
2012-01-14 23:40 ` Pali Rohár
@ 2012-01-14 23:59 ` Marek Vasut
2012-01-15 0:00 ` Tom Rini
1 sibling, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2012-01-14 23:59 UTC (permalink / raw)
To: u-boot
> On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
> > > * 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
> > >
> > > Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
> > > ---
> > >
> > > arch/arm/cpu/armv7/omap3/board.c | 5 +++++
> > > 1 files changed, 5 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/arch/arm/cpu/armv7/omap3/board.c
> > > b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644
> > > --- a/arch/arm/cpu/armv7/omap3/board.c
> > > +++ b/arch/arm/cpu/armv7/omap3/board.c
> > > @@ -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.
>
> 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.
>
> > > 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
> >
> > 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.
>
> > > static void omap3_setup_aux_cr(void)
> > > {
> >
> > Also, does this manifest on omap4 too?
> >
> > M
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] omap3: board.c - Fix compile warnings
2012-01-14 23:40 ` Pali Rohár
2012-01-14 23:59 ` Marek Vasut
@ 2012-01-15 0:00 ` Tom Rini
2012-01-15 0:26 ` Marek Vasut
1 sibling, 1 reply; 7+ messages in thread
From: Tom Rini @ 2012-01-15 0:00 UTC (permalink / raw)
To: u-boot
On Sat, Jan 14, 2012 at 4:40 PM, Pali Roh?r <pali.rohar@gmail.com> wrote:
> On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
>> > ?* 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
>> >
>> > Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
>> > ---
>> >
>> > ?arch/arm/cpu/armv7/omap3/board.c | ? ?5 +++++
>> > ?1 files changed, 5 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/arm/cpu/armv7/omap3/board.c
>> > b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644
>> > --- a/arch/arm/cpu/armv7/omap3/board.c
>> > +++ b/arch/arm/cpu/armv7/omap3/board.c
>> > @@ -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.
>
> 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.
--
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] omap3: board.c - Fix compile warnings
2012-01-15 0:00 ` Tom Rini
@ 2012-01-15 0:26 ` Marek Vasut
0 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2012-01-15 0:26 UTC (permalink / raw)
To: u-boot
> On Sat, Jan 14, 2012 at 4:40 PM, Pali Roh?r <pali.rohar@gmail.com> wrote:
> > On Saturday 14 January 2012 21:12:00 Marek Vasut wrote:
> >> > * 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
> >> >
> >> > Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
> >> > ---
> >> >
> >> > arch/arm/cpu/armv7/omap3/board.c | 5 +++++
> >> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >> >
> >> > diff --git a/arch/arm/cpu/armv7/omap3/board.c
> >> > b/arch/arm/cpu/armv7/omap3/board.c index 1f33c63..52514ae 100644
> >> > --- a/arch/arm/cpu/armv7/omap3/board.c
> >> > +++ b/arch/arm/cpu/armv7/omap3/board.c
> >> > @@ -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.
> >
> > 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-01-15 0:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-14 18:32 [U-Boot] [PATCH] omap3: board.c - Fix compile warnings Pali Rohár
2012-01-14 20:12 ` Marek Vasut
2012-01-14 20:13 ` Marek Vasut
2012-01-14 23:40 ` Pali Rohár
2012-01-14 23:59 ` Marek Vasut
2012-01-15 0:00 ` Tom Rini
2012-01-15 0:26 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.