aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-11-25 03:40:37 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 03:40:37 -0500
commit411c41eea58bd3500cf897e2c27dd5330935a3a8 (patch)
treec6987d1351581def73321b7c8d518ac75db876a2 /drivers
parent9c8f92aed16dbd1924910f3305f5992a4f29fe2a (diff)
aoe: remove private mac address format function
Add %pm to omit the colons when printing a mac address. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/aoe/aoe.h1
-rw-r--r--drivers/block/aoe/aoeblk.c2
-rw-r--r--drivers/block/aoe/aoecmd.c22
-rw-r--r--drivers/block/aoe/aoenet.c11
4 files changed, 11 insertions, 25 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index 93f3690396a5..c237527b1aa5 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -200,4 +200,3 @@ void aoenet_xmit(struct sk_buff_head *);
200int is_aoe_netif(struct net_device *ifp); 200int is_aoe_netif(struct net_device *ifp);
201int set_aoe_iflist(const char __user *str, size_t size); 201int set_aoe_iflist(const char __user *str, size_t size);
202 202
203unsigned long long mac_addr(char addr[6]);
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 1747dd272cd4..2307a271bdc9 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -37,7 +37,7 @@ static ssize_t aoedisk_show_mac(struct device *dev,
37 37
38 if (t == NULL) 38 if (t == NULL)
39 return snprintf(page, PAGE_SIZE, "none\n"); 39 return snprintf(page, PAGE_SIZE, "none\n");
40 return snprintf(page, PAGE_SIZE, "%012llx\n", mac_addr(t->addr)); 40 return snprintf(page, PAGE_SIZE, "%pm\n", t->addr);
41} 41}
42static ssize_t aoedisk_show_netif(struct device *dev, 42static ssize_t aoedisk_show_netif(struct device *dev,
43 struct device_attribute *attr, char *page) 43 struct device_attribute *attr, char *page)
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 71ff78c9e4d6..45c5a33daf49 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -349,11 +349,9 @@ resend(struct aoedev *d, struct aoetgt *t, struct frame *f)
349 ah = (struct aoe_atahdr *) (h+1); 349 ah = (struct aoe_atahdr *) (h+1);
350 350
351 snprintf(buf, sizeof buf, 351 snprintf(buf, sizeof buf,
352 "%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x " 352 "%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x s=%pm d=%pm nout=%d\n",
353 "s=%012llx d=%012llx nout=%d\n",
354 "retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n, 353 "retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n,
355 mac_addr(h->src), 354 h->src, h->dst, t->nout);
356 mac_addr(h->dst), t->nout);
357 aoechr_error(buf); 355 aoechr_error(buf);
358 356
359 f->tag = n; 357 f->tag = n;
@@ -544,10 +542,10 @@ rexmit_timer(ulong vp)
544 printk(KERN_INFO 542 printk(KERN_INFO
545 "aoe: e%ld.%d: " 543 "aoe: e%ld.%d: "
546 "too many lost jumbo on " 544 "too many lost jumbo on "
547 "%s:%012llx - " 545 "%s:%pm - "
548 "falling back to %d frames.\n", 546 "falling back to %d frames.\n",
549 d->aoemajor, d->aoeminor, 547 d->aoemajor, d->aoeminor,
550 ifp->nd->name, mac_addr(t->addr), 548 ifp->nd->name, t->addr,
551 DEFAULTBCNT); 549 DEFAULTBCNT);
552 ifp->maxbcnt = 0; 550 ifp->maxbcnt = 0;
553 } 551 }
@@ -672,8 +670,8 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
672 670
673 if (d->ssize != ssize) 671 if (d->ssize != ssize)
674 printk(KERN_INFO 672 printk(KERN_INFO
675 "aoe: %012llx e%ld.%d v%04x has %llu sectors\n", 673 "aoe: %pm e%ld.%d v%04x has %llu sectors\n",
676 mac_addr(t->addr), 674 t->addr,
677 d->aoemajor, d->aoeminor, 675 d->aoemajor, d->aoeminor,
678 d->fw_ver, (long long)ssize); 676 d->fw_ver, (long long)ssize);
679 d->ssize = ssize; 677 d->ssize = ssize;
@@ -775,8 +773,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
775 n = get_unaligned_be32(&hin->tag); 773 n = get_unaligned_be32(&hin->tag);
776 t = gettgt(d, hin->src); 774 t = gettgt(d, hin->src);
777 if (t == NULL) { 775 if (t == NULL) {
778 printk(KERN_INFO "aoe: can't find target e%ld.%d:%012llx\n", 776 printk(KERN_INFO "aoe: can't find target e%ld.%d:%pm\n",
779 d->aoemajor, d->aoeminor, mac_addr(hin->src)); 777 d->aoemajor, d->aoeminor, hin->src);
780 spin_unlock_irqrestore(&d->lock, flags); 778 spin_unlock_irqrestore(&d->lock, flags);
781 return; 779 return;
782 } 780 }
@@ -1036,10 +1034,10 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
1036 n = n ? n * 512 : DEFAULTBCNT; 1034 n = n ? n * 512 : DEFAULTBCNT;
1037 if (n != ifp->maxbcnt) { 1035 if (n != ifp->maxbcnt) {
1038 printk(KERN_INFO 1036 printk(KERN_INFO
1039 "aoe: e%ld.%d: setting %d%s%s:%012llx\n", 1037 "aoe: e%ld.%d: setting %d%s%s:%pm\n",
1040 d->aoemajor, d->aoeminor, n, 1038 d->aoemajor, d->aoeminor, n,
1041 " byte data frames on ", ifp->nd->name, 1039 " byte data frames on ", ifp->nd->name,
1042 mac_addr(t->addr)); 1040 t->addr);
1043 ifp->maxbcnt = n; 1041 ifp->maxbcnt = n;
1044 } 1042 }
1045 } 1043 }
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index 9157d64270cb..30de5b1c647e 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -83,17 +83,6 @@ set_aoe_iflist(const char __user *user_str, size_t size)
83 return 0; 83 return 0;
84} 84}
85 85
86unsigned long long
87mac_addr(char addr[6])
88{
89 __be64 n = 0;
90 char *p = (char *) &n;
91
92 memcpy(p + 2, addr, 6); /* (sizeof addr != 6) */
93
94 return (unsigned long long) __be64_to_cpu(n);
95}
96
97void 86void
98aoenet_xmit(struct sk_buff_head *queue) 87aoenet_xmit(struct sk_buff_head *queue)
99{ 88{