linux-mips
[Top] [All Lists]

Re: [PATCH][MIPS][2/7] AR7: mtd partition map

To: Matteo Croce <technoboy85@gmail.com>
Subject: Re: [PATCH][MIPS][2/7] AR7: mtd partition map
From: Christoph Hellwig <hch@lst.de>
Date: Thu, 20 Sep 2007 21:35:49 +0200
Cc: Christoph Hellwig <hch@lst.de>, linux-mips@linux-mips.org, Felix Fietkau <nbd@openwrt.org>, Eugene Konev <ejka@imfi.kspu.ru>, dwmw2@infradead.org, linux-mtd@lists.infradead.org, Andrew Morton <akpm@linux-foundation.org>
In-reply-to: <200709202129.12261.technoboy85@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200709201728.10866.technoboy85@gmail.com> <20070920175204.GA26132@lst.de> <200709202034.21764.technoboy85@gmail.com> <200709202129.12261.technoboy85@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.3.28i
On Thu, Sep 20, 2007 at 09:29:11PM +0200, Matteo Croce wrote:
> +#ifdef CONFIG_CPU_LITTLE_ENDIAN
> +#define LOADER_MAGIC1        0xfeedfa42
> +#define LOADER_MAGIC2        0xfeed1281
> +#else
> +#define LOADER_MAGIC1        0x42faedfe
> +#define LOADER_MAGIC2        0x8112edfe
> +#endif

Please keep only one defintion and use le/be32_to_cpu on it.

> +struct ar7_bin_rec {
> +     unsigned int checksum;
> +     unsigned int length;
> +     unsigned int address;
> +};

Wich means you'd need an endianess annotation here.  What about the
length and address fields, are they always native-endian unlike
the checksum field or will the need to be byte-swapped aswell?


<Prev in Thread] Current Thread [Next in Thread>