[U-Boot] [PATCH] Fix compilation warnings when building eNET

Vadim Bendebury vbendeb at chromium.org
Sat Dec 10 02:07:18 CET 2011


On Fri, Dec 9, 2011 at 3:57 PM, Graeme Russ <graeme.russ at gmail.com> wrote:
>
> Hi Vadim,
>
> On Dec 10, 2011 10:31 AM, "Vadim Bendebury" <vbendeb at chromium.org> wrote:
> >
> > There have been a couple of unused variable cases, causing compilation
> > warnings when building the eNET target.
> >
> > While the board/eNET/eNET.c:last_stage_init() case seems a leftover
> > from a quick edit, the arch/x86/cpu/sc520/sc520_timer.c:sc520_udelay()
> > seems to actually require accessing the registers discarding the
> > values.
>
> Thanks for picking this up, I've been a bit preoccupie lately.
>
> I'll need to look a bit more closely, but there should be no need for such trickery...
>
> Regards,
>
> Graeme
>
>

Hi Graeme, thank you for a quick response.

Do you mean that there is no need to read the registers before the
actual udelay functionality or do you have another way of pacifying
the compiler in mind?

cheers,
/v

>
> >
> > The source code is being modified accordingly.
> >
> > TEST:
> >  - the eNET target now builds cleanly
> >  - examining disassembled sc520_timer.o shows that the registers are
> >   still being accessed in the beginning of the function.
> >
> > Signed-off-by: Vadim Bendebury <vbendeb at chromium.org>
> > ---
> >
> > [Resend with the proper  cc: header]
>
> >
> >  arch/x86/cpu/sc520/sc520_timer.c |    1 +
> >  board/eNET/eNET.c                |    5 -----
> >  2 files changed, 1 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/x86/cpu/sc520/sc520_timer.c b/arch/x86/cpu/sc520/sc520_timer.c
> > index 495a694..a7bbe92 100644
> > --- a/arch/x86/cpu/sc520/sc520_timer.c
> > +++ b/arch/x86/cpu/sc520/sc520_timer.c
> > @@ -87,4 +87,5 @@ void sc520_udelay(unsigned long usec)
> >                m += readw(&sc520_mmcr->swtmrmilli);
> >                u = readw(&sc520_mmcr->swtmrmicro) + (m * 1000);
> >        } while (u < usec);
> > +       (void) temp;
> >  }
> > diff --git a/board/eNET/eNET.c b/board/eNET/eNET.c
> > index 429fe1b..2f26470 100644
> > --- a/board/eNET/eNET.c
> > +++ b/board/eNET/eNET.c
> > @@ -178,11 +178,6 @@ void show_boot_progress(int val)
> >
> >  int last_stage_init(void)
> >  {
> > -       int minor;
> > -       int major;
> > -
> > -       major = minor = 0;
> > -
> >        outb(0x00, LED_LATCH_ADDRESS);
> >
> >        register_timer_isr(enet_timer_isr);
> > --
> > 1.7.3.1
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list