From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCH] UBIFS: endian handling fixes and annotations Date: Tue, 02 Dec 2008 11:12:35 +0200 Message-ID: <1228209155.5029.30.camel@sauron> References: <1227287970-14684-1-git-send-email-dedekind@infradead.org> <1227287970-14684-3-git-send-email-dedekind@infradead.org> <20081122192747.GB21433@Chamillionaire.breakpoint.cc> Reply-To: dedekind@infradead.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Sebastian Andrzej Siewior Return-path: In-Reply-To: <20081122192747.GB21433@Chamillionaire.breakpoint.cc> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, 2008-11-22 at 20:27 +0100, Sebastian Andrzej Siewior wrote: > >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 ub= ifs_info *c, const void *k) > > { > > const union ubifs_key *key =3D k; > >=20 > >- return le32_to_cpu(key->u32[1]) >> UBIFS_S_KEY_BLOCK_BITS; > >+ return le32_to_cpu(key->j32[1]) >> UBIFS_S_KEY_BLOCK_BITS; >=20 > If you would change such references to something like > |return le32_to_cpup(&key->j32[1]) >> UBIFS_S_KEY_BLOCK_BITS; > then on powerpc >=20 > text data bss dec hex filename > 155384 1284 24 156692 26414 ubifs-b4.ko > 155372 1284 24 156680 26408 ubifs-after.ko >=20 > because now it is possible to load the value as LE from memory instea= d > of loading it BE and swapping it afterwads. Well, I think stuff like this should be done by either GCC or by a PPC-= specific 'le32_to_cpu()' implementation. --=20 Best regards, Artem Bityutskiy (=D0=91=D0=B8=D1=82=D1=8E=D1=86=D0=BA=D0=B8=D0=B9 =D0=90= =D1=80=D1=82=D1=91=D0=BC)