ndelay(): switch to C function to avoid 64-bit division
[sfrench/cifs-2.6.git] / include / linux / delay.h
index 17ddb55430ae19c28704a3da24f230b7a2e2ff6a..54552d21296efe9037de1d034ef45cafa4199067 100644 (file)
@@ -7,6 +7,8 @@
  * Delay routines, using a pre-computed "loops_per_jiffy" value.
  */
 
+#include <linux/kernel.h>
+
 extern unsigned long loops_per_jiffy;
 
 #include <asm/delay.h>
@@ -32,7 +34,11 @@ extern unsigned long loops_per_jiffy;
 #endif
 
 #ifndef ndelay
-#define ndelay(x)      udelay(((x)+999)/1000)
+static inline void ndelay(unsigned long x)
+{
+       udelay(DIV_ROUND_UP(x, 1000));
+}
+#define ndelay(x) ndelay(x)
 #endif
 
 void calibrate_delay(void);