From: Harvey Harrison <harvey.harrison@gmail.com>
To: Adrian Hunter <ext-adrian.hunter@nokia.com>
Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>,
Artem Bityutskiy <dedekind@infradead.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] UBIFS: endian handling fixes and annotations
Date: Mon, 24 Nov 2008 08:46:01 -0800 [thread overview]
Message-ID: <1227545161.5511.2.camel@brick> (raw)
In-Reply-To: <492AB7F3.5020406@nokia.com>
On Mon, 2008-11-24 at 16:19 +0200, Adrian Hunter wrote:
> Sebastian Andrzej Siewior wrote:
> > * Artem Bityutskiy | 2008-11-21 19:19:24 [+0200]:
> >
> >> index 9ee6508..3f1f16b 100644
> >> --- a/fs/ubifs/key.h
> >> +++ b/fs/ubifs/key.h
> >> @@ -345,7 +345,7 @@ static inline int key_type_flash(const struct ubifs_info *c, const void *k)
> >> {
> >> const union ubifs_key *key = k;
> >>
> >> - return le32_to_cpu(key->u32[1]) >> UBIFS_S_KEY_BLOCK_BITS;
> >> + return le32_to_cpu(key->j32[1]) >> UBIFS_S_KEY_BLOCK_BITS;
> >
> > If you would change such references to something like
> > |return le32_to_cpup(&key->j32[1]) >> UBIFS_S_KEY_BLOCK_BITS;
> > then on powerpc
> >
> > text data bss dec hex filename
> > 155384 1284 24 156692 26414 ubifs-b4.ko
> > 155372 1284 24 156680 26408 ubifs-after.ko
> >
> > because now it is possible to load the value as LE from memory instead
> > of loading it BE and swapping it afterwads.
>
> Wouldn't that be true for every le32_to_cpu of an lvalue? Shame you can't
> do:
>
> is_lvalue(x) ? le32_to_cpup(&(x)) : le32_to_cpu(x)
>
No, you wouldn't want to do the above if the lvalue was on the stack as most
of the time the extra code to setup a pointer to a stack variable ends up
being more expensive than just using cpu_to_le32.
Cheers,
Harvey
next prev parent reply other threads:[~2008-11-24 16:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-21 17:19 UBIFS updates for 2.6.28 Artem Bityutskiy
2008-11-21 17:19 ` [PATCH] UBIFS: remove printk Artem Bityutskiy
2008-11-21 17:19 ` [PATCH] UBIFS: endian handling fixes and annotations Artem Bityutskiy
2008-11-22 19:27 ` Sebastian Andrzej Siewior
2008-11-23 3:21 ` Harvey Harrison
2008-11-23 9:28 ` Sebastian Andrzej Siewior
2008-11-23 10:05 ` Jamie Lokier
2008-11-24 14:19 ` Adrian Hunter
2008-11-24 16:46 ` Harvey Harrison [this message]
2008-12-02 9:12 ` Artem Bityutskiy
2008-11-21 17:19 ` [PATCH] MAINTAINERS: change UBI/UBIFS git tree URLs Artem Bityutskiy
2008-11-21 17:19 ` [PATCH] UBIFS: fix compilation warnings Artem Bityutskiy
2008-11-22 18:54 ` Sebastian Andrzej Siewior
2008-11-24 10:03 ` Adrian Hunter
2008-11-30 18:58 ` Sebastian Andrzej Siewior
2008-11-21 17:19 ` [PATCH] UBIFS: allow for gaps when dirtying the LPT Artem Bityutskiy
2008-11-21 17:19 ` [PATCH] UBIFS: do not print scary memory allocation warnings Artem Bityutskiy
2008-11-21 17:19 ` [PATCH] UBIFS: do not allocate too much Artem Bityutskiy
2008-11-21 17:19 ` [PATCH] UBIFS: pre-allocate bulk-read buffer Artem Bityutskiy
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=1227545161.5511.2.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=dedekind@infradead.org \
--cc=ext-adrian.hunter@nokia.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastian@breakpoint.cc \
/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).