Skip to content
Snippets Groups Projects
  • Andrew Morton's avatar
    5cba6d22
    ndelay(): switch to C function to avoid 64-bit division · 5cba6d22
    Andrew Morton authored
    
    We should be able to do ndelay(some_u64), but that can cause a call to
    __divdi3() to be emitted because the ndelay() macros does a divide.
    
    Fix it by switching to static inline which will force the u64 arg to be
    treated as an unsigned long.  udelay() takes an unsigned long arg.
    
    [bunk@kernel.org: reported m68k build breakage]
    Cc: Adrian Bunk <bunk@kernel.org>
    Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
    Cc: Martin Michlmayr <tbm@cyrius.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Adrian Bunk <bunk@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5cba6d22
    History
    ndelay(): switch to C function to avoid 64-bit division
    Andrew Morton authored
    
    We should be able to do ndelay(some_u64), but that can cause a call to
    __divdi3() to be emitted because the ndelay() macros does a divide.
    
    Fix it by switching to static inline which will force the u64 arg to be
    treated as an unsigned long.  udelay() takes an unsigned long arg.
    
    [bunk@kernel.org: reported m68k build breakage]
    Cc: Adrian Bunk <bunk@kernel.org>
    Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
    Cc: Martin Michlmayr <tbm@cyrius.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Adrian Bunk <bunk@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>