netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Joe Perches <joe@perches.com>,
	Stephen Hemminger <stephen.hemminger@vyatta.com>,
	David Miller <davem@davemloft.net>,
	swise@opengridcomputing.com, rdreier@cisco.com,
	shemminger@vyatta.com, netdev@vger.kernel.org
Subject: Re: Printing the driver name as part of the netdev watchdog message
Date: Wed, 9 Jul 2008 19:28:50 +0100	[thread overview]
Message-ID: <20080709182849.GM28029@solarflare.com> (raw)
In-Reply-To: <20080709105631.492f86bd@infradead.org>

Arjan van de Ven wrote:
> On Wed, 09 Jul 2008 10:20:55 -0700
> Joe Perches <joe@perches.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.

      parent reply	other threads:[~2008-07-09 18:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 20:08 Printing the driver name as part of the netdev watchdog message Arjan van de Ven
2008-07-06 22:53 ` David Miller
2008-07-06 23:56   ` Arjan van de Ven
2008-07-07  1:51     ` Wang Chen
2008-07-07  3:59       ` David Miller
2008-07-07  4:34         ` Arjan van de Ven
2008-07-07  4:49           ` David Miller
2008-07-07  4:57             ` Arjan van de Ven
2008-07-07  6:44               ` David Miller
2008-07-07 15:23                 ` Arjan van de Ven
2008-07-07  1:08   ` Stephen Hemminger
2008-07-07  1:22     ` David Miller
2008-07-07  1:53       ` Jeff Garzik
2008-07-07 17:05         ` Stephen Hemminger
2008-07-07 22:45       ` Roland Dreier
2008-07-07 22:57         ` David Miller
2008-07-07 23:14           ` Roland Dreier
2008-07-07 23:44             ` Stephen Hemminger
2008-07-08  0:10               ` Arjan van de Ven
2008-07-08 19:13             ` Steve Wise
2008-07-08 21:31               ` David Miller
2008-07-08 21:47                 ` Arjan van de Ven
2008-07-08 21:57                   ` David Miller
2008-07-08 23:48                     ` Arjan van de Ven
2008-07-08 23:53                       ` David Miller
2008-07-09  0:17                         ` Arjan van de Ven
2008-07-09  1:44                         ` Arjan van de Ven
2008-07-09  3:16                           ` Stephen Hemminger
2008-07-09 17:20                             ` Joe Perches
2008-07-09 17:56                               ` Arjan van de Ven
2008-07-09 18:20                                 ` Joe Perches
2008-07-09 18:50                                   ` Arjan van de Ven
2008-07-09 18:28                                 ` Ben Hutchings [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080709182849.GM28029@solarflare.com \
    --to=bhutchings@solarflare.com \
    --cc=arjan@infradead.org \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --cc=shemminger@vyatta.com \
    --cc=stephen.hemminger@vyatta.com \
    --cc=swise@opengridcomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).