Re: [PATCH] EDAC, ie31200: Add Intel Coffee Lake CPU support

From: Luck, Tony
Date: Mon Jun 10 2019 - 14:05:51 EST


On Sun, Jun 09, 2019 at 05:16:13PM +0200, Marco Elver wrote:

Marco,

Thanks for the patch. One comment below.

> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_1), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_2), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_3), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_4), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_5), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_6), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_7), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_8), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> - {
> - PCI_VEND_DEV(INTEL, IE31200_HB_9), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> - IE31200},
> + { PCI_VEND_DEV(INTEL, IE31200_HB_1), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_2), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_3), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_4), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_5), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_6), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_7), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_8), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },
> + { PCI_VEND_DEV(INTEL, IE31200_HB_9), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
> + IE31200 },

Are these lines just changing the formatting from three lines
per entry to two?

I'm not opposed to this cleanup, but it isn't mentioned in the
commit message. If you *really* want to make this prettier
then a helper macro:

#define PCI_DEV_ENTRY(did, chip) PCI_VEND_DEV(INTEL, did), PCI_ANY_ID, PCI_ANY_ID, 0, 0, chip

would make it look like this:

static const struct pci_device_id ie31200_pci_tbl[] = {
{ PCI_DEV_ENTRY(IE31200_HB_1, IE31200) },
...
{ PCI_DEV_ENTRY(IE31200_HB_CFL_10, IE31200) },
{ 0, } /* 0 terminated list. */
};

Then make one patch that does the cleanup by adding the macro
and using it for existing entry (marked "no functional change").

Second patch to add the new bits for Coffee Lake.

Thanks

-Tony