[U-Boot] [PATCH V2] i.MX6Q: mx6qsabrelite: Add keypress support to alter boot flow

Eric Nelson eric.nelson at boundarydevices.com
Mon Apr 16 21:28:11 CEST 2012


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<eric.nelson at boundarydevices.com>
>> ---
>> 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
 >>
 >> <snip>
 >>
>> +	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).

>> +}
>> +
 >>
 >> <snip>
 >>
>> +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.


More information about the U-Boot mailing list