From: Linus Torvalds <torvalds@cs.Helsinki.FI>
Subject: Re: Patches for PCMCIA on UDB
Date: Tue, 2 Apr 1996 07:45:43 +0300 (EET DST) [thread overview]
Message-ID: <a555ef7062e2f63bdeb9a8a19e0debf8.axp-list@archive.invalid> (raw)
In-Reply-To: <9604012232.AA03025@ives.amt.tay1.dec.com>
On Mon, 1 Apr 1996, Jim Paradis wrote:
>
> There are two sets of patches; one for pcmcia-cs-2.8.9, and one for
> the Linux kernel. My kernel patch is against 1.3.81, but it's so
> generic that it'll probably work against many earlier revs as well.
Ok, the kernel one is in (or in my "todo" queue, actually), but
> diff -u --recursive pcmcia-cs-2.8.9-orig/modules/cistpl.c pcmcia-cs-2.8.9/modules/cistpl.c
> --- pcmcia-cs-2.8.9-orig/modules/cistpl.c Thu Feb 29 12:10:33 1996
> +++ pcmcia-cs-2.8.9/modules/cistpl.c Fri Mar 22 14:09:37 1996
> @@ -79,7 +79,11 @@
> #endif
> for ( ; len > 0; len--, ptr++, sys += inc) {
> if (sys > (u_char *)mem->sys_stop) break;
> +#ifdef USE_MEM_ACCESS_ROUTINES
> + *ptr = _readb(sys);
> +#else
> *ptr = *sys;
> +#endif
> }
> }
> } /* read_cis_mem */
The above kind of horror it too ugly to survive. I don't care _too_ much,
as pcmcia isn't in the kernel, but I'd rather not even be distantly
associated with anything like this.
Remember: #ifdef is _ugly_, and should be avoided at all costs.
Use "readb()" (without the underscore), and it should work on all
platforms. No ifdefs, no direct pointer accesses. The alpha isn't the
only architecture that needs something like this (PPC has the PCI address
space shifted up in emmory space etc).
Linus
next prev parent reply other threads:[~1996-04-02 4:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199602292030.MAA13819@vulcan.craftwork.com>
1996-04-01 22:32 ` Patches for PCMCIA on UDB Jim Paradis
1996-04-02 4:45 ` Linus Torvalds [this message]
1996-04-03 20:19 ` David Hinds
1996-04-05 21:27 ` David Hinds
[not found] <Pine.LNX.3.91.960402074030.12990D-100000@linux.cs.Helsinki.FI>
1996-04-02 6:28 ` Jim Paradis
1996-04-02 19:13 ` David Hinds
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox