Re: [PATCH] hwmon: lm80: fix a missing check of return value

2019-01-02 Thread Dan Carpenter
Hi Kangjie, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Kangjie-Lu/hwmon-lm80-fix-a-missing-check-of-return-value/20181222-023000 base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next smatch

Re: [PATCH 1/5] hwmon: (core) Inherit power properties to hdev

2018-10-18 Thread Dan Carpenter
Hi Nicolin, I love your patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Nicolin-Chen/hwmon-ina3221-Implement-PM-runtime-to-save-power/20181018-010754 base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next smatch

Re: [bug report] hwmon: (nct6775) Add support for weighted fan control

2018-09-06 Thread Dan Carpenter
On Wed, Sep 05, 2018 at 03:05:00PM -0700, Guenter Roeck wrote: > Hi Dan, > > On 09/05/2018 12:57 AM, Dan Carpenter wrote: > > Done. Btw, I saw another that looks legit. > > > Thanks ... > > > drivers/hwmon/nct6775.c:1687 nct6775_update_device() > > error:

Re: [bug report] hwmon: (nct6775) Add support for weighted fan control

2018-09-05 Thread Dan Carpenter
FAN_PULSE_SHIFT is either 5 or 6 elements. 1688 1689 nct6775_select_fan_div(dev, data, i, reg); 1690 } 1691 1692 nct6775_update_pwm(dev); 1693 nct6775_update_pwm_limits(dev); 1694 regards, dan carpenter

[PATCH 1/2] hwmon: (nct6775) Set weight source to zero correctly

2018-09-05 Thread Dan Carpenter
This is dead code because j can never be 1 at this point. We had intended to just test if the bit was clear. Fixes: bbd8decd4123 ("hwmon: (nct6775) Add support for weighted fan control") Signed-off-by: Dan Carpenter diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct67

[PATCH 2/2] hwmon: (nct6775) Clean up a condition

2018-09-05 Thread Dan Carpenter
I removed the "dsw_en &&" chunk of the condition because we know that "dsw_en" is set. Signed-off-by: Dan Carpenter diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index 139781ae830b..719effe53ceb 100644 --- a/drivers/hwmon/nct6775.c +++ b/driver

[bug report] hwmon: (nct6775) Add support for weighted fan control

2018-09-04 Thread Dan Carpenter
data */ 1565 for (j = 0; j < ARRAY_SIZE(data->weight_temp); j++) { 1566 data->weight_temp[j][i] 1567= nct6775_read_value(data, 1568 data->REG_WEIGHT_TEMP[j][i]); 1569 } 1570 } 1571 } regards, dan carpenter

[PATCH 2/2 v2] hwmon: (adt7475) Make adt7475_read_word() return errors

2018-08-14 Thread Dan Carpenter
The adt7475_read_word() function was meant to return negative error codes on failure. Signed-off-by: Dan Carpenter --- v2: In my first patch I just removed the error handling in the callers diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index 90837f7c7d0f..ec03359536aa 100644

Re: [PATCH 2/2] hwmon: (adt7475) Remove some unnecessary checks

2018-08-14 Thread Dan Carpenter
> I can do that. Drop this patch. I will resend. regards, dan carpenter

[PATCH 2/2] hwmon: (adt7475) Remove some unnecessary checks

2018-08-14 Thread Dan Carpenter
The adt7475_read_word() returns u16 values, so it's impossible for "ret" to be negative. The check is harmless, but static checkers complain about it. Signed-off-by: Dan Carpenter diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index 16045149f3db..9d3da8ea3

[PATCH 1/2] hwmon: (adt7475) Potential error pointer dereferences

2018-08-14 Thread Dan Carpenter
doesn't hurt anything to check. Signed-off-by: Dan Carpenter diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index 90837f7c7d0f..16045149f3db 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c @@ -962,13 +962,14 @@ static ssize_t show_pwmfreq(struct device *dev, struct

Re: [PATCH v4 2/2] hwmon: npcm750: add NPCM7xx PWM and Fan driver

2018-06-25 Thread Dan Carpenter
Hi Tomer, I love your patch! Perhaps something to improve: [auto build test WARNING on hwmon/hwmon-next] [also build test WARNING on v4.18-rc2 next-20180622] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[PATCH] hwmon: (w83773g) Fix a precedence bug in get_fault()

2017-12-05 Thread Dan Carpenter
Shift has higher precedence than mask but presumably we wanted to set *val to 1 if BIT(2) was set or 0 if the bit was clear. Fixes: de0a524e3e09 ("hwmon: Add W83773G driver") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/hwmon/w83773g.c b/drivers

[PATCH] hwmon: (max6621) Inverted if condition in max6621_read()

2017-10-24 Thread Dan Carpenter
or") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/hwmon/max6621.c b/drivers/hwmon/max6621.c index 22079ec29660..3f0eefb9 100644 --- a/drivers/hwmon/max6621.c +++ b/drivers/hwmon/max6621.c @@ -296,7 +296,7 @@ max6621_read(struct device *dev, enum hwm

Re: [PATCH] hwmon: (pmbus) Add missing break statements

2017-05-04 Thread Dan Carpenter
On Thu, May 04, 2017 at 09:28:19AM +0200, walter harms wrote: > > > Am 03.05.2017 21:31, schrieb Dan Carpenter: > > Static checkers complain about these missing break statements. > > > > Fixes: 6eaaea144dc5 ("hwmon: (pmbus) Add client driver for IR35221&qu

[PATCH] hwmon: (pmbus) Add missing break statements

2017-05-03 Thread Dan Carpenter
Static checkers complain about these missing break statements. Fixes: 6eaaea144dc5 ("hwmon: (pmbus) Add client driver for IR35221") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/hwmon/pmbus/ir35221.c b/drivers/hwmon/pmbus/ir35221.c index cc7b3b5425

[PATCH 2/2] hwmon: (tacho) Remove an unused variable

2017-04-10 Thread Dan Carpenter
We never use this global variable. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c index 2f22add5c73b..b96fff50a3ee 100644 --- a/drivers/hwmon/aspeed-pwm-tacho.c +++ b/drivers/hwmon/aspeed-pwm-t

[PATCH 1/2] hwmon: (tacho) Fix a condition in aspeed_get_fan_tach_ch_rpm()

2017-04-10 Thread Dan Carpenter
: cc96f6f6d766 ("hwmon: Support for ASPEED PWM/Fan tach") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Static analysis. Not tested. diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c index 29010ad94208..2f22add5c73b 100644 --- a/drivers/

[patch] hwmon: (max31790) potential ERR_PTR dereference

2016-10-12 Thread Dan Carpenter
We should only dereference "data" after we check if it is an error pointer. Fixes: 54187ff9d766 ('hwmon: (max31790) Convert to use new hwmon registration API') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/hwmon/max31790.c b/drivers/hwmon/max31790