Re: [PATCH 09/17] hwmon: (nct7802) Fix overflows seen when writing into limit attributes

2016-12-09 Thread Guenter Roeck
On Fri, Dec 09, 2016 at 04:25:48PM +0100, Jean Delvare wrote: > On Fri, 9 Dec 2016 06:22:43 -0800, Guenter Roeck wrote: > > On 12/09/2016 01:49 AM, Jean Delvare wrote: > > > Looking at function nct7802_write_fan_min() I think an overflow can > > > happen here too, as DIV_ROUND_CLOSEST() is called

Re: [PATCH 09/17] hwmon: (nct7802) Fix overflows seen when writing into limit attributes

2016-12-09 Thread Jean Delvare
On Fri, 9 Dec 2016 06:22:43 -0800, Guenter Roeck wrote: > On 12/09/2016 01:49 AM, Jean Delvare wrote: > > Looking at function nct7802_write_fan_min() I think an overflow can > > happen here too, as DIV_ROUND_CLOSEST() is called before clamp_val(). > > Any reason why you did not fix that one? > > >

Re: [PATCH 09/17] hwmon: (nct7802) Fix overflows seen when writing into limit attributes

2016-12-09 Thread Guenter Roeck
Hi Jean, On 12/09/2016 01:49 AM, Jean Delvare wrote: Hi Guenter, On Sun, 4 Dec 2016 20:55:32 -0800, Guenter Roeck wrote: Fix overflows seen when writing voltage and temperature limit attributes. The value passed to DIV_ROUND_CLOSEST() needs to be clamped. Signed-off-by: Guenter Roeck

Re: [PATCH 09/17] hwmon: (nct7802) Fix overflows seen when writing into limit attributes

2016-12-09 Thread Jean Delvare
Hi Guenter, On Sun, 4 Dec 2016 20:55:32 -0800, Guenter Roeck wrote: > Fix overflows seen when writing voltage and temperature limit attributes. > > The value passed to DIV_ROUND_CLOSEST() needs to be clamped. > > Signed-off-by: Guenter Roeck I think you can also add:

[PATCH 09/17] hwmon: (nct7802) Fix overflows seen when writing into limit attributes

2016-12-04 Thread Guenter Roeck
Fix overflows seen when writing voltage and temperature limit attributes. The value passed to DIV_ROUND_CLOSEST() needs to be clamped. Signed-off-by: Guenter Roeck --- drivers/hwmon/nct7802.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git