linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jon Loeliger <jdl@jdl.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: libfdt: Abolish _typed() variants, add _cell() variants
Date: Tue, 20 Nov 2007 09:06:46 -0600	[thread overview]
Message-ID: <E1IuUgY-00021y-D2@jdl.com> (raw)
In-Reply-To: Your message of "Tue, 20 Nov 2007 13:35:46 +1100." <20071120023546.GA4356@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> In a number of places through libfdt and its tests, we have *_typed()
> macro variants on functions which use gcc's typeof and statement
> expression extensions to allow passing literals where the underlying
> function takes a buffer and size.
> 
> These seemed like a good idea at the time, but in fact they have some
> problems.  They use typeof and statement expressions, extensions I'd
> prefer to avoid for portability.  Plus, they have potential gotchas -
> although they'll deal with the size of the thing passed, they won't
> deal with other representation issues (like endianness) and results
> could be very strange if the type of the expression passed isn't what
> you think it is.
> 
> In fact, the only users of these _typed() macros were when the value
> passed is a single cell (32-bit integer).  Therefore, this patch
> removes all these _typed() macros and replaces them with explicit
> _cell() variants which handle a single 32-bit integer, and which also
> perform endian convesions as appropriate.
> 
> With this in place, it now becomes easy to use standardized big-endian
> representation for integer valued properties in the testcases,
> regardless of the platform we're running on.  We therefore do that,
> which has the additional advantage that all the example trees created
> during a test run are now byte-for-byte identical regardless of
> platform.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

jdl

      reply	other threads:[~2007-11-20 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20  2:35 libfdt: Abolish _typed() variants, add _cell() variants David Gibson
2007-11-20 15:06 ` Jon Loeliger [this message]

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=E1IuUgY-00021y-D2@jdl.com \
    --to=jdl@jdl.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).