All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Michael Chan <mchan@broadcom.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	anilgv@broadcom.com, michaelc@cs.wisc.edu,
	david.somayajulu@qlogic.com
Subject: Re: [ETH]: Combine format_addr() with print_mac().
Date: Fri, 21 Dec 2007 23:02:45 -0800	[thread overview]
Message-ID: <1198306965.4895.5.camel@localhost> (raw)
In-Reply-To: <1198295882.6752.9.camel@dell>

On Fri, 2007-12-21 at 19:58 -0800, Michael Chan wrote:
> The dev_addr is declared as unsigned char* in struct net_device.  To be
> consistent, can we change print_mac() and MAC_BUF to use unsigned char*?
> They are really the same.

That's fine by me.  I like consistency.
I don't remember why it was u8 and not unsigned char.

> > ssize_t? shouldn't it be size_t?
> I'm just keeping the prototype unchanged as originally defined in net-
> sysfs.c

It's painless to change the prototype.
size_t seems more sensible.

> > Indexing buf by int len is unchecked.
> > That could lead to unintended buffer overruns.
> > Maybe add a buflen argument and use snprintf?
> Again, I kept the semantics the same as the original, but will be happy
> to add a buflen for better checking.

That sounds good.

cheers, Joe


  reply	other threads:[~2007-12-22  7:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21 22:05 [ETH]: Combine format_addr() with print_mac() Michael Chan
2007-12-21 22:36 ` Joe Perches
2007-12-22  3:58   ` Michael Chan
2007-12-22  7:02     ` Joe Perches [this message]
2007-12-24  0:20       ` Michael Chan
2007-12-25  5:28         ` David Miller

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=1198306965.4895.5.camel@localhost \
    --to=joe@perches.com \
    --cc=anilgv@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=david.somayajulu@qlogic.com \
    --cc=mchan@broadcom.com \
    --cc=michaelc@cs.wisc.edu \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.