Re: [PATCH] M68k IDE updates
Geert Uytterhoeven (geert@linux-m68k.org)
Tue, 15 Apr 2003 10:14:20 +0200 (MEST)
On Tue, 15 Apr 2003, Paul Mackerras wrote:
> Geert Uytterhoeven writes:
> > 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)) {
>
> I really think that whether the driveid needs swapping should be
> regarded as a property of the interface, not of the system as a whole.
>
> I like the idea of adding a "read in driveid" function pointer to the
> ide_hwif_t structure. Most systems would set that to the same as the
> INSW function pointer. For those systems where the hardware designer
> suffered a momentary dizzy spell we can set it to point to a function
> that does the necessary byte-swapping.
That sounds OK to me.
But I'd like to have the actual swapping code in a common source or header
file, else we fall back to the old approach, where all platforms that needed it
implemented there own driveid swapping code, which had to be kept in sync when
more reserved fields in the driveid got an actual meaning.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In 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/