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>
This commit is contained in:
committed by
David S. Miller
parent
5b9ab2ec04
commit
c4106aa88a
@@ -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;
|
||||
|
Reference in New Issue
Block a user