[U-Boot] [PATCH v5 5/9] Don't include standard parser if hush is used

Simon Glass sjg at chromium.org
Tue Mar 6 07:06:38 CET 2012


Hi Mike,

On Mon, Mar 5, 2012 at 8:39 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Wednesday 15 February 2012 00:59:22 Simon Glass wrote:
>> This saves about 1KB of code space on ARM with CONFIG_SYS_HUSH_PARSER
>> defined.
>>
>> --- a/common/main.c
>> +++ b/common/main.c
>> @@ -1132,6 +1132,7 @@ int parse_line (char *line, char *argv[])
>>
>>  /*************************************************************************
>> ***/
>>
>> +#ifndef CONFIG_SYS_HUSH_PARSER
>>  static void process_macros (const char *input, char *output)
>>  {
>>       char c, prev;
>> @@ -1382,6 +1383,7 @@ static int builtin_run_command(const char *cmd, int
>> flag)
>>
>>       return rc ? rc : repeatable;
>>  }
>> +#endif
>
> not sure why this is needed ... this wraps two static funcs, so gcc should be
> able to see that they're unused and automatically delete them shouldn't it ?
> why do you need the explicit ifdef ?

Actually I think this can be dropped. I think originally I didn't go
as far as making builtin_run_command() static (due to calls from
elsewhere), which might explain why I wanted that. Now that the
function is not exported, this patch is not needed. It can be dropped
from the series.

Regards,
Simon

> -mike


More information about the U-Boot mailing list