aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/dn.h
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-11-27 03:12:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-27 03:12:47 -0500
commitc4106aa88a440430d387e022f2ad6dc1e0d52e98 (patch)
tree09064e6e767301ca28357ed5125e99123f5beaca /include/net/dn.h
parent5b9ab2ec04ec1e1e53939768805612ac191d7ba2 (diff)
decnet: remove private wrappers of endian helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Reviewed-by: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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..7cd6bb83f7a 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -4,9 +4,7 @@
4#include <linux/dn.h> 4#include <linux/dn.h>
5#include <net/sock.h> 5#include <net/sock.h>
6#include <asm/byteorder.h> 6#include <asm/byteorder.h>
7 7#include <asm/unalignedh>
8#define dn_ntohs(x) le16_to_cpu(x)
9#define dn_htons(x) cpu_to_le16(x)
10 8
11struct dn_scp /* Session Control Port */ 9struct dn_scp /* Session Control Port */
12{ 10{
@@ -175,7 +173,7 @@ struct dn_skb_cb {
175 173
176static inline __le16 dn_eth2dn(unsigned char *ethaddr) 174static inline __le16 dn_eth2dn(unsigned char *ethaddr)
177{ 175{
178 return dn_htons(ethaddr[4] | (ethaddr[5] << 8)); 176 return get_unaligned((__le16 *)(ethaddr + 4));
179} 177}
180 178
181static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr) 179static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
@@ -185,7 +183,7 @@ static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
185 183
186static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr) 184static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr)
187{ 185{
188 __u16 a = dn_ntohs(addr); 186 __u16 a = le16_to_cpu(addr);
189 ethaddr[0] = 0xAA; 187 ethaddr[0] = 0xAA;
190 ethaddr[1] = 0x00; 188 ethaddr[1] = 0x00;
191 ethaddr[2] = 0x04; 189 ethaddr[2] = 0x04;