aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/binfmt_elfo32.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2008-05-01 07:34:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-01 11:03:58 -0400
commitf8bd2258e2d520dff28c855658bd24bdafb5102d (patch)
treed76db1dc858cb316bc7d5b8473f690a753fd2c93 /arch/mips/kernel/binfmt_elfo32.c
parent6f6d6a1a6a1336431a6cba60ace9e97c3a496a19 (diff)
remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflow. The API is a little akward, as the arguments for the unsigned divide are signed. The signed version also doesn't handle a negative divisor and produces worse code on 64bit archs. There is little incentive to keep this API alive, so this converts the few users to the new API. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: john stultz <johnstul@us.ibm.com> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mips/kernel/binfmt_elfo32.c')
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index 08f4cd781ee3..e1333d7319e2 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -56,6 +56,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
56#include <linux/module.h> 56#include <linux/module.h>
57#include <linux/elfcore.h> 57#include <linux/elfcore.h>
58#include <linux/compat.h> 58#include <linux/compat.h>
59#include <linux/math64.h>
59 60
60#define elf_prstatus elf_prstatus32 61#define elf_prstatus elf_prstatus32
61struct elf_prstatus32 62struct elf_prstatus32
@@ -104,8 +105,8 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
104 * one divide. 105 * one divide.
105 */ 106 */
106 u64 nsec = (u64)jiffies * TICK_NSEC; 107 u64 nsec = (u64)jiffies * TICK_NSEC;
107 long rem; 108 u32 rem;
108 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &rem); 109 value->tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
109 value->tv_usec = rem / NSEC_PER_USEC; 110 value->tv_usec = rem / NSEC_PER_USEC;
110} 111}
111 112