Skip to content

Commit ecf61c7

Browse files
michal42bjorn-helgaas
authored andcommittedNov 25, 2013
PCI: Omit PCI ID macro strings to shorten quirk names
Pasting the verbatim PCI_(VENDOR|DEVICE)_* macros in the __pci_fixup_* symbol names results in insanely long names such as __pci_fixup_resumePCI_VENDOR_ID_SERVERWORKSPCI_DEVICE_ID_SERVERWORKS_HT1000SBquirk_disable_broadcom_boot_interrupt When Link-Time Optimization adds its numeric suffix to such symbol, it overflows the namebuf[KSYM_NAME_LEN] array in kernel/kallsyms.c. Use the line number instead to create (nearly) unique symbol names. Reported-by: Joe Mario <[email protected]> Signed-off-by: Michal Marek <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Andi Kleen <[email protected]>
1 parent 4bff674 commit ecf61c7

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed
 

‎include/linux/pci.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -1567,65 +1567,65 @@ enum pci_fixup_pass {
15671567
/* Anonymous variables would be nice... */
15681568
#define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \
15691569
class_shift, hook) \
1570-
static const struct pci_fixup __pci_fixup_##name __used \
1570+
static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \
15711571
__attribute__((__section__(#section), aligned((sizeof(void *))))) \
15721572
= { vendor, device, class, class_shift, hook };
15731573

15741574
#define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \
15751575
class_shift, hook) \
15761576
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \
1577-
vendor##device##hook, vendor, device, class, class_shift, hook)
1577+
hook, vendor, device, class, class_shift, hook)
15781578
#define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \
15791579
class_shift, hook) \
15801580
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \
1581-
vendor##device##hook, vendor, device, class, class_shift, hook)
1581+
hook, vendor, device, class, class_shift, hook)
15821582
#define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \
15831583
class_shift, hook) \
15841584
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \
1585-
vendor##device##hook, vendor, device, class, class_shift, hook)
1585+
hook, vendor, device, class, class_shift, hook)
15861586
#define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \
15871587
class_shift, hook) \
15881588
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \
1589-
vendor##device##hook, vendor, device, class, class_shift, hook)
1589+
hook, vendor, device, class, class_shift, hook)
15901590
#define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \
15911591
class_shift, hook) \
15921592
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \
1593-
resume##vendor##device##hook, vendor, device, class, \
1593+
resume##hook, vendor, device, class, \
15941594
class_shift, hook)
15951595
#define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \
15961596
class_shift, hook) \
15971597
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \
1598-
resume_early##vendor##device##hook, vendor, device, \
1598+
resume_early##hook, vendor, device, \
15991599
class, class_shift, hook)
16001600
#define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \
16011601
class_shift, hook) \
16021602
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \
1603-
suspend##vendor##device##hook, vendor, device, class, \
1603+
suspend##hook, vendor, device, class, \
16041604
class_shift, hook)
16051605

16061606
#define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \
16071607
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \
1608-
vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook)
1608+
hook, vendor, device, PCI_ANY_ID, 0, hook)
16091609
#define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \
16101610
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \
1611-
vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook)
1611+
hook, vendor, device, PCI_ANY_ID, 0, hook)
16121612
#define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \
16131613
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \
1614-
vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook)
1614+
hook, vendor, device, PCI_ANY_ID, 0, hook)
16151615
#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \
16161616
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \
1617-
vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook)
1617+
hook, vendor, device, PCI_ANY_ID, 0, hook)
16181618
#define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \
16191619
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \
1620-
resume##vendor##device##hook, vendor, device, \
1620+
resume##hook, vendor, device, \
16211621
PCI_ANY_ID, 0, hook)
16221622
#define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \
16231623
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \
1624-
resume_early##vendor##device##hook, vendor, device, \
1624+
resume_early##hook, vendor, device, \
16251625
PCI_ANY_ID, 0, hook)
16261626
#define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \
16271627
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \
1628-
suspend##vendor##device##hook, vendor, device, \
1628+
suspend##hook, vendor, device, \
16291629
PCI_ANY_ID, 0, hook)
16301630

16311631
#ifdef CONFIG_PCI_QUIRKS

0 commit comments

Comments
 (0)
Please sign in to comment.