[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080818143649.GD7908@solarflare.com>
Date: Mon, 18 Aug 2008 15:36:51 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: "David H. Lynch Jr." <dhlii@...sys.net>
Cc: linuxppc-embedded <linuxppc-embedded@...abs.org>,
netdev@...r.kernel.org
Subject: Re: [PATCH] Linux Device Driver for Xilinx LL TEMAC 10/100/1000 Ethernet NIC
I wrote:
> > +static struct net_device_stats *
> > +temac_get_stats(struct net_device *ndev)
> > +{
> > + return netdev_priv(ndev);
>
> Not even the right type. Do you read your compiler warnings?
Sorry, I now see that this is correct, though it's very fragile - it will
silently break if struct temac_local is reordered.
struct net_device includes a stats buffer which you should be able to use
instead of adding your own in struct temac_local.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists