Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 015a830d authored by Arnd Bergmann's avatar Arnd Bergmann Committed by John Stultz
Browse files

time/jiffies: bring back unconditional LATCH definition



Patch a7ea3bbf "time/jiffies: Allow CLOCK_TICK_RATE to be undefined"
breaks the compilation of targets that rely on the LATCH definition,
because of recursive header file inclusion not defining CLOCK_TICK_RATE
before it is checked here.

This fixes the problem by moving LATCH back to where it was, but it
seems that there are still cases where SHIFTED_HZ is defined incorrectly
because of the same problem. Need to investigate further.

Without this patch, building h7201_defconfig results in:

arch/arm/mach-h720x/common.c: In function 'h720x_gettimeoffset':
arch/arm/mach-h720x/common.c:50:73: error: 'LATCH' undeclared (first use in this function)
arch/arm/mach-h720x/common.c:50:73: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-h720x/common.c:51:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 0bd1189e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -51,10 +51,11 @@
#define SH_DIV(NOM,DEN,LSH) (   (((NOM) / (DEN)) << (LSH))              \
                             + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))

#ifdef CLOCK_TICK_RATE
/* LATCH is used in the interval timer and ftape setup. */
#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ)	/* For divider */

#ifdef CLOCK_TICK_RATE

/*
 * HZ is the requested value. However the CLOCK_TICK_RATE may not allow
 * for exactly HZ. So SHIFTED_HZ is high res HZ ("<< 8" is for accuracy)