linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/atm/lanai.c: use %pM to show MAC address
@ 2010-01-05 16:26 H Hartley Sweeten
  2010-01-07  9:15 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: H Hartley Sweeten @ 2010-01-05 16:26 UTC (permalink / raw)
  To: Linux Kernel; +Cc: netdev, davem

Use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David S. Miller <davem@davemloft.net>

---

Repost due to merge issues.

diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index cf97c34..7fe7c32 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -998,9 +998,7 @@ static int __devinit eeprom_validate(struct lanai_dev *lanai)
 			    (unsigned int) e[EEPROM_MAC_REV + i]);
 			return -EIO;
 		}
-	DPRINTK("eeprom: MAC address = %02X:%02X:%02X:%02X:%02X:%02X\n",
-		e[EEPROM_MAC + 0], e[EEPROM_MAC + 1], e[EEPROM_MAC + 2],
-		e[EEPROM_MAC + 3], e[EEPROM_MAC + 4], e[EEPROM_MAC + 5]);
+	DPRINTK("eeprom: MAC address = %pM\n", &e[EEPROM_MAC]);
 	/* Verify serial number */
 	lanai->serialno = eeprom_be4(lanai, EEPROM_SERIAL);
 	v = eeprom_be4(lanai, EEPROM_SERIAL_REV);
@@ -2483,14 +2481,8 @@ static int lanai_proc_read(struct atm_dev *atmdev, loff_t *pos, char *page)
 		return sprintf(page, "revision: board=%d, pci_if=%d\n",
 		    lanai->board_rev, (int) lanai->pci->revision);
 	if (left-- == 0)
-		return sprintf(page, "EEPROM ESI: "
-		    "%02X:%02X:%02X:%02X:%02X:%02X\n",
-		    lanai->eeprom[EEPROM_MAC + 0],
-		    lanai->eeprom[EEPROM_MAC + 1],
-		    lanai->eeprom[EEPROM_MAC + 2],
-		    lanai->eeprom[EEPROM_MAC + 3],
-		    lanai->eeprom[EEPROM_MAC + 4],
-		    lanai->eeprom[EEPROM_MAC + 5]);
+		return sprintf(page, "EEPROM ESI: %pM\n",
+		    &lanai->eeprom[EEPROM_MAC]);
 	if (left-- == 0)
 		return sprintf(page, "status: SOOL=%d, LOCD=%d, LED=%d, "
 		    "GPIN=%d\n", (lanai->status & STATUS_SOOL) ? 1 : 0,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drivers/atm/lanai.c: use %pM to show MAC address
  2010-01-05 16:26 [PATCH] drivers/atm/lanai.c: use %pM to show MAC address H Hartley Sweeten
@ 2010-01-07  9:15 ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-01-07  9:15 UTC (permalink / raw)
  To: hartleys; +Cc: linux-kernel, netdev

From: H Hartley Sweeten <hartleys@visionengravers.com>
Date: Tue, 5 Jan 2010 09:26:49 -0700

> Use the %pM kernel extension to display the MAC address.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drivers/atm/lanai.c: use %pM to show MAC address
  2009-12-30 18:59 ` Joe Perches
@ 2009-12-30 23:56   ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2009-12-30 23:56 UTC (permalink / raw)
  To: Joe Perches; +Cc: H Hartley Sweeten, linux-kernel, netdev, David Miller

On Wed, 30 Dec 2009, Joe Perches wrote:
> > +		return sprintf(page, "EEPROM ESI: %pM\n",
> > +		    &lanai->eeprom[EEPROM_MAC]);
> 
> This is a user-visible change from upper case to lower case.
> Probably doesn't matter, but maybe...

Something would need to be _really_ broken to:

1. Parse the kernel log after MACs in the first place
2. Be case-sensitive about it

If it breaks anything, it is a breakage well deserved...

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drivers/atm/lanai.c: use %pM to show MAC address
  2009-12-30 18:50 H Hartley Sweeten
@ 2009-12-30 18:59 ` Joe Perches
  2009-12-30 23:56   ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2009-12-30 18:59 UTC (permalink / raw)
  To: H Hartley Sweeten; +Cc: linux-kernel, netdev, David Miller

On Wed, 2009-12-30 at 13:50 -0500, H Hartley Sweeten wrote:
> Use the %pM kernel extension to display the MAC address.
> diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
> index cf97c34..7fe7c32 100644
> --- a/drivers/atm/lanai.c
> +++ b/drivers/atm/lanai.c
[]
> @@ -2483,14 +2481,8 @@ static int lanai_proc_read(struct atm_dev *atmdev, loff_t *pos, char *page)
>  		return sprintf(page, "revision: board=%d, pci_if=%d\n",
>  		    lanai->board_rev, (int) lanai->pci->revision);
>  	if (left-- == 0)
> -		return sprintf(page, "EEPROM ESI: "
> -		    "%02X:%02X:%02X:%02X:%02X:%02X\n",
> -		    lanai->eeprom[EEPROM_MAC + 0],
> -		    lanai->eeprom[EEPROM_MAC + 1],
> -		    lanai->eeprom[EEPROM_MAC + 2],
> -		    lanai->eeprom[EEPROM_MAC + 3],
> -		    lanai->eeprom[EEPROM_MAC + 4],
> -		    lanai->eeprom[EEPROM_MAC + 5]);
> +		return sprintf(page, "EEPROM ESI: %pM\n",
> +		    &lanai->eeprom[EEPROM_MAC]);

This is a user-visible change from upper case to lower case.
Probably doesn't matter, but maybe...



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] drivers/atm/lanai.c: use %pM to show MAC address
@ 2009-12-30 18:50 H Hartley Sweeten
  2009-12-30 18:59 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: H Hartley Sweeten @ 2009-12-30 18:50 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: David Miller

Use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David S. Miller <davem@davemloft.net>

---

diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index cf97c34..7fe7c32 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -998,9 +998,7 @@ static int __devinit eeprom_validate(struct lanai_dev *lanai)
 			    (unsigned int) e[EEPROM_MAC_REV + i]);
 			return -EIO;
 		}
-	DPRINTK("eeprom: MAC address = %02X:%02X:%02X:%02X:%02X:%02X\n",
-		e[EEPROM_MAC + 0], e[EEPROM_MAC + 1], e[EEPROM_MAC + 2],
-		e[EEPROM_MAC + 3], e[EEPROM_MAC + 4], e[EEPROM_MAC + 5]);
+	DPRINTK("eeprom: MAC address = %pM\n", &e[EEPROM_MAC]);
 	/* Verify serial number */
 	lanai->serialno = eeprom_be4(lanai, EEPROM_SERIAL);
 	v = eeprom_be4(lanai, EEPROM_SERIAL_REV);
@@ -2483,14 +2481,8 @@ static int lanai_proc_read(struct atm_dev *atmdev, loff_t *pos, char *page)
 		return sprintf(page, "revision: board=%d, pci_if=%d\n",
 		    lanai->board_rev, (int) lanai->pci->revision);
 	if (left-- == 0)
-		return sprintf(page, "EEPROM ESI: "
-		    "%02X:%02X:%02X:%02X:%02X:%02X\n",
-		    lanai->eeprom[EEPROM_MAC + 0],
-		    lanai->eeprom[EEPROM_MAC + 1],
-		    lanai->eeprom[EEPROM_MAC + 2],
-		    lanai->eeprom[EEPROM_MAC + 3],
-		    lanai->eeprom[EEPROM_MAC + 4],
-		    lanai->eeprom[EEPROM_MAC + 5]);
+		return sprintf(page, "EEPROM ESI: %pM\n",
+		    &lanai->eeprom[EEPROM_MAC]);
 	if (left-- == 0)
 		return sprintf(page, "status: SOOL=%d, LOCD=%d, LED=%d, "
 		    "GPIN=%d\n", (lanai->status & STATUS_SOOL) ? 1 : 0, 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-07  9:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-05 16:26 [PATCH] drivers/atm/lanai.c: use %pM to show MAC address H Hartley Sweeten
2010-01-07  9:15 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2009-12-30 18:50 H Hartley Sweeten
2009-12-30 18:59 ` Joe Perches
2009-12-30 23:56   ` Henrique de Moraes Holschuh

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).