From: Alexander Aring <alex.aring@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/4] environment: Add function to load envfs from buffer
Date: Sat, 22 Feb 2014 20:40:58 +0100 [thread overview]
Message-ID: <20140222194056.GA4455@omega> (raw)
In-Reply-To: <20140222182851.GL17250@pengutronix.de>
On Sat, Feb 22, 2014 at 07:28:51PM +0100, Sascha Hauer wrote:
> Hi Alex,
>
> On Thu, Feb 20, 2014 at 04:16:05PM +0100, Alexander Aring wrote:
> > Hi Sascha,
> >
> > > - printf("Open %s %s\n", filename, errno_str());
> > > - return -1;
> > > + if (ENVFS_32(super->magic) != ENVFS_MAGIC) {
> > > + printf("envfs: wrong magic\n");
> > > + return -EIO;
> >
> > In this case only on big endians machines:
> > if (super->magic != ENVFS_32(ENVFS_MAGIC))
> >
> > is faster than:
> > if (ENVFS_32(super->magic) != ENVFS_MAGIC)
> >
> > It's save (I suppose) ca. 4 instruktions... so it doesn't matter
> > to change it.
>
> You're right that it's slightly more efficient. I think that it's more
> obviously correct converting the 'foreign' value to host order, so I
> think I'll keep my version.
thanks for your answer. Yeah, maybe I am hanging a little bit too much
on netdev mailinglist where all netdevs checks on something like this
because it's mostly in some atomic context. This need to be fast and
not beautiful in a kind of human thinking. :-)
- Alex
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-02-22 19:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 13:49 [PATCH 1/4] filetype: Add detection for barebox environment Sascha Hauer
2014-02-20 13:49 ` [PATCH 2/4] environment: constify arguments Sascha Hauer
2014-02-20 13:49 ` [PATCH 3/4] environment: Add function to load envfs from buffer Sascha Hauer
2014-02-20 15:16 ` Alexander Aring
2014-02-22 18:28 ` Sascha Hauer
2014-02-22 19:40 ` Alexander Aring [this message]
2014-02-20 13:49 ` [PATCH 4/4] defaultenv: Align defaultenv array Sascha Hauer
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=20140222194056.GA4455@omega \
--to=alex.aring@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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