[U-Boot] sh: build warnings in clock code

Mike Frysinger vapier at gentoo.org
Wed Feb 15 16:26:39 CET 2012


all superh boards hit this warning for me:

Configuring for sh7763rdp board...
time.c: In function 'get_ticks':
time.c:111:16: warning: variable 'ticks' set but not used [-Wunused-but-set-
variable]

and indeed, looking at the code, ticks is set but not used.  not sure if bug 
(ticks should be used), or just delete the variable ...

unsigned long long get_ticks (void)
{
    unsigned long tcnt = 0 - readl(TCNT0);
    unsigned long ticks;

    if (last_tcnt > tcnt) { /* overflow */
        overflow_ticks++;
        ticks = (0xffffffff - last_tcnt) + tcnt;
    } else {
        ticks = tcnt;
    }
    last_tcnt = tcnt;

    return (overflow_ticks << 32) | tcnt;
}
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120215/a819d9a8/attachment.pgp>


More information about the U-Boot mailing list