Patchwork drivers/atm/lanai.c: use %pM to show MAC address

login
register
mail settings
Submitter hartleys
Date Dec. 30, 2009, 6:50 p.m.
Message ID <BD79186B4FD85F4B8E60E381CAEE19090200F645@mi8nycmail19.Mi8.com>
Download mbox | patch
Permalink /patch/41931/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

hartleys - Dec. 30, 2009, 6:50 p.m.
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>

---

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joe Perches - Dec. 30, 2009, 6:59 p.m.
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...


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Henrique de Moraes Holschuh - Dec. 30, 2009, 11:56 p.m.
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...

Patch

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,