Commit 1eb0da4c authored by Ed L. Cashin's avatar Ed L. Cashin Committed by Linus Torvalds

aoe: mac_addr: avoid 64-bit arch compiler warnings

By returning unsigned long long, mac_addr does not generate compiler warnings
on 64-bit architectures.
Signed-off-by: default avatarEd L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 68e0d42f
...@@ -198,4 +198,4 @@ void aoenet_xmit(struct sk_buff *); ...@@ -198,4 +198,4 @@ void aoenet_xmit(struct sk_buff *);
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);
u64 mac_addr(char addr[6]); unsigned long long mac_addr(char addr[6]);
...@@ -37,8 +37,7 @@ static ssize_t aoedisk_show_mac(struct device *dev, ...@@ -37,8 +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", return snprintf(page, PAGE_SIZE, "%012llx\n", mac_addr(t->addr));
(unsigned long long)mac_addr(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)
......
...@@ -309,7 +309,8 @@ resend(struct aoedev *d, struct aoetgt *t, struct frame *f) ...@@ -309,7 +309,8 @@ resend(struct aoedev *d, struct aoetgt *t, struct frame *f)
"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x " "%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x "
"s=%012llx d=%012llx 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), mac_addr(h->dst), t->nout); mac_addr(h->src),
mac_addr(h->dst), t->nout);
aoechr_error(buf); aoechr_error(buf);
f->tag = n; f->tag = n;
...@@ -633,7 +634,7 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id) ...@@ -633,7 +634,7 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
if (d->ssize != ssize) if (d->ssize != ssize)
printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu sectors\n", printk(KERN_INFO "aoe: %012llx e%lu.%lu v%04x has %llu sectors\n",
(unsigned long long)mac_addr(t->addr), mac_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;
...@@ -727,8 +728,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -727,8 +728,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
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:%012llx\n",
d->aoemajor, d->aoeminor, d->aoemajor, d->aoeminor, mac_addr(hin->src));
(unsigned long long) mac_addr(hin->src));
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
return; return;
} }
...@@ -1003,7 +1003,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -1003,7 +1003,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
"aoe: e%ld.%d: setting %d%s%s:%012llx\n", "aoe: e%ld.%d: setting %d%s%s:%012llx\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,
(unsigned long long) mac_addr(t->addr)); mac_addr(t->addr));
ifp->maxbcnt = n; ifp->maxbcnt = n;
} }
} }
......
...@@ -83,7 +83,7 @@ set_aoe_iflist(const char __user *user_str, size_t size) ...@@ -83,7 +83,7 @@ set_aoe_iflist(const char __user *user_str, size_t size)
return 0; return 0;
} }
u64 unsigned long long
mac_addr(char addr[6]) mac_addr(char addr[6])
{ {
__be64 n = 0; __be64 n = 0;
...@@ -91,7 +91,7 @@ mac_addr(char addr[6]) ...@@ -91,7 +91,7 @@ mac_addr(char addr[6])
memcpy(p + 2, addr, 6); /* (sizeof addr != 6) */ memcpy(p + 2, addr, 6); /* (sizeof addr != 6) */
return __be64_to_cpu(n); return (unsigned long long) __be64_to_cpu(n);
} }
void void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment