public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] crc32: Correct endianness of crc32 result
Date: Tue, 16 Apr 2013 19:00:49 -0400	[thread overview]
Message-ID: <516DD821.1000101@ti.com> (raw)
In-Reply-To: <CAPnjgZ2jRVpQ56_EpVKUMH8E1L2LJ0HgzNCs-GrN9bXfOSXz+Q@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/16/2013 05:57 PM, Simon Glass wrote:
> Hi Wolfgang,
> 
> On Sat, Apr 6, 2013 at 12:04 AM, Wolfgang Denk <wd@denx.de> wrote:
>> Dear Simon Glass,
>> 
>> In message <1365203470-9099-1-git-send-email-sjg@chromium.org>
>> you wrote:
>>> When crc32 is handled by the hash library, it requires the data
>>> to be in big-endian format, since it reads it byte-wise. Thus
>>> at present the 'crc32' command reports incorrect data. For
>>> example, previously we might see:
>> 
>> 
>>> +#ifdef USE_HOSTCC +     crc = htobe32(crc); memcpy(output,
>>> &crc, sizeof(crc)); +#else +     put_unaligned_be32(crc,
>>> output); +#endif
>> 
>> Why is this depending on USE_HOSTCC, and not on the endianess?
> 
> We always want big-endian in this case, since the bytes have to
> date been written that way by the crc32 command.

In other words, this code is executed on both the host and the target,
and there's not a uniform endian sanitizer function.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRbdghAAoJENk4IS6UOR1WzzsP/j+JhIIkp9EK4YwDQ7H6F06V
i60/Y/EaVg32HAqMjo66y2GCcu7ak9fobZo3wHnAjrFkaSJWq4s+eDNOtJiHbr/O
ZwQbDJ/t5Yf7vuZ1OhBTII+pYHXYcDW+30QZpBP3+ydY8Zkg7tsAcQ5rH7KdHWuD
83k7DLjv9obn85eeVikNkfB7ONNFVRug07Obcd+jbXdQamc/VWxWZyvUwDiKGCYH
eqmss/hQ7o343FWKqsVNSxd3/tF7z3PNevWm83xJxlc5xbtyJ/8kad6qkkILtOGd
G5OOXnL7BpSqL2mxt5ruW+cwqOnp74SvoQXuM6lNZzeAmlirAginYbnDSvjQamIy
DK1BQAjodXGU7nZxffw4vKZzbGzkgRl2KkuGvQfpMJzoJRyWvrbDzIVOeF/bXXQS
UEvASOFAdqKpMPNJnIm16GUtH6/OyEWK+8HInFse7K19ycM4M/TpM2dhmVZrHG0S
Q+Xq7ZI6pEq0SjMIfhuCwYJS6lqbtlQ5eOk+KoTYXOWneOzOgDGKO+El53wDwKQ5
0icIUwNKn4ZKMg7HLE25Docx3Ez6OVBD2Aelz0wlc5FMWlmLrHe9oYaufDN36bBH
D5XrLeBDjj89mTOHl4V0U3tZ/1iLLFqxo9RyNG6lPkLOQD62vLPxjyPYqY8Q6q85
kPdToR/o/YfFk3EsiYpD
=0O7d
-----END PGP SIGNATURE-----

  reply	other threads:[~2013-04-16 23:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 23:11 [U-Boot] [PATCH] crc32: Correct endianness of crc32 result Simon Glass
2013-04-05 23:32 ` Allen Martin
2013-04-06  7:04 ` Wolfgang Denk
2013-04-16 21:57   ` Simon Glass
2013-04-16 23:00     ` Tom Rini [this message]
2013-04-16 23:16       ` Simon Glass
2013-04-17  5:40     ` Wolfgang Denk
2013-04-17 18:28       ` Simon Glass
2013-04-17 19:23         ` Albert ARIBAUD
2013-04-17 20:59           ` Simon Glass
2013-04-18  6:20             ` Albert ARIBAUD
2013-04-18 10:36               ` Wolfgang Denk
2013-04-18 11:18                 ` Albert ARIBAUD
2013-04-18 14:39                   ` Wolfgang Denk
2013-04-18 16:39                     ` Albert ARIBAUD
2013-04-18 16:58                       ` Tom Rini
2013-04-18 18:43                         ` Albert ARIBAUD
2013-04-18 19:06                           ` Simon Glass
2013-04-18 19:18                             ` Tom Rini

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=516DD821.1000101@ti.com \
    --to=trini@ti.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