[lkml]   [2004]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2.6] Natsemi - remove compilation warnings
Linus Torvalds wrote:
> On Thu, 30 Sep 2004, Franz Pletz wrote:
>>It seems like your patch unfortunately went into 2.6.9-rc2-mm[3,4] and
> It's definitely not in _my_ -rc3. Which kernel are you looking at?
>>My Natsemi network card stops working with 2.6.9-rc3. After succesfully
>>revoking your patch from
>>everything works fine.
> That patch does indeed look totally bogus. The reason a lot of network

<blink> <blink> <blink> This patch is so bogus its laffable. I think
akpm forgot his coffee, I know he's smarter than that :)

> drivers complain about readl/writel is that "struct net_device" is very
> confused about what the IO addresses mean, and they mean different things
> for different users. Which makes type safety basically disappear, and now
> that we check it more carefully, things break.
> This patch should clean up natsemi.c a bit, and makes the warnings go
> away. Does it work for you? (It really should, it's just a basic
> search-and-replace fix).
> This is bigger than the broken patch, but that's really pretty
> unavoidable, unless "struct net_device" is fixed. And the way it's
> structured, if "net_device" ever _is_ fixed, this driver will now be
> trivially updated.
> Linus
> ----
> ===== drivers/net/natsemi.c 1.68 vs edited =====
> --- 1.68/drivers/net/natsemi.c 2004-07-27 11:18:53 -07:00
> +++ edited/drivers/net/natsemi.c 2004-09-30 10:22:44 -07:00
> @@ -719,7 +719,7 @@
> };
> static void move_int_phy(struct net_device *dev, int addr);
> -static int eeprom_read(long ioaddr, int location);
> +static int eeprom_read(void __iomem *ioaddr, int location);
> static int mdio_read(struct net_device *dev, int reg);
> static void mdio_write(struct net_device *dev, int reg, u16 data);
> static void init_phy_fixup(struct net_device *dev);
> @@ -769,9 +769,15 @@
> static int netdev_get_regs(struct net_device *dev, u8 *buf);
> static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
> +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.

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.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:06    [W:0.079 / U:1.040 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site