Linux-kernel mailing list archive 1998-48,: Re: patch to drivers/net/8390.c

# Re: patch to drivers/net/8390.c

Mikael Pettersson (mikpe@csd.uu.se)
Mon, 30 Nov 1998 17:29:00 +0100 (MET)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Mark Lord: "Re: IDE -> ATA DISK"
- Previous message: Matthias Urlichs: "Re: NFS in 2.1.130??"

Jes Sorensen writes:
> >>>>> "Mikael" == Mikael Pettersson <mikpe@csd.uu.se> writes:
>
> Mikael> 2.1.130 (actually one of the pre-patches) added an unused
> Mikael> local variable "ei_local" to
> Mikael> drivers/net/8390.c:NS8390_trigger_send(). Since the variable
> Mikael> is unused (proof by compilation on x86/UP), I'm assuming this
> Mikael> was a mistake. If so, please apply the included patch.
>
> And this is wrong!
>
> The variable is needed for machines which have the registers for the
> 8390 memory mapped!

Ok, I see that now. 8390.h conditionally defines a macro EI_SHIFT to
use ei_local as an implicit parameter if one of a small set of specific
config options is set. (Really nice coding style, not.)
Would it be acceptable to make the declaration of ei_local (in this
case) conditional on whether it's actually used? Something like:

--- ./8390.h.~1~ Sun Oct 4 19:21:00 1998
+++ ./8390.h Mon Nov 30 17:15:57 1998
@@ -210,8 +210,10 @@
#if defined(CONFIG_MAC) || defined(CONFIG_AMIGA_PCMCIA) || \
defined(CONFIG_ARIADNE2) || defined(CONFIG_ARIADNE2_MODULE)
+#define EI_SHIFT_SETUP(dev) struct ei_device *ei_local = (struct ei_device *) (dev)->priv
#define EI_SHIFT(x) (ei_local->reg_offset[x])
#else
+#define EI_SHIFT_SETUP(dev) /*empty*/
#define EI_SHIFT(x) (x)
#endif
--- ./8390.c.~1~ Fri Nov 20 20:42:52 1998
+++ ./8390.c Mon Nov 30 17:17:25 1998
@@ -950,7 +950,7 @@
int start_page)
{
int e8390_base = dev->base_addr;
- struct ei_device *ei_local = (struct ei_device *) dev->priv;
+ EI_SHIFT_SETUP(dev);
outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD);

/Mikael

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Mark Lord: "Re: IDE -> ATA DISK"
- Previous message: Matthias Urlichs: "Re: NFS in 2.1.130??"