Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-25 Thread Guenter Roeck
On Wed, Feb 25, 2015 at 11:59:51AM +0100, Bartosz Golaszewski wrote: > 2015-02-24 21:51 GMT+01:00 Guenter Roeck : > > I think the lm85 conversion actually introduces a bug with such an > > off-by-one mistake. And if it doesn't, there is still a unexplained > > and not easy to understand '-1' in

Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-25 Thread Bartosz Golaszewski
2015-02-24 21:51 GMT+01:00 Guenter Roeck : > I think the lm85 conversion actually introduces a bug with such an > off-by-one mistake. And if it doesn't, there is still a unexplained > and not easy to understand '-1' in one of the calls to find_closest(). > > So the question is if the new code

Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-25 Thread Guenter Roeck
On Wed, Feb 25, 2015 at 11:59:51AM +0100, Bartosz Golaszewski wrote: 2015-02-24 21:51 GMT+01:00 Guenter Roeck li...@roeck-us.net: I think the lm85 conversion actually introduces a bug with such an off-by-one mistake. And if it doesn't, there is still a unexplained and not easy to understand

Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-25 Thread Bartosz Golaszewski
2015-02-24 21:51 GMT+01:00 Guenter Roeck li...@roeck-us.net: I think the lm85 conversion actually introduces a bug with such an off-by-one mistake. And if it doesn't, there is still a unexplained and not easy to understand '-1' in one of the calls to find_closest(). So the question is if the

Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-24 Thread Guenter Roeck
On Tue, Feb 24, 2015 at 12:33:06PM -0800, Phil Pokorny wrote: > On Tue, Feb 24, 2015 at 9:42 AM, Bartosz Golaszewski > wrote: > > > > Searching for the member of an array closest to 'x' is > > duplicated in several places. > > > > Add two macros that implement this algorithm for arrays > > sorted

Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-24 Thread Phil Pokorny
On Tue, Feb 24, 2015 at 9:42 AM, Bartosz Golaszewski wrote: > > Searching for the member of an array closest to 'x' is > duplicated in several places. > > Add two macros that implement this algorithm for arrays > sorted both in ascending and descending order. I don't see the point here. You're

Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-24 Thread Guenter Roeck
On Tue, Feb 24, 2015 at 12:33:06PM -0800, Phil Pokorny wrote: On Tue, Feb 24, 2015 at 9:42 AM, Bartosz Golaszewski bgolaszew...@baylibre.com wrote: Searching for the member of an array closest to 'x' is duplicated in several places. Add two macros that implement this algorithm for

Re: [lm-sensors] [PATCH 1/4] kernel.h: add find_closest() macro

2015-02-24 Thread Phil Pokorny
On Tue, Feb 24, 2015 at 9:42 AM, Bartosz Golaszewski bgolaszew...@baylibre.com wrote: Searching for the member of an array closest to 'x' is duplicated in several places. Add two macros that implement this algorithm for arrays sorted both in ascending and descending order. I don't see the