]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2f4f14bb644bccae434bcc84a24ea1e09ad23e63
treed0c8d76b97ee1bf5606fb94a8b72b549c2b60f92
parent2adefb7e64a48ec40d172b8346042493dd2f3098
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