From: Andrew Morton kernel/time.c: In function 'jiffies_to_msecs': kernel/time.c:248: error: 'HZ_TO_MSEC_NUM' undeclared (first use in this function) kernel/time.c:248: error: (Each undeclared identifier is reported only once kernel/time.c:248: error: for each function it appears in.) kernel/time.c:248: error: 'HZ_TO_MSEC_DEN' undeclared (first use in this function) kernel/time.c: In function 'jiffies_to_usecs': kernel/time.c:264: error: 'HZ_TO_USEC_NUM' undeclared (first use in this function) kernel/time.c:264: error: 'HZ_TO_USEC_DEN' undeclared (first use in this function) kernel/time.c: In function 'usecs_to_jiffies': kernel/time.c:486: error: 'm' undeclared (first use in this function) kernel/time.c:489: warning: control reaches end of non-void function kernel/time.c: In function 'jiffies_to_usecs': kernel/time.c:267: warning: control reaches end of non-void function kernel/time.c: In function 'jiffies_to_msecs': kernel/time.c:251: warning: control reaches end of non-void function Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton --- kernel/time.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -puN kernel/time.c~avoid-overflows-in-kernel-timec-fix kernel/time.c --- a/kernel/time.c~avoid-overflows-in-kernel-timec-fix +++ a/kernel/time.c @@ -245,7 +245,7 @@ unsigned int inline jiffies_to_msecs(con # if BITS_PER_LONG == 32 return ((u64)HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32; # else - return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN; + return (j * MSEC_PER_SEC) / HZ; # endif #endif } @@ -261,7 +261,7 @@ unsigned int inline jiffies_to_usecs(con # if BITS_PER_LONG == 32 return ((u64)HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32; # else - return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN; + return (j * USEC_PER_SEC) / HZ; # endif #endif } @@ -483,7 +483,7 @@ unsigned long usecs_to_jiffies(const uns #elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC) return u * (HZ / USEC_PER_SEC); #else - return ((u64)USEC_TO_HZ_MUL32 * m + USEC_TO_HZ_ADJ32) + return ((u64)USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32) >> USEC_TO_HZ_SHR32; #endif } _