[U-Boot] [PATCH 1/2 v3] fdt: Add a do_fixup_by_path_string() function

Lan Chunhe b25806 at freescale.com
Thu Aug 18 08:32:00 CEST 2011


On Thu, 18 Aug 2011 08:29:51 +0800, Jerry Van Baren <gvb.uboot at gmail.com>  
wrote:

> Hi Chunhe Lan,
>
> On 08/17/2011 02:24 AM, Chunhe Lan wrote:
>
> [snip]
>
>> +
>> +static inline void do_fixup_by_path_string(void *fdt, const char *path,
>> +					   const char *prop, const char *status)
>> +{
>> +	do_fixup_by_path(fdt, path, prop, status, strlen(status) + 1, 1);
>> +}
>> +
>
> After all the good advice from Scott et al., the patch turns into a  
> pretty trivial one-liner.  I am questioning the advantage of calling
>    do_fixup_by_path_string(fdt, path, prop, status);
> vs. simply calling
>    do_fixup_by_path(fdt, path, prop, status, strlen(status) + 1, 1);
>
> The do_fixup_by_path_string() saves two parameters
>    "strlen(status) + 1, 1"
> at the cost of Yet Another Function.  Is it worth it?

     Yes, I think that it is worth.  The encapsulation of function is used
    for that purpose.

    Please refer to do_fixup_by_path_u32(), and it only has two
    lines code.

    Thanks.

    -Jack Lan



More information about the U-Boot mailing list