linux/drivers/hwmon/pmbus
Guenter Roeck 04e216d19e hwmon: (pmbus) Move boolean error condition check to generating code
0-day rightfully complains about a sometimes uninitialized variable
in pmbus_get_boolean().

drivers/hwmon/pmbus/pmbus_core.c:903:13: warning:
		variable 'ret' is used uninitialized whenever 'if' condition is true
	} else if (!s1 || !s2) {

While that is technically true, it won't be hit in the field since the
condition indicates a programming error. Move the check of that condition
into the code generating the attribute entry, and refuse generating the
attribute if the condition is true. Swap the condition check in
pmbus_get_boolean() to ensure that static analyzers don't get a hiccup
(because we check if s1 and s2 are NULL, static analyzers may believe
that they can be NULL independently of each other).

Reported-by: kernel test robot <lkp@intel.com>
Cc: Alex Qiu <xqiu@google.com>
Reviewed-by: Alex Qiu <xqiu@google.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-09-23 09:42:41 -07:00
..
adm1266.c hwmon: (pmbus/adm1266) read blackbox 2020-09-23 09:42:41 -07:00
adm1275.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
bel-pfe.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ibm-cffps.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
inspur-ipsps.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ir35221.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ir38064.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
irps5401.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
isl68137.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
Kconfig hwmon: (pmbus/adm1266) Add support for GPIOs 2020-09-23 09:42:41 -07:00
lm25066.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ltc2978.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ltc3815.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
Makefile hwmon: (pmbus) Add support for ADM1266 2020-09-23 09:42:40 -07:00
max8688.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max16064.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max16601.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max20730.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max20751.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max31785.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max34440.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
pmbus_core.c hwmon: (pmbus) Move boolean error condition check to generating code 2020-09-23 09:42:41 -07:00
pmbus.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
pmbus.h hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
pxe1610.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
tps40422.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
tps53679.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ucd9000.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ucd9200.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
xdpe12284.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
zl6100.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00