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

2016-12-09 Thread Guenter Roeck
Fix overflows seen when writing voltage and temperature limit attributes. The value passed to DIV_ROUND_CLOSEST() needs to be clamped, and the value parameter passed to nct7802_write_fan_min() is an unsigned long. Also, writing values larger than 270 into a limit attribute results in writing

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

2016-12-12 Thread Jean Delvare
On Fri, 9 Dec 2016 12:41:02 -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, and the > value parameter passed to nct7802_write_fan_min() is an unsigned long. > > Also, writing

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

2016-12-12 Thread Guenter Roeck
Hi Jean, On 12/12/2016 02:03 AM, Jean Delvare wrote: On Fri, 9 Dec 2016 12:41:02 -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, and the value parameter passed to nct7802_write_f

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

2016-12-12 Thread Jean Delvare
On Mon, 12 Dec 2016 06:14:14 -0800, Guenter Roeck wrote: > Hi Jean, > > On 12/12/2016 02:03 AM, Jean Delvare wrote: > > On Fri, 9 Dec 2016 12:41:02 -0800, Guenter Roeck wrote: > >> Fix overflows seen when writing voltage and temperature limit attributes. > >> > >> The value passed to DIV_ROUND_CL