summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-11-27 00:12:47 -0800
committerDavid S. Miller <davem@davemloft.net>2008-11-27 00:12:47 -0800
commitc4106aa88a440430d387e022f2ad6dc1e0d52e98 (patch)
tree09064e6e767301ca28357ed5125e99123f5beaca /include/net
parent5b9ab2ec04ec1e1e53939768805612ac191d7ba2 (diff)
downloadop-kernel-dev-c4106aa88a440430d387e022f2ad6dc1e0d52e98.zip
op-kernel-dev-c4106aa88a440430d387e022f2ad6dc1e0d52e98.tar.gz
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')
-rw-r--r--include/net/dn.h8
-rw-r--r--include/net/dn_fib.h6
2 files changed, 6 insertions, 8 deletions
diff --git a/include/net/dn.h b/include/net/dn.h
index 6277783..7cd6bb8 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/unalignedh>
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;
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h
index 3012511..c378be7 100644
--- a/include/net/dn_fib.h
+++ b/include/net/dn_fib.h
@@ -181,9 +181,9 @@ static inline void dn_fib_res_put(struct dn_fib_res *res)
static inline __le16 dnet_make_mask(int n)
{
- if (n)
- return dn_htons(~((1<<(16-n))-1));
- return 0;
+ if (n)
+ return cpu_to_le16(~((1 << (16 - n)) - 1));
+ return cpu_to_le16(0);
}
#endif /* _NET_DN_FIB_H */
OpenPOWER on IntegriCloud