[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080709182849.GM28029@solarflare.com>
Date: Wed, 9 Jul 2008 19:28:50 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Arjan van de Ven <arjan@...radead.org>
Cc: Joe Perches <joe@...ches.com>,
Stephen Hemminger <stephen.hemminger@...tta.com>,
David Miller <davem@...emloft.net>,
swise@...ngridcomputing.com, rdreier@...co.com,
shemminger@...tta.com, netdev@...r.kernel.org
Subject: Re: Printing the driver name as part of the netdev watchdog message
Arjan van de Ven wrote:
> On Wed, 09 Jul 2008 10:20:55 -0700
> Joe Perches <joe@...ches.com> wrote:
>
> > On Tue, 2008-07-08 at 20:16 -0700, Stephen Hemminger wrote:
> > > > +void netdev_drivername(struct net_device *dev, char *buffer, int
> > > > len)
> > > void netdev_drivername(const struct net_device *dev, char *buffer,
> > > int len) since net device not changed.
> >
> > char *netdev_drivername(const struct net_dev *dev, char *buffer,
> > size_t len)
> >
> > size_t len and returns *buffer
> >
> > allows:
> >
> > char drivername[64];
> > printk(KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit timed
> > out\n", dev->name, netdev_drivername(dev, drivername,
> > sizeof(drivername));
>
> I like the return a char * (updated patch below)
> I don't like the size_t... size_t is an abstraction to deal with file
> sizes.... but there's nothing else wrong with using an int for numbers.
[...]
size_t is for memory sizes - that's why sizeof() expressions have that
type. File sizes are loff_t.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
--
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