From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH - RFC] Fix printf() format problems with configurable prompts
Date: Wed, 16 Jul 2008 15:57:48 -0400 [thread overview]
Message-ID: <487E52BC.3090400@ge.com> (raw)
In-Reply-To: <1216237196-26852-1-git-send-email-wd@denx.de>
Wolfgang Denk wrote:
> U-Boot allows for configurable prompt strings using the
> CONFIG_AUTOBOOT_PROMPT resp. CONFIG_MENUPROMPT definitions. So far,
> the assumption was that any such user defined problts would contain
> exactly one "%d" format specifier. But some boards did not.
>
> To allow for flexible boot prompts without adding too complex code we
> now allow to specify the whole list of printf() arguments in the user
> definition. This is powerful, but requires a responsible user who
> really understands what he is doing, as he needs to know for exanple
s/exanple/example/
> which variables are available in the respective context.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>
> This is an attempt to fix the
> main.c:215: warning: too many arguments for format
> main.c:119: warning: too many arguments for format
> warnings we got for some boards.
>
> I am not exactly happy about providing the complete list of printf()
> arguments in a #define, but this seems to be the solution that (1)
> requires the least changes to the code and (2) does not add memory
> footprint (like we would need if we added some format parsing
> function).
>
> Comments / critique welcome.
Hi Wolfgang,
It seems a lot simpler to reformat the couple of boards that don't have
%d in their string to add the "in %d seconds" type phrase.
The downside (risk!) of this is that some companies may be unhappy if
their boot prompt changes (ripple effect through manuals, humans trained
to see certain strings, programs expect-ing certain strings, etc.).
I'm OK with doing this to sacsng and Heiko Schocher is OK with sc3 (he
published a patch this afternoon). That leaves only three boards at
risk: hymod, motionpro, and voiceblue.
$ grep -A 1 CONFIG_AUTOBOOT_PROMPT include/configs/*.h |less | grep -v
'%d' | grep -v -- '--' | grep -v CONFIG_AUTOBOOT_DELAY_STR | grep -v
CONFIG_AUTOBOOT_STOP_STR
include/configs/hymod.h- "press
<SPACE> to stop\n"
include/configs/motionpro.h- "press
\"<Esc><Esc>\" to stop\n"
include/configs/sacsng.h:#define CONFIG_AUTOBOOT_PROMPT "Autobooting...\n"
include/configs/sc3.h:#define CONFIG_AUTOBOOT_PROMPT "\nSC3 -
booting... stop with ENTER\n"
include/configs/voiceblue.h:#define CONFIG_AUTOBOOT_PROMPT
"\nVoiceBlue Enterprise - booting...\n"
Best regards,
gvb
next prev parent reply other threads:[~2008-07-16 19:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 19:39 [U-Boot-Users] [PATCH - RFC] Fix printf() format problems with configurable prompts Wolfgang Denk
2008-07-16 19:57 ` Jerry Van Baren [this message]
2008-07-16 21:13 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=487E52BC.3090400@ge.com \
--to=gerald.vanbaren@ge.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.