All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugeniu Rosca <erosca@de.adit-jv.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/5] fdt: boot_get_fdt: remove redundant zeroing out
Date: Thu, 18 Apr 2019 12:18:11 +0200	[thread overview]
Message-ID: <20190418101811.GA23739@vmlxhi-102.adit-jv.com> (raw)
In-Reply-To: <CAPnjgZ219pRhD2NKSTNx-aB1h8LtQOP2RwZN3-cd-nu20RrL5A@mail.gmail.com>

Hi Simon,

On Wed, Apr 17, 2019 at 09:33:06PM -0700, Simon Glass wrote:
> Hi Eugeniu,
> 
> On Mon, 1 Apr 2019 at 03:46, Eugeniu Rosca <erosca@de.adit-jv.com> wrote:
> >
> > Paranoid programming [1] lies at the foundation of proper software
> > development, but the repetitive zeroing-out of output arguments in the
> > context of the same function rather clutters the code and inhibits
> > further refactoring/optimization than is doing any good.
> >
> > In boot_get_fdt(), we already perform zero/NULL-initialization of
> > *of_flat_tree and *of_size at the beginning of the function, so doing
> > the same at function error-out is redundant/superfluous.
> >
> > Moreover, keeping the code unchanged might encourage the developers to
> > update *of_flat_tree and *of_size during some interim computations,
> > which is against the current design of boot_get_fdt(). Currently,
> > writing useful data into these arguments happens just before
> > successfully returning from boot_get_fdt() and it should better stay so.
> >
> > [1] https://blog.regehr.org/archives/1106
> >
> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> > ---
> > Changes in v2:
> >  - s/zeroint-out/zeroing-out/ in commit description
> >  - Link v1: https://patchwork.ozlabs.org/patch/1071586/
> > ---
> >  common/image-fdt.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> But please update the comment to for the function:
> 
> *     of_flat_tree and of_size are set to 0 if no fdt exists

Thank you very much for the review. Since the patch is part of a series
and there are no other comments except this one, should I decouple it
and send as v3 standalone or there is still some chance for getting
feedback for the other patches (and sending an update for the whole
series)?

> 
> Regards,
> Simon

Best regards,
Eugeniu.

  reply	other threads:[~2019-04-18 10:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 10:45 [U-Boot] [PATCH v2 0/5] boot_get_fdt: clean up and use 'fdtaddr' as fallback for Android Eugeniu Rosca
2019-04-01 10:45 ` [U-Boot] [PATCH v2 1/5] fdt: boot_get_fdt: remove redundant zeroing out Eugeniu Rosca
2019-04-18  4:33   ` Simon Glass
2019-04-18 10:18     ` Eugeniu Rosca [this message]
2019-04-20  1:36       ` Simon Glass
2019-04-22  2:38       ` sjg at google.com
2019-04-25 17:00     ` Eugeniu Rosca
2019-04-01 10:45 ` [U-Boot] [PATCH v2 2/5] fdt: boot_get_fdt: really boot w/o FDT when "goto no_fdt" Eugeniu Rosca
2019-04-21 19:26   ` Simon Glass
2019-04-22  2:38   ` sjg at google.com
2019-04-25 17:04     ` Eugeniu Rosca
2019-04-01 10:45 ` [U-Boot] [PATCH v2 3/5] fdt: boot_get_fdt: simplify no_fdt handling (non-functional) Eugeniu Rosca
2019-04-21 19:26   ` Simon Glass
2019-04-22  2:38   ` sjg at google.com
2019-04-01 10:45 ` [U-Boot] [PATCH v2 4/5] fdt: boot_get_fdt: android: compress " Eugeniu Rosca
2019-04-21 19:26   ` Simon Glass
2019-04-22  2:38   ` sjg at google.com
2019-04-01 10:52 ` [U-Boot] [PATCH v2 5/5] fdt: boot_get_fdt: android: use ENV 'fdtaddr' as fallback Eugeniu Rosca
2019-04-01 15:26   ` Eugeniu Rosca
2019-04-21 19:26   ` Simon Glass
2019-04-22  2:38   ` sjg at google.com

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=20190418101811.GA23739@vmlxhi-102.adit-jv.com \
    --to=erosca@de.adit-jv.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.