]> git.itanic.dy.fi Git - linux-stable/commit
x86/pci: Clean up open-coded PCIBIOS return code mangling
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 24 Nov 2023 08:59:24 +0000 (10:59 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 1 Dec 2023 22:50:59 +0000 (16:50 -0600)
commit0d481ff35c9a85d775e5544bb2e331e7d5eb6c3c
treeead64576c33798fbc24ba26042844d42412febbd
parent420ac76610d76b09aebc0bfc722c7af9c6daf36a
x86/pci: Clean up open-coded PCIBIOS return code mangling

Per PCI Firmware spec r3.3, sec 2.5.2, 2.6.2, and 2.7, the return code for
these PCI BIOS interfaces is in 8 bits of the EAX register.  Previously it
was extracted by open-coded masks and shifting.

Name the return code bits with a #define and add pcibios_get_return_code()
to extract the return code to improve code readability. In addition,
replace zero test with PCIBIOS_SUCCESSFUL.

No functional changes intended.

Link: https://lore.kernel.org/r/20231124085924.13830-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/x86/pci/pcbios.c