All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] cmd: Rework disk.c usage
@ 2016-09-09 11:26 Tom Rini
  2016-09-09 19:54 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rini @ 2016-09-09 11:26 UTC (permalink / raw)
  To: u-boot

We only need the function found in cmd/disk.c when we have IDE, SCSI or
USB_STORAGE enabled.  While the first two are easy to get right, in the
3rd case we assume that the set of cases where we do have USB and do not
enable USB_STORAGE are small enough that we can take the small bloat of
un-discarded strings on gcc prior to 6.x

Signed-off-by: Tom Rini <trini@konsulko.com>
---
This gives us back ~144 bytes in SPL on many boards and adds ~120 bytes on
xfi3, sansa_fuze_plus, smartweb, eco5pk and p2771-0000-500 in U-Boot itself.

 cmd/Makefile | 7 +++----
 cmd/disk.c   | 3 ---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/cmd/Makefile b/cmd/Makefile
index a1ecf73ef314..81b98ee0d751 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -70,7 +70,7 @@ obj-$(CONFIG_CMD_GPIO) += gpio.o
 obj-$(CONFIG_CMD_I2C) += i2c.o
 obj-$(CONFIG_CMD_IOTRACE) += iotrace.o
 obj-$(CONFIG_CMD_HASH) += hash.o
-obj-$(CONFIG_CMD_IDE) += ide.o
+obj-$(CONFIG_CMD_IDE) += ide.o disk.o
 obj-$(CONFIG_CMD_IMMAP) += immap.o
 obj-$(CONFIG_CMD_INI) += ini.o
 obj-$(CONFIG_CMD_IRQ) += irq.o
@@ -115,7 +115,7 @@ obj-$(CONFIG_CMD_REMOTEPROC) += remoteproc.o
 obj-$(CONFIG_SANDBOX) += host.o
 obj-$(CONFIG_CMD_SATA) += sata.o
 obj-$(CONFIG_CMD_SF) += sf.o
-obj-$(CONFIG_SCSI) += scsi.o
+obj-$(CONFIG_SCSI) += scsi.o disk.o
 obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
 obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
 obj-$(CONFIG_CMD_SOFTSWITCH) += softswitch.o
@@ -137,7 +137,7 @@ ifdef CONFIG_LZMA
 obj-$(CONFIG_CMD_LZMADEC) += lzmadec.o
 endif
 
-obj-$(CONFIG_CMD_USB) += usb.o
+obj-$(CONFIG_CMD_USB) += usb.o disk.o
 obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
 obj-$(CONFIG_CMD_FS_UUID) += fs_uuid.o
 
@@ -162,4 +162,3 @@ obj-$(CONFIG_CMD_BLOB) += blob.o
 
 # core command
 obj-y += nvedit.o
-obj-y += disk.o
diff --git a/cmd/disk.c b/cmd/disk.c
index 92de3af8a5c0..3d2a3d22045b 100644
--- a/cmd/disk.c
+++ b/cmd/disk.c
@@ -8,8 +8,6 @@
 #include <command.h>
 #include <part.h>
 
-#if defined(CONFIG_CMD_IDE) || defined(CONFIG_SCSI) || \
-	defined(CONFIG_USB_STORAGE)
 int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
 		    char *const argv[])
 {
@@ -130,4 +128,3 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
 
 	return bootm_maybe_autostart(cmdtp, argv[0]);
 }
-#endif
-- 
1.9.1

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

* [U-Boot] [PATCH 1/1] cmd: Rework disk.c usage
  2016-09-09 11:26 [U-Boot] [PATCH 1/1] cmd: Rework disk.c usage Tom Rini
@ 2016-09-09 19:54 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2016-09-09 19:54 UTC (permalink / raw)
  To: u-boot

On Fri, Sep 09, 2016 at 07:26:45AM -0400, Tom Rini wrote:

> We only need the function found in cmd/disk.c when we have IDE, SCSI or
> USB_STORAGE enabled.  While the first two are easy to get right, in the
> 3rd case we assume that the set of cases where we do have USB and do not
> enable USB_STORAGE are small enough that we can take the small bloat of
> un-discarded strings on gcc prior to 6.x
> 
> 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: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160909/3d0d07c6/attachment.sig>

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

end of thread, other threads:[~2016-09-09 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 11:26 [U-Boot] [PATCH 1/1] cmd: Rework disk.c usage Tom Rini
2016-09-09 19:54 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.