mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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>
This commit is contained in:
parent
9c8f92aed1
commit
411c41eea5
5 changed files with 14 additions and 25 deletions
|
@ -200,4 +200,3 @@ void aoenet_xmit(struct sk_buff_head *);
|
||||||
int is_aoe_netif(struct net_device *ifp);
|
int is_aoe_netif(struct net_device *ifp);
|
||||||
int set_aoe_iflist(const char __user *str, size_t size);
|
int set_aoe_iflist(const char __user *str, size_t size);
|
||||||
|
|
||||||
unsigned long long mac_addr(char addr[6]);
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ static ssize_t aoedisk_show_mac(struct device *dev,
|
||||||
|
|
||||||
if (t == NULL)
|
if (t == NULL)
|
||||||
return snprintf(page, PAGE_SIZE, "none\n");
|
return snprintf(page, PAGE_SIZE, "none\n");
|
||||||
return snprintf(page, PAGE_SIZE, "%012llx\n", mac_addr(t->addr));
|
return snprintf(page, PAGE_SIZE, "%pm\n", t->addr);
|
||||||
}
|
}
|
||||||
static ssize_t aoedisk_show_netif(struct device *dev,
|
static ssize_t aoedisk_show_netif(struct device *dev,
|
||||||
struct device_attribute *attr, char *page)
|
struct device_attribute *attr, char *page)
|
||||||
|
|
|
@ -349,11 +349,9 @@ resend(struct aoedev *d, struct aoetgt *t, struct frame *f)
|
||||||
ah = (struct aoe_atahdr *) (h+1);
|
ah = (struct aoe_atahdr *) (h+1);
|
||||||
|
|
||||||
snprintf(buf, sizeof buf,
|
snprintf(buf, sizeof buf,
|
||||||
"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x "
|
"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x s=%pm d=%pm nout=%d\n",
|
||||||
"s=%012llx d=%012llx nout=%d\n",
|
|
||||||
"retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n,
|
"retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n,
|
||||||
mac_addr(h->src),
|
h->src, h->dst, t->nout);
|
||||||
mac_addr(h->dst), t->nout);
|
|
||||||
aoechr_error(buf);
|
aoechr_error(buf);
|
||||||
|
|
||||||
f->tag = n;
|
f->tag = n;
|
||||||
|
@ -544,10 +542,10 @@ rexmit_timer(ulong vp)
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"aoe: e%ld.%d: "
|
"aoe: e%ld.%d: "
|
||||||
"too many lost jumbo on "
|
"too many lost jumbo on "
|
||||||
"%s:%012llx - "
|
"%s:%pm - "
|
||||||
"falling back to %d frames.\n",
|
"falling back to %d frames.\n",
|
||||||
d->aoemajor, d->aoeminor,
|
d->aoemajor, d->aoeminor,
|
||||||
ifp->nd->name, mac_addr(t->addr),
|
ifp->nd->name, t->addr,
|
||||||
DEFAULTBCNT);
|
DEFAULTBCNT);
|
||||||
ifp->maxbcnt = 0;
|
ifp->maxbcnt = 0;
|
||||||
}
|
}
|
||||||
|
@ -672,8 +670,8 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
|
||||||
|
|
||||||
if (d->ssize != ssize)
|
if (d->ssize != ssize)
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"aoe: %012llx e%ld.%d v%04x has %llu sectors\n",
|
"aoe: %pm e%ld.%d v%04x has %llu sectors\n",
|
||||||
mac_addr(t->addr),
|
t->addr,
|
||||||
d->aoemajor, d->aoeminor,
|
d->aoemajor, d->aoeminor,
|
||||||
d->fw_ver, (long long)ssize);
|
d->fw_ver, (long long)ssize);
|
||||||
d->ssize = ssize;
|
d->ssize = ssize;
|
||||||
|
@ -775,8 +773,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
|
||||||
n = get_unaligned_be32(&hin->tag);
|
n = get_unaligned_be32(&hin->tag);
|
||||||
t = gettgt(d, hin->src);
|
t = gettgt(d, hin->src);
|
||||||
if (t == NULL) {
|
if (t == NULL) {
|
||||||
printk(KERN_INFO "aoe: can't find target e%ld.%d:%012llx\n",
|
printk(KERN_INFO "aoe: can't find target e%ld.%d:%pm\n",
|
||||||
d->aoemajor, d->aoeminor, mac_addr(hin->src));
|
d->aoemajor, d->aoeminor, hin->src);
|
||||||
spin_unlock_irqrestore(&d->lock, flags);
|
spin_unlock_irqrestore(&d->lock, flags);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1036,10 +1034,10 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
|
||||||
n = n ? n * 512 : DEFAULTBCNT;
|
n = n ? n * 512 : DEFAULTBCNT;
|
||||||
if (n != ifp->maxbcnt) {
|
if (n != ifp->maxbcnt) {
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"aoe: e%ld.%d: setting %d%s%s:%012llx\n",
|
"aoe: e%ld.%d: setting %d%s%s:%pm\n",
|
||||||
d->aoemajor, d->aoeminor, n,
|
d->aoemajor, d->aoeminor, n,
|
||||||
" byte data frames on ", ifp->nd->name,
|
" byte data frames on ", ifp->nd->name,
|
||||||
mac_addr(t->addr));
|
t->addr);
|
||||||
ifp->maxbcnt = n;
|
ifp->maxbcnt = n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,17 +83,6 @@ set_aoe_iflist(const char __user *user_str, size_t size)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long long
|
|
||||||
mac_addr(char addr[6])
|
|
||||||
{
|
|
||||||
__be64 n = 0;
|
|
||||||
char *p = (char *) &n;
|
|
||||||
|
|
||||||
memcpy(p + 2, addr, 6); /* (sizeof addr != 6) */
|
|
||||||
|
|
||||||
return (unsigned long long) __be64_to_cpu(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
aoenet_xmit(struct sk_buff_head *queue)
|
aoenet_xmit(struct sk_buff_head *queue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -669,6 +669,9 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field
|
||||||
return symbol_string(buf, end, ptr, field_width, precision, flags);
|
return symbol_string(buf, end, ptr, field_width, precision, flags);
|
||||||
case 'R':
|
case 'R':
|
||||||
return resource_string(buf, end, ptr, field_width, precision, flags);
|
return resource_string(buf, end, ptr, field_width, precision, flags);
|
||||||
|
case 'm':
|
||||||
|
flags |= SPECIAL;
|
||||||
|
/* Fallthrough */
|
||||||
case 'M':
|
case 'M':
|
||||||
return mac_address_string(buf, end, ptr, field_width, precision, flags);
|
return mac_address_string(buf, end, ptr, field_width, precision, flags);
|
||||||
case 'i':
|
case 'i':
|
||||||
|
|
Loading…
Reference in a new issue