[Skiboot] [PATCH v2 1/3] core/pci-quirk: Re-order struct members

Oliver O'Halloran oohall at gmail.com
Thu Aug 1 16:44:22 AEST 2019


Having the function first throws out the alignment on the VDID since the
functions names are probably different lengths. Swap them ordering of
the struct members so the VDID comes first to keep things tidy.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
v2: Fixed pci-quirk-test
    Found the commit message.
---
 core/pci-quirk.c          | 4 ++--
 core/test/run-pci-quirk.c | 4 ++--
 include/pci-quirk.h       | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/pci-quirk.c b/core/pci-quirk.c
index e8f9d2238456..6832b9cee2ac 100644
--- a/core/pci-quirk.c
+++ b/core/pci-quirk.c
@@ -43,8 +43,8 @@ static void quirk_astbmc_vga(struct phb *phb __unused,
 /* Quirks are: {fixup function, vendor ID, (device ID or PCI_ANY_ID)} */
 static const struct pci_quirk quirk_table[] = {
 	/* ASPEED 2400 VGA device */
-	{ &quirk_astbmc_vga, 0x1a03, 0x2000 },
-	{ NULL, 0, 0 }
+	{ 0x1a03, 0x2000, &quirk_astbmc_vga },
+	{ 0, 0, NULL }
 };
 
 static void __pci_handle_quirk(struct phb *phb, struct pci_device *pd,
diff --git a/core/test/run-pci-quirk.c b/core/test/run-pci-quirk.c
index 2f71302815f5..4c57c61adadf 100644
--- a/core/test/run-pci-quirk.c
+++ b/core/test/run-pci-quirk.c
@@ -42,8 +42,8 @@ static void test_fixup(struct phb *phb __unused, struct pci_device *pd __unused)
 /* Quirks are: {fixup function, vendor ID, (device ID or PCI_ANY_ID)} */
 static const struct pci_quirk test_quirk_table[] = {
 	/* ASPEED 2400 VGA device */
-	{ &test_fixup, 0x1a03, 0x2000 },
-	{ NULL, 0, 0 }
+	{ 0x1a03, 0x2000, &test_fixup },
+	{ 0, 0, NULL }
 };
 
 #define PCI_COMPOSE_VDID(vendor, device) (((device) << 16) | (vendor))
diff --git a/include/pci-quirk.h b/include/pci-quirk.h
index 784970c18df8..0ad5555574fa 100644
--- a/include/pci-quirk.h
+++ b/include/pci-quirk.h
@@ -9,9 +9,9 @@
 #define PCI_ANY_ID 0xFFFF
 
 struct pci_quirk {
-	void (*fixup)(struct phb *, struct pci_device *);
 	uint16_t vendor_id;
 	uint16_t device_id;
+	void (*fixup)(struct phb *, struct pci_device *);
 };
 
 void pci_handle_quirk(struct phb *phb, struct pci_device *pd);
-- 
2.21.0



More information about the Skiboot mailing list