From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 20 Jul 2012 13:35:21 +0200 Subject: [U-Boot] [PATCH 5/7] dfu:cmd: Support for DFU u-boot command In-Reply-To: <201207200022.50410.vapier@gentoo.org> References: <1341308291-14663-1-git-send-email-l.majewski@samsung.com> <201207032332.54228.marex@denx.de> <201207200022.50410.vapier@gentoo.org> Message-ID: <201207201335.21962.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mike Frysinger, > On Tuesday 03 July 2012 17:32:54 Marek Vasut wrote: > > > +int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > > > +{ > > > + char *str_env = NULL, *env_bkp = NULL; > > > + static char *s = "dfu"; > > > + int ret = 0; > > > + > > > + if (argc < 3) > > > + return CMD_RET_USAGE; > > > + > > > + str_env = getenv("dfu_alt_info"); > > > + if (str_env == NULL) { > > > + printf("%s: \"dfu_alt_info\" env variable not defined!\n", > > > + __func__); > > > > I was always curious if it's not possible to do something like > > > > puts(__func__ "rest of string"); > > > > Maybe it'd help the overhead a bit? Certainly, it's beyond the scope of > > this patchset, I'm just curious :) > > not anymore -- gcc disabled support for that sometime ago. and it's good > they did as it causes more bloat than good. as soon as you do more than > one statement, you get duplication. the string table will have: > "some_func: rest of string" > "some_func: boo" > "some_func: another message" > which takes up more space than: > "some_func" > "%s: rest of string" > "%s: boo" > "%s: another message" Good knowing this. I'd expect gcc would build some trie in there to optimize the size. > -mike Best regards, Marek Vasut