linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, Nohee Ko <noheek@broadcom.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [PATCH 3/3] staging: brcm80211: fix to use "%pM" flag to print MAC address
Date: Sun, 10 Oct 2010 12:44:10 +0200	[thread overview]
Message-ID: <1286707450.3547.8.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <dc990a5f703e69ed428ac2f2479779d36ef1eb3f.1286705921.git.andy.shevchenko@gmail.com>

On Sun, 2010-10-10 at 13:20 +0300, Andy Shevchenko wrote:

>  char *bcm_ether_ntoa(const struct ether_addr *ea, char *buf)
>  {
> -	static const char template[] = "%02x:%02x:%02x:%02x:%02x:%02x";
> -	snprintf(buf, 18, template,
> -		 ea->octet[0] & 0xff, ea->octet[1] & 0xff, ea->octet[2] & 0xff,
> -		 ea->octet[3] & 0xff, ea->octet[4] & 0xff, ea->octet[5] & 0xff);
> +	snprintf(buf, 18, "%pM", ea->octet);

That's a pretty strange use of snprintf -- just use sprintf if you don't
have a real buffer length.

johannes


  reply	other threads:[~2010-10-10 10:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-10 10:20 [PATCH 1/3] staging: brcm80211: clean up custom ctype library again Andy Shevchenko
2010-10-10 10:20 ` [PATCH 2/3] staging: brcm80211: remove custom string " Andy Shevchenko
2010-10-10 10:20 ` [PATCH 3/3] staging: brcm80211: fix to use "%pM" flag to print MAC address Andy Shevchenko
2010-10-10 10:44   ` Johannes Berg [this message]
2010-10-10 12:25     ` Andy Shevchenko
2010-10-10 12:41 ` [PATCH 1/3] staging: brcm80211: clean up custom ctype library again Greg KH
2010-10-11  9:17   ` Andy Shevchenko

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=1286707450.3547.8.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=andy.shevchenko@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=noheek@broadcom.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).