linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/firmware/iscsi_ibft.c: use %pM to show MAC address
@ 2009-12-30 19:49 H Hartley Sweeten
  2010-01-04 15:40 ` Peter Jones
  0 siblings, 1 reply; 6+ messages in thread
From: H Hartley Sweeten @ 2009-12-30 19:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: pjones

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

Also, remove the 'mac' variable and use nic->mac directly.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Peter Jones <pjones@redhat.com>

---

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 051d1eb..5aeb3b5 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -380,7 +380,6 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 	struct ibft_nic *nic = entry->nic;
 	void *ibft_loc = entry->header;
 	char *str = buf;
-	char *mac;
 	int val;
 
 	if (!nic)
@@ -421,10 +420,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 		str += sprintf(str, "%d\n", nic->vlan);
 		break;
 	case ibft_eth_mac:
-		mac = nic->mac;
-		str += sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x\n",
-			       (u8)mac[0], (u8)mac[1], (u8)mac[2],
-			       (u8)mac[3], (u8)mac[4], (u8)mac[5]);
+		str += sprintf(str, "%pM\n", nic->mac);
 		break;
 	case ibft_eth_hostname:
 		str += sprintf_string(str, nic->hostname_len, 

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

* Re: [PATCH] drivers/firmware/iscsi_ibft.c: use %pM to show MAC address
  2009-12-30 19:49 [PATCH] drivers/firmware/iscsi_ibft.c: use %pM to show MAC address H Hartley Sweeten
@ 2010-01-04 15:40 ` Peter Jones
  2010-01-05 16:33   ` H Hartley Sweeten
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Jones @ 2010-01-04 15:40 UTC (permalink / raw)
  To: H Hartley Sweeten; +Cc: linux-kernel

On 12/30/2009 02:49 PM, H Hartley Sweeten wrote:
> Use the %pM kernel extension to display the MAC address.
> 
> Also, remove the 'mac' variable and use nic->mac directly.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Peter Jones <pjones@redhat.com>

Looks good to me.

Acked-by: Peter Jones <pjones@redhat.com>

-- 
        Peter

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

* RE: [PATCH] drivers/firmware/iscsi_ibft.c: use %pM to show MAC address
  2010-01-04 15:40 ` Peter Jones
@ 2010-01-05 16:33   ` H Hartley Sweeten
  2010-01-05 16:35     ` Peter Jones
  0 siblings, 1 reply; 6+ messages in thread
From: H Hartley Sweeten @ 2010-01-05 16:33 UTC (permalink / raw)
  To: Peter Jones; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 939 bytes --]

On Monday, January 04, 2010 8:41 AM, Peter Jones wrote:
> On 12/30/2009 02:49 PM, H Hartley Sweeten wrote:
>> Use the %pM kernel extension to display the MAC address.
>> 
>> Also, remove the 'mac' variable and use nic->mac directly.
>> 
>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>> Cc: Peter Jones <pjones@redhat.com>
>
> Looks good to me.
>
> Acked-by: Peter Jones <pjones@redhat.com>

Hello Peter,

Will you be merging this?

I sent a number of similar patches to the netdev list.  David Miller
had merge issues with them due to a whitespace problem at the end of
the patches.  I have figure out the issue and am reposting the patch
series now.  If you have not merged this I will fix this one also and
send it to him with the others.

Thanks,
Hartley
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] drivers/firmware/iscsi_ibft.c: use %pM to show MAC address
  2010-01-05 16:33   ` H Hartley Sweeten
@ 2010-01-05 16:35     ` Peter Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Jones @ 2010-01-05 16:35 UTC (permalink / raw)
  To: H Hartley Sweeten; +Cc: linux-kernel

On 01/05/2010 11:33 AM, H Hartley Sweeten wrote:
> On Monday, January 04, 2010 8:41 AM, Peter Jones wrote:
>> On 12/30/2009 02:49 PM, H Hartley Sweeten wrote:
>>> Use the %pM kernel extension to display the MAC address.
>>>
>>> Also, remove the 'mac' variable and use nic->mac directly.
>>>
>>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>>> Cc: Peter Jones <pjones@redhat.com>
>>
>> Looks good to me.
>>
>> Acked-by: Peter Jones <pjones@redhat.com>
> 
> Hello Peter,
> 
> Will you be merging this?
> 
> I sent a number of similar patches to the netdev list.  David Miller
> had merge issues with them due to a whitespace problem at the end of
> the patches.  I have figure out the issue and am reposting the patch
> series now.  If you have not merged this I will fix this one also and
> send it to him with the others.

You sending it to him for merge is fine by me.

-- 
        Peter

All parts should go together without forcing. You must remember that
the parts you are  reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason. By all
means, do not use a hammer.
		-- IBM maintenance manual, 1925

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

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

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

> Use the %pM kernel extension to display the MAC address.
> 
> Also, remove the 'mac' variable and use nic->mac directly.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Acked-by: Peter Jones <pjones@redhat.com>

Applied.

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

* [PATCH] drivers/firmware/iscsi_ibft.c: use %pM to show MAC address
@ 2010-01-05 16:37 H Hartley Sweeten
  2010-01-07  9:16 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: H Hartley Sweeten @ 2010-01-05 16:37 UTC (permalink / raw)
  To: Linux Kernel; +Cc: netdev, pjones, davem

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

Also, remove the 'mac' variable and use nic->mac directly.

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

---

Repost due to merge issues.

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 051d1eb..5aeb3b5 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -380,7 +380,6 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 	struct ibft_nic *nic = entry->nic;
 	void *ibft_loc = entry->header;
 	char *str = buf;
-	char *mac;
 	int val;
 
 	if (!nic)
@@ -421,10 +420,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 		str += sprintf(str, "%d\n", nic->vlan);
 		break;
 	case ibft_eth_mac:
-		mac = nic->mac;
-		str += sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x\n",
-			       (u8)mac[0], (u8)mac[1], (u8)mac[2],
-			       (u8)mac[3], (u8)mac[4], (u8)mac[5]);
+		str += sprintf(str, "%pM\n", nic->mac);
 		break;
 	case ibft_eth_hostname:
 		str += sprintf_string(str, nic->hostname_len,

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-30 19:49 [PATCH] drivers/firmware/iscsi_ibft.c: use %pM to show MAC address H Hartley Sweeten
2010-01-04 15:40 ` Peter Jones
2010-01-05 16:33   ` H Hartley Sweeten
2010-01-05 16:35     ` Peter Jones
2010-01-05 16:37 H Hartley Sweeten
2010-01-07  9:16 ` David Miller

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