From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <9604022024.AA26964@opt881.tko.dec.com> Date: Tue, 2 Apr 1996 07:45:43 +0300 (EET DST) From: Linus Torvalds Subject: Re: Patches for PCMCIA on UDB 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