mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Aring <alex.aring@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/4] environment: Add function to load envfs from buffer
Date: Sat, 22 Feb 2014 19:28:51 +0100	[thread overview]
Message-ID: <20140222182851.GL17250@pengutronix.de> (raw)
In-Reply-To: <20140220151601.GA1171@x61s.Speedport_W_921V_1_24_000>

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.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-02-22 18:29 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 [this message]
2014-02-22 19:40       ` Alexander Aring
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=20140222182851.GL17250@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    /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