OSDN Git Service

m68k: Implement ndelay() as an inline function to force type checking/casting
authorBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 13 May 2018 14:02:12 +0000 (16:02 +0200)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 22 May 2018 08:31:52 +0000 (10:31 +0200)
commitd8441ba80c55aad435e4b98fe0d7ad5d21e46bf9
tree61b842cbfa1faf52461134423e80580894de0f81
parentd49cbe73beb7ff51cb09aeb8b1b1347d2e08438a
m68k: Implement ndelay() as an inline function to force type checking/casting

ndelay() is supposed to take an unsigned long, but if you define
ndelay() as a macro and the caller pass an unsigned long long instead
of an unsigned long, the unsigned long long to unsigned long cast is
not done and we end up with an "undefined reference to `__udivdi3'"
error at link time.

Fix that by making ndelay() an inline function and then defining dummy
ndelay() macro that redirects to the ndelay() function (it's how most
archs do to implement ndelay()).

Fixes: c8ee038bd148 ("m68k: Implement ndelay() based on the existing udelay() logic")
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
[geert: Remove comment now it is no longer a macro]
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/include/asm/delay.h