OSDN Git Service

hwmon: (i5k_amb, vt8231) Drop uses of pci_read_config_*() return value
authorSaheed O. Bolarinwa <refactormyself@gmail.com>
Sat, 1 Aug 2020 11:24:39 +0000 (13:24 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 4 Aug 2020 21:24:39 +0000 (14:24 -0700)
commit2207515db60a6885e11069251d4f4ca4bf3abb6b
treed0c8d76b97ee1bf5606fb94a8b72b549c2b60f92
parent2fdf8f7f086712bbe296d1d4d4049ca88e7a662d
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: Bjorn Helgaas <bjorn@helgaas.com>
Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
Link: https://lore.kernel.org/r/20200801112446.149549-11-refactormyself@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/i5k_amb.c
drivers/hwmon/vt8231.c