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

Christoph Hellwig hch at lst.de
Thu Sep 20 15:35:49 EDT 2007


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?




More information about the linux-mtd mailing list