summaryrefslogtreecommitdiffstats
path: root/include/net/dn.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/dn.h')
-rw-r--r--include/net/dn.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/net/dn.h b/include/net/dn.h
index 627778384c8..e5469f7b67a 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -4,9 +4,7 @@
#include <linux/dn.h>
#include <net/sock.h>
#include <asm/byteorder.h>
-
-#define dn_ntohs(x) le16_to_cpu(x)
-#define dn_htons(x) cpu_to_le16(x)
+#include <asm/unaligned.h>
struct dn_scp /* Session Control Port */
{
@@ -175,7 +173,7 @@ struct dn_skb_cb {
static inline __le16 dn_eth2dn(unsigned char *ethaddr)
{
- return dn_htons(ethaddr[4] | (ethaddr[5] << 8));
+ return get_unaligned((__le16 *)(ethaddr + 4));
}
static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
@@ -185,7 +183,7 @@ static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr)
{
- __u16 a = dn_ntohs(addr);
+ __u16 a = le16_to_cpu(addr);
ethaddr[0] = 0xAA;
ethaddr[1] = 0x00;
ethaddr[2] = 0x04;