[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1171984555.3518.5.camel@hades.cambridge.redhat.com>
Date: Tue, 20 Feb 2007 15:15:55 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Theodore Tso <tytso@....edu>
Cc: Artem Bityutskiy <dedekind@...radead.org>,
Christoph Hellwig <hch@...radead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Frank Haverkamp <haver@...t.ibm.com>,
Josh Boyer <jwboyer@...ux.vnet.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 05/44 take 2] [UBI] internal common header
On Tue, 2007-02-20 at 09:55 -0500, Theodore Tso wrote:
> It appears that the reason why you are doing this is because you think
> you need the (packed) attribute. Not needed; Linux assumes all over
> the place 16, 32, and 64 types are packed. If Linux is ever compiled
> on an architecture where this isn't true, the compiler will probably
> need to be fixed so these assumptions are true, since all manner of
> things will break.
No, the packedness is irrelevant -- the reason is just to catch all the
places where you might otherwise forget to use byte-swapping accesses.
> It would be much better to use __be32 and __be64, so you get better
> type checking, and you will catch bugs caused by forgetting to use
> be32_to_cpu, et. al.
The technique Artem uses is derived from what I do in JFFS2. It predates
the use of sparse to catch such errors, and works in gcc for _everyone_
without having to do anything special (like run sparse).
--
dwmw2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists