mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/message/i2o/i2o_proc.c: use %pM to show MAC address
Date: Wed, 30 Dec 2009 11:33:12 -0800	[thread overview]
Message-ID: <1262201592.2545.45.camel@Joe-Laptop.home> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE19090200F659@mi8nycmail19.Mi8.com>

On Wed, 2009-12-30 at 14:22 -0500, H Hartley Sweeten wrote:
> Use the %pM kernel extension to display the MAC address.
> diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
> index 7045c45..949a648 100644
> --- a/drivers/message/i2o/i2o_proc.c
> +++ b/drivers/message/i2o/i2o_proc.c
> @@ -111,10 +111,7 @@ static int print_serial_number(struct seq_file *seq, u8 * serialno, int max_len)
>  		break;
>  
>  	case I2O_SNFORMAT_LAN48_MAC:	/* LAN-48 MAC Address */
> -		seq_printf(seq,
> -			   "LAN-48 MAC address @ %02X:%02X:%02X:%02X:%02X:%02X",
> -			   serialno[2], serialno[3],
> -			   serialno[4], serialno[5], serialno[6], serialno[7]);
> +		seq_printf(seq, "LAN-48 MAC address @ %pM", &serialno[2]);
>  		break;
>  
>  	case I2O_SNFORMAT_WAN:	/* WAN MAC Address */
> @@ -126,10 +123,8 @@ static int print_serial_number(struct seq_file *seq, u8 * serialno, int max_len)
>  	case I2O_SNFORMAT_LAN64_MAC:	/* LAN-64 MAC Address */
>  		/* FIXME: Figure out what a LAN-64 address really looks like?? */
>  		seq_printf(seq,
> -			   "LAN-64 MAC address @ [?:%02X:%02X:?] %02X:%02X:%02X:%02X:%02X:%02X",
> -			   serialno[8], serialno[9],
> -			   serialno[2], serialno[3],
> -			   serialno[4], serialno[5], serialno[6], serialno[7]);
> +			   "LAN-64 MAC address @ [?:%02X:%02X:?] %pM",
> +			   serialno[8], serialno[9], &serialno[2]);

User visible change but low probability to break things


  reply	other threads:[~2009-12-30 19:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30 19:22 H Hartley Sweeten
2009-12-30 19:33 ` Joe Perches [this message]
2010-01-05 16:51 H Hartley Sweeten
2010-01-07  9:18 ` 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=1262201592.2545.45.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=hartleys@visionengravers.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®