[U-Boot-Users] [PATCH] Add call command on PPC

Kumar Gala galak at kernel.crashing.org
Fri Feb 15 07:00:27 CET 2008


On Feb 14, 2008, at 11:54 PM, Mike Frysinger wrote:

> On Friday 15 February 2008, Kumar Gala wrote:
>> --- /dev/null
>> +++ b/lib_ppc/cmd_call.c
>
> there's nothing ppc specific about this

I'm not familiar w/other architecture ABIs to say if that's true or  
not.  Clearly the upper limit may vary based on the differences in the  
ABIs.

>> +	if ((argc < 2) || (argc > 10)) {
>> ...
>> +U_BOOT_CMD(
>> +	call, CFG_MAXARGS, 1,	do_call,
>
> considering the u-boot infrastructure for commands will do the max  
> checking
> for you, there's no need to check the upper bound of argc.  it's  
> also out of
> sync: in one place you have a random "10" but in another you
> have "CFG_MAXARGS".

agreed.  At first I was going for something more generic.

>> +	(*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);
>> +
>> +	/* may not return */
>> +
>> +	return 0;
>
> why not ?  you might as well not arbitrarily limit things and have the
> prototype return an int and have it return that instead of "0":
> 	return (*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);

will do.

- k





More information about the U-Boot mailing list