public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases
@ 2019-11-27  1:40 Tom Rini
  2019-11-27  1:41 ` [U-Boot] [PATCH 2/2] mtd: mtdcore: Drop unused mtd_table Tom Rini
  2019-12-04  4:02 ` [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Rini @ 2019-11-27  1:40 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 drivers/pci/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 219473aa7924..da8b826d69c3 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] mtd: mtdcore: Drop unused mtd_table
  2019-11-27  1:40 [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases Tom Rini
@ 2019-11-27  1:41 ` Tom Rini
  2019-12-04  4:02   ` Tom Rini
  2019-12-04  4:02 ` [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Rini @ 2019-11-27  1:41 UTC (permalink / raw)
  To: u-boot

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 <trini@konsulko.com>
---
 drivers/mtd/mtdcore.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 89ac8229f584..dd04d676d56c 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -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 {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases
  2019-11-27  1:40 [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases Tom Rini
  2019-11-27  1:41 ` [U-Boot] [PATCH 2/2] mtd: mtdcore: Drop unused mtd_table Tom Rini
@ 2019-12-04  4:02 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-12-04  4:02 UTC (permalink / raw)
  To: u-boot

On Tue, Nov 26, 2019 at 08:40:59PM -0500, Tom Rini wrote:

> 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.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] mtd: mtdcore: Drop unused mtd_table
  2019-11-27  1:41 ` [U-Boot] [PATCH 2/2] mtd: mtdcore: Drop unused mtd_table Tom Rini
@ 2019-12-04  4:02   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2019-12-04  4:02 UTC (permalink / raw)
  To: u-boot

On Tue, Nov 26, 2019 at 08:41:00PM -0500, Tom Rini wrote:

> 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 <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-04  4:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-27  1:40 [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases Tom Rini
2019-11-27  1:41 ` [U-Boot] [PATCH 2/2] mtd: mtdcore: Drop unused mtd_table Tom Rini
2019-12-04  4:02   ` Tom Rini
2019-12-04  4:02 ` [U-Boot] [PATCH 1/2] pci: Only link pci_rom.o in some cases Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox