Skip to content

Commit

Permalink
core/pci-quirk: Re-order struct members
Browse files Browse the repository at this point in the history
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@gmail.com>
Reviewed-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Alistair Popple <alistair@popple.id.au>
  • Loading branch information
oohal committed Aug 2, 2019
1 parent 2554cac commit 9142bb3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/pci-quirk.c
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions core/test/run-pci-quirk.c
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion include/pci-quirk.h
Expand Up @@ -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);
Expand Down

0 comments on commit 9142bb3

Please sign in to comment.