On Thu, May 08, 2008 at 04:34:43PM -0700, Andrew Morton wrote:Oops, sorry, I didn't remember that one can't do 64-bit division on i386. The patch below fixes that. --- ibmaem: Fix 64-bit division on 32-bit platforms Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> --- drivers/hwmon/ibmaem.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index 22fa7d6..f808ca3 100644 --- a/drivers/hwmon/ibmaem.c +++ b/drivers/hwmon/ibmaem.c @@ -31,6 +31,7 @@ #include <linux/idr.h> #include <linux/sched.h> #include <linux/platform_device.h> +#include <linux/math64.h> #define REFRESH_INTERVAL (HZ) #define IPMI_TIMEOUT (30 * HZ) @@ -864,9 +865,10 @@ static ssize_t aem_show_power(struct device *dev, mutex_unlock(&data->lock); time = timespec_to_ns(&a) - timespec_to_ns(&b); - time /= 1000; + time = div_u64(time, 1000); - return sprintf(buf, "%llu\n", (after - before) * 1000000000 / time); + return sprintf(buf, "%llu\n", + div64_u64((after - before) * 1000000000, time)); } /* Display energy use */ --
| Linus Torvalds | Linux 2.6.27 |
| Linus Torvalds | Linux 2.6.27-rc5 |
| Bart Van Assche | Re: Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 007/196] Chinese: add translation of stable_kernel_rules.txt |
git: | |
| Pierre Habouzit | Re: Decompression speed: zip vs lzo |
| Jakub Narebski | Re: VCS comparison table |
| Johannes Sixt | [PATCH 25/40] Windows: Implement a cpio emulation in git-clone.sh. |
| Jakub Narebski | Re: Git User's Survey 2007 unfinished summary continued |
| Steve B | Intel Atom and D945GCLF2 |
| Wijnand Wiersma | Almost success: OpenBSD on Xen |
| Theo de Raadt | Re: dmesg IBM x3650 OpenBSD 4.3 |
| Richard Stallman | Real men don't attack straw men |
| Hugh Dickins | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Jens Axboe | Re: [BUG] New Kernel Bugs |
| Denys Fedoryshchenko | thousands of classes, e1000 TX unit hang |
| Adrian Bunk | [RFC: 2.6 patch] remove ieee80211_tx_frame() |
| Shared swap partition | 7 hours ago | Linux general |
| high memory | 2 days ago | Linux kernel |
| semaphore access speed | 2 days ago | Applications and Utilities |
| the kernel how to power off the machine | 2 days ago | Linux kernel |
| Easter Eggs in windows XP | 2 days ago | Windows |
| Root password | 2 days ago | Linux general |
| Where/when DNOTIFY is used? | 2 days ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 2 days ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 2 days ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 2 days ago | Linux general |
