@@ -55,7 +55,10 @@ extern struct arm_delay_ops {
unsigned long ticks_per_jiffy;
} arm_delay_ops;
-#define __delay(n) arm_delay_ops.delay(n)
+static inline void __nocfi __delay(unsigned long n)
+{
+ arm_delay_ops.delay(n);
+}
/*
* This function intentionally does not exist; if you see references to
@@ -76,8 +79,15 @@ extern void __bad_udelay(void);
* first constant multiplications gets optimized away if the delay is
* a constant)
*/
-#define __udelay(n) arm_delay_ops.udelay(n)
-#define __const_udelay(n) arm_delay_ops.const_udelay(n)
+static inline void __nocfi __udelay(unsigned long n)
+{
+ arm_delay_ops.udelay(n);
+}
+
+static inline void __nocfi __const_udelay(unsigned long n)
+{
+ arm_delay_ops.const_udelay(n);
+}
#define udelay(n) \
(__builtin_constant_p(n) ? \
The members of the vector table arm_delay_ops are called directly using defines, but this is really confusing for KCFI. Wrap the calls in static inlines and tag them with __nocfi so things start to work. Without this patch, platforms without a delay timer will not boot (sticks in calibrating loop etc). Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- arch/arm/include/asm/delay.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)