[3/6] xtensa: Use PCI_HEADER_TYPE_MFD instead of literal

Message ID 20231124090919.23687-3-ilpo.jarvinen@linux.intel.com
State New
Headers
Series [1/6] x86: Use PCI_HEADER_TYPE_* instead of literals |

Commit Message

Ilpo Järvinen Nov. 24, 2023, 9:09 a.m. UTC
  Replace literal 0x80 with PCI_HEADER_TYPE_MFD. While at it, convert
found_multi into boolean.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 arch/xtensa/lib/pci-auto.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
  

Comments

Max Filippov Nov. 29, 2023, 10:21 a.m. UTC | #1
On Fri, Nov 24, 2023 at 1:09 AM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> Replace literal 0x80 with PCI_HEADER_TYPE_MFD. While at it, convert
> found_multi into boolean.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>  arch/xtensa/lib/pci-auto.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Thanks. Applied to my xtensa tree.
  

Patch

diff --git a/arch/xtensa/lib/pci-auto.c b/arch/xtensa/lib/pci-auto.c
index aa6752237985..05fc02f9e1c7 100644
--- a/arch/xtensa/lib/pci-auto.c
+++ b/arch/xtensa/lib/pci-auto.c
@@ -11,6 +11,7 @@ 
  * Based on work from Matt Porter <mporter@mvista.com>
  */
 
+#include <linux/bitfield.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -222,10 +223,11 @@  pciauto_postscan_setup_bridge(struct pci_dev *dev, int current_bus, int sub_bus,
 
 int __init pciauto_bus_scan(struct pci_controller *pci_ctrl, int current_bus)
 {
-	int sub_bus, pci_devfn, pci_class, cmdstat, found_multi=0;
+	int sub_bus, pci_devfn, pci_class, cmdstat;
 	unsigned short vid;
 	unsigned char header_type;
 	struct pci_dev *dev = &pciauto_dev;
+	bool found_multi = false;
 
 	pciauto_dev.bus = &pciauto_bus;
 	pciauto_dev.sysdata = pci_ctrl;
@@ -261,11 +263,11 @@  int __init pciauto_bus_scan(struct pci_controller *pci_ctrl, int current_bus)
 			continue;
 
 		if (!PCI_FUNC(pci_devfn))
-			found_multi = header_type & 0x80;
+			found_multi = FIELD_GET(PCI_HEADER_TYPE_MFD, header_type);
 		pci_read_config_word(dev, PCI_VENDOR_ID, &vid);
 
 		if (vid == 0xffff || vid == 0x0000) {
-			found_multi = 0;
+			found_multi = false;
 			continue;
 		}