I think the least-intrusive solution is something like this:
--- linux-2.5/drivers/ide/ide-iops.c.orig Mon Apr 14 21:43:30 2003
+++ linux-2.5/drivers/ide/ide-iops.c Mon Apr 14 21:44:53 2003
@@ -423,8 +423,7 @@
*/
void ide_fix_driveid (struct hd_driveid *id)
{
-#ifndef __LITTLE_ENDIAN
-# ifdef __BIG_ENDIAN
+ if (ide_driveid_needs_swapping(id)) {
int i;
u16 *stringcast;
@@ -512,10 +511,7 @@
for (i = 0; i < 48; i++)
id->words206_254[i] = __le16_to_cpu(id->words206_254[i]);
id->integrity_word = __le16_to_cpu(id->integrity_word);
-# else
-# error "Please fix <asm/byteorder.h>"
-# endif
-#endif
+ }
}
EXPORT_SYMBOL(ide_fix_driveid);
Where ide_driveid_needs_swapping() is #define'd to return 0 (never swap), 1
(always swap), or whatever architecture-specific logic you need.
We can even have defaults in <linux/ide.h>
#ifndef ide_driveid_needs_swapping
# ifdef __LITTLE_ENDIAN
# define ide_driveid_needs_swapping(id) 0
# else
# ifdef __BIG_ENDIAN
# define ide_driveid_needs_swapping(id) 1
# else
# error "Please fix <asm/byteorder.h>"
# endif
# endif
#endif
Sounds sufficiently sane?
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.orgIn personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/