Re: [PATCH 2.6] Natsemi - remove compilation warnings

From: Linus Torvalds (torvalds_at_osdl.org)
Date: 09/30/04

  • Next message: Jeff Garzik: "Re: PATCH: resend: VIA Velocity belongs under gigabit ethernet"
    Date:	Thu, 30 Sep 2004 11:33:28 -0700 (PDT)
    To: Jeff Garzik <jgarzik@pobox.com>
    
    

    On Thu, 30 Sep 2004, Jeff Garzik wrote:
    > >
    > > +static inline void __iomem *ns_ioaddr(struct net_device *dev)
    > > +{
    > > + return (void __iomem *) dev->base_addr;
    > > +}
    > > +
    >
    > hmmmm. Since dev->base_addr gets exported to userspace, I don't think
    > it's that quick/easy to change.

    Hmm? This maintains the _exact_ old semantics, ie we do exactly what it
    used to do before. The inline function doesn't save the value off
    anywhere, it's really just a nicer way to do a cast in _one_ place rather
    than all over the world. Also, it ends up resulting in just _one_ place
    that knows where to get the base address, instead of several places in
    pretty much every function in the whole driver ;-P

    > Wouldn't it be better to just phase out the base of dev->base_addr
    > completely? I tend to prefer adding a "void __iomem *regs" to struct
    > netdev_private, and ignore dev->base_addr completely.

    Yes. I didn't want to change actual behaviour in a driver that I can't
    even test, so I went for the semantically 100% equivalent cleanup patch
    instead that just changes the syntax and gets rid of the warnings.

    But that's the other advantage of the ns_ioaddr() accessor function:
    somebody who does have the hw can now phase out "base_addr", and just
    change that one one-liner function, and you can now get the base address
    from anywhere you like ;)

                    Linus
    -
    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/


  • Next message: Jeff Garzik: "Re: PATCH: resend: VIA Velocity belongs under gigabit ethernet"

    Relevant Pages

    • Re: ppc: fix up pmac IDE driver for driver core changes
      ... Missed that core change, ... meaningless at this point (or rather, it's semantics are confuse and the ... While having a power_state field here for internal use of the driver may ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH linux-2.6.12-rc2-mm3] smc91c92_cs: Reduce stack usage in smc91c92_event()
      ... Read the patch. ... But should six functions all copy the exact same struct six ... patches to that driver. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] call drv->shutdown at rmmod
      ... Semantically the keyboard driver ... between the semantics of a halt and reboot. ... So to be clear the cases we have to get semantics straight for are. ...
      (Linux-Kernel)
    • RE: RE[PATCH]2.6.5-rc2 MSI Support for IA64
      ... We are thinking of replacing the semantics of assign_irq_vector ... of vectors currently avaiable in the system for any new allocations, ... Regarding your example, the last assigned vector is 0x39, the ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] [request for inclusion] Realtime LSM
      ... by default, unless you run an audio oriented distro, and we assume those ... the semantics of SCHED_FIFO are well ... deciding to run something else when jackd needs to run because it ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)