pci: Only link pci_rom.o in some cases
Subsystems (2)
PATCH 1/2 pci: Only link pci_rom.o in some cases
The content of pci_rom.c is only used in a few cases. Only build and link in these cases to avoid a global variable as gcc doesn't always discard those when they are unused.
--- drivers/pci/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/Makefile +2 -2
@@ -4,12 +4,12 @@ # Wolfgang Denk, DENX Software Engineering, wd at denx.de. ifneq ($(CONFIG_DM_PCI),) -obj-y += pci_rom.o +obj-$(CONFIG_DM_VIDEO) += pci_rom.o obj-$(CONFIG_PCI) += pci-uclass.o pci_auto.o obj-$(CONFIG_DM_PCI_COMPAT) += pci_compat.o obj-$(CONFIG_PCI_SANDBOX) += pci_sandbox.o obj-$(CONFIG_SANDBOX) += pci-emul-uclass.o -obj-$(CONFIG_X86) += pci_x86.o +obj-$(CONFIG_X86) += pci_x86.o pci_rom.o else obj-$(CONFIG_PCI) += pci.o pci_auto_old.o endif
Signature · 1 line
2.17.1
PATCH 1/2 pci: Only link pci_rom.o in some cases
Quoted 5 lines · Tom Rini
The content of
pci_rom.cis only used in a few cases. Only build and link in these cases to avoid a global variable as gcc doesn't always discard those when they are unused.Signed-off-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191203/0706ccc5/attachment.sig>
PATCH 2/2 mtd: mtdcore: Drop unused mtd_table
In reply to Tom RiniThe array 'mtd_table' is unused in the code. Remove this as gcc doesn't always discard unused global variables.
--- drivers/mtd/mtdcore.c | 2 -- 1 file changed, 2 deletions(-)
drivers/mtd/mtdcore.c +0 -2
@@ -76,8 +76,6 @@ static struct class mtd_class = { .resume = mtd_cls_resume, };#else -struct mtd_info *mtd_table[MAX_MTD_DEVICES ]; -#define MAX_IDR_ID 64 struct idr_layer {
Signature · 1 line
2.17.1
PATCH 2/2 mtd: mtdcore: Drop unused mtd_table
Quoted 4 lines · Tom Rini
The array '
mtd_table' is unused in the code. Remove this as gcc doesn't always discard unused global variables.Signed-off-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191203/3d635781/attachment.sig>