From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Mon, 16 Apr 2012 12:28:11 -0700 Subject: [U-Boot] [PATCH V2] i.MX6Q: mx6qsabrelite: Add keypress support to alter boot flow In-Reply-To: <201204161929.55214.marex@denx.de> References: <1334596335-25884-1-git-send-email-eric.nelson@boundarydevices.com> <201204161929.55214.marex@denx.de> Message-ID: <4F8C72CB.4000500@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Thanks for reviewing Marek, On 04/16/2012 10:29 AM, Marek Vasut wrote: > Dear Eric Nelson, > >> Uses the 'magic_keys' idiom as described in doc/README.kbd: >> http://lists.denx.de/pipermail/u-boot/2012-April/122502.html >> >> Signed-off-by: Eric Nelson >> --- >> V2 based on suggestion by Wolfgang to follow prior implementations. >> >> board/freescale/mx6qsabrelite/mx6qsabrelite.c | 121 >> ++++++++++++++++++++++++- include/configs/mx6qsabrelite.h | >> 3 + >> 2 files changed, 122 insertions(+), 2 deletions(-) >> >> diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c >> b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 1d09a72..9ca46e7 >> >> >> >> + buf[numpressed] = '\0' ; >> + return numpressed ; > > Delete the space before semicolon please. > Okay, but is there a rule here somewhere? There are a bunch of other spots in this source that have space before semicolon. >> +} >> + >> +static int do_kbd(cmd_tbl_t *cmdtp, int flag, int argc, char * const >> argv[]) +{ >> + char envvalue[ARRAY_SIZE(buttons)+1]; >> + int numpressed = read_keys(envvalue); >> + setenv("keybd", envvalue); >> + return 0 == numpressed ; > > Drop yoda condition > Okay again, but are yoda conditionals verboten in U-Boot sources? I find that this style catches typos (inadvertent assignments). >> +} >> + >> >> >> >> +static void preboot_keys(void) >> +{ >> + int i, numpressed ; >> + char keypress[ARRAY_SIZE(buttons)+1]; >> + numpressed = read_keys(keypress); >> + if (0 != numpressed) { > > Yoda ... > Got it. I'm replacing some others as well. >> + char *kbd_magic_keys = getenv("magic_keys"); >> + char *suffix; >> + /* loop over all magic keys; > > Fix comment please? > V3 forthcoming.