Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-09-09 Thread Guenter Roeck
On Sun, Sep 09, 2012 at 10:38:41PM +0200, Geert Uytterhoeven wrote: > Hi Günter, > > On Sun, Sep 9, 2012 at 6:17 PM, Guenter Roeck wrote: > > On Sun, Sep 09, 2012 at 04:57:34PM +0200, Geert Uytterhoeven wrote: > >> On Fri, Aug 31, 2012 at 5:02 PM, Guenter Roeck wrote: > >> > DIV_ROUND_CLOSEST re

Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-09-09 Thread Geert Uytterhoeven
Hi Günter, On Sun, Sep 9, 2012 at 6:17 PM, Guenter Roeck wrote: > On Sun, Sep 09, 2012 at 04:57:34PM +0200, Geert Uytterhoeven wrote: >> On Fri, Aug 31, 2012 at 5:02 PM, Guenter Roeck wrote: >> > DIV_ROUND_CLOSEST returns a bad result for negative dividends: >> > DIV_ROUND_CLOSEST(-2, 2)

Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-09-09 Thread Guenter Roeck
On Sun, Sep 09, 2012 at 04:57:34PM +0200, Geert Uytterhoeven wrote: > On Fri, Aug 31, 2012 at 5:02 PM, Guenter Roeck wrote: > > DIV_ROUND_CLOSEST returns a bad result for negative dividends: > > DIV_ROUND_CLOSEST(-2, 2) = 0 > > > > Most of the time this does not matter. However, in the har

Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-09-09 Thread Geert Uytterhoeven
On Fri, Aug 31, 2012 at 5:02 PM, Guenter Roeck wrote: > DIV_ROUND_CLOSEST returns a bad result for negative dividends: > DIV_ROUND_CLOSEST(-2, 2) = 0 > > Most of the time this does not matter. However, in the hardware monitoring > subsystem, DIV_ROUND_CLOSEST is sometimes used on integers

Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-09-01 Thread Guenter Roeck
On Sat, Sep 01, 2012 at 07:02:54PM +0200, Jean Delvare wrote: > Hi Andrew, Guenter, > > On Fri, 31 Aug 2012 12:38:12 -0700, Andrew Morton wrote: > > On Fri, 31 Aug 2012 08:02:19 -0700 > > Guenter Roeck wrote: > > > > > DIV_ROUND_CLOSEST returns a bad result for negative dividends: > > > DIV_RO

Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-09-01 Thread Jean Delvare
Hi Andrew, Guenter, On Fri, 31 Aug 2012 12:38:12 -0700, Andrew Morton wrote: > On Fri, 31 Aug 2012 08:02:19 -0700 > Guenter Roeck wrote: > > > DIV_ROUND_CLOSEST returns a bad result for negative dividends: > > DIV_ROUND_CLOSEST(-2, 2) = 0 > > > > Most of the time this does not matter. Howev

Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-08-31 Thread Guenter Roeck
On Fri, Aug 31, 2012 at 12:38:12PM -0700, Andrew Morton wrote: > On Fri, 31 Aug 2012 08:02:19 -0700 > Guenter Roeck wrote: > > > DIV_ROUND_CLOSEST returns a bad result for negative dividends: > > DIV_ROUND_CLOSEST(-2, 2) = 0 > > > > Most of the time this does not matter. However, in the hard

Re: [PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-08-31 Thread Andrew Morton
On Fri, 31 Aug 2012 08:02:19 -0700 Guenter Roeck wrote: > DIV_ROUND_CLOSEST returns a bad result for negative dividends: > DIV_ROUND_CLOSEST(-2, 2) = 0 > > Most of the time this does not matter. However, in the hardware monitoring > subsystem, DIV_ROUND_CLOSEST is sometimes used on integer

[PATCH v4] linux/kernel.h: Fix DIV_ROUND_CLOSEST to support negative dividends

2012-08-31 Thread Guenter Roeck
DIV_ROUND_CLOSEST returns a bad result for negative dividends: DIV_ROUND_CLOSEST(-2, 2) = 0 Most of the time this does not matter. However, in the hardware monitoring subsystem, DIV_ROUND_CLOSEST is sometimes used on integers which can be negative (such as temperatures). Signed-off-by: Gu