public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lan Chunhe <b25806@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2 v3] fdt: Add a do_fixup_by_path_string() function
Date: Thu, 18 Aug 2011 14:32:00 +0800	[thread overview]
Message-ID: <op.v0ecfmu4z91x4h@localhost.localdomain> (raw)
In-Reply-To: <4E4C5CFF.9020307@gmail.com>

On Thu, 18 Aug 2011 08:29:51 +0800, Jerry Van Baren <gvb.uboot@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

  reply	other threads:[~2011-08-18  6:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17  6:24 [U-Boot] [PATCH 1/2 v3] fdt: Add a do_fixup_by_path_string() function Chunhe Lan
2011-08-18  0:29 ` Jerry Van Baren
2011-08-18  6:32   ` Lan Chunhe [this message]
2011-08-18 15:14   ` Scott Wood
2011-08-28 18:15 ` Kumar Gala
2011-08-29  2:54   ` Chunhe Lan

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=op.v0ecfmu4z91x4h@localhost.localdomain \
    --to=b25806@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox