Skip to content
Commit 2207515d authored by Saheed O. Bolarinwa's avatar Saheed O. Bolarinwa Committed by Guenter Roeck
Browse files

hwmon: (i5k_amb, vt8231) Drop uses of pci_read_config_*() return value



The return value of pci_read_config_*() may not indicate a device error.
However, the value read by these functions is more likely to indicate
this kind of error. This presents two overlapping ways of reporting
errors and complicates error checking.

It is possible to move to one single way of checking for error if the
dependency on the return value of these functions is removed, then it
can later be made to return void.

Remove all uses of the return value of pci_read_config_*().
Check the actual value read for ~0. In this case, ~0 is an invalid
value thus it indicates some kind of error.

Suggested-by: default avatarBjorn Helgaas <bjorn@helgaas.com>
Signed-off-by: default avatarSaheed O. Bolarinwa <refactormyself@gmail.com>
Link: https://lore.kernel.org/r/20200801112446.149549-11-refactormyself@gmail.com
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 2fdf8f7f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment