Re: [PATCH] M68k IDE updates

From: Geert Uytterhoeven (geert@linux-m68k.org)
Date: Tue Apr 15 2003 - 03:14:20 EST


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/



This archive was generated by hypermail 2b29 : Tue Apr 15 2003 - 22:00:35 EST