Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3a7c66b authored by Harvey Harrison's avatar Harvey Harrison Committed by David S. Miller
Browse files

net: replace __constant_{endian} uses in net headers



Base versions handle constant folding now.  For headers exposed to
userspace, we must only expose the __ prefixed versions.

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 35c26c2c
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -95,16 +95,16 @@ struct pppoe_tag {
} __attribute ((packed));

/* Tag identifiers */
#define PTT_EOL		__constant_htons(0x0000)
#define PTT_SRV_NAME	__constant_htons(0x0101)
#define PTT_AC_NAME	__constant_htons(0x0102)
#define PTT_HOST_UNIQ	__constant_htons(0x0103)
#define PTT_AC_COOKIE	__constant_htons(0x0104)
#define PTT_VENDOR 	__constant_htons(0x0105)
#define PTT_RELAY_SID	__constant_htons(0x0110)
#define PTT_SRV_ERR     __constant_htons(0x0201)
#define PTT_SYS_ERR  	__constant_htons(0x0202)
#define PTT_GEN_ERR  	__constant_htons(0x0203)
#define PTT_EOL		__cpu_to_be16(0x0000)
#define PTT_SRV_NAME	__cpu_to_be16(0x0101)
#define PTT_AC_NAME	__cpu_to_be16(0x0102)
#define PTT_HOST_UNIQ	__cpu_to_be16(0x0103)
#define PTT_AC_COOKIE	__cpu_to_be16(0x0104)
#define PTT_VENDOR 	__cpu_to_be16(0x0105)
#define PTT_RELAY_SID	__cpu_to_be16(0x0110)
#define PTT_SRV_ERR     __cpu_to_be16(0x0201)
#define PTT_SYS_ERR  	__cpu_to_be16(0x0202)
#define PTT_GEN_ERR  	__cpu_to_be16(0x0203)

struct pppoe_hdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
+8 −8
Original line number Diff line number Diff line
@@ -16,14 +16,14 @@
#define SIOCDELPRL      (SIOCDEVPRIVATE + 6)
#define SIOCCHGPRL      (SIOCDEVPRIVATE + 7)

#define GRE_CSUM	__constant_htons(0x8000)
#define GRE_ROUTING	__constant_htons(0x4000)
#define GRE_KEY		__constant_htons(0x2000)
#define GRE_SEQ		__constant_htons(0x1000)
#define GRE_STRICT	__constant_htons(0x0800)
#define GRE_REC		__constant_htons(0x0700)
#define GRE_FLAGS	__constant_htons(0x00F8)
#define GRE_VERSION	__constant_htons(0x0007)
#define GRE_CSUM	__cpu_to_be16(0x8000)
#define GRE_ROUTING	__cpu_to_be16(0x4000)
#define GRE_KEY		__cpu_to_be16(0x2000)
#define GRE_SEQ		__cpu_to_be16(0x1000)
#define GRE_STRICT	__cpu_to_be16(0x0800)
#define GRE_REC		__cpu_to_be16(0x0700)
#define GRE_FLAGS	__cpu_to_be16(0x00F8)
#define GRE_VERSION	__cpu_to_be16(0x0007)

struct ip_tunnel_parm
{
+13 −13
Original line number Diff line number Diff line
@@ -2,18 +2,18 @@
#define _NCP_NO

/* these define the attribute byte as seen by NCP */
#define aRONLY			(__constant_cpu_to_le32(1))
#define aHIDDEN			(__constant_cpu_to_le32(2))
#define aSYSTEM			(__constant_cpu_to_le32(4))
#define aEXECUTE		(__constant_cpu_to_le32(8))
#define aDIR			(__constant_cpu_to_le32(0x10))
#define aARCH			(__constant_cpu_to_le32(0x20))
#define aSHARED			(__constant_cpu_to_le32(0x80))
#define aDONTSUBALLOCATE	(__constant_cpu_to_le32(1L<<11))
#define aTRANSACTIONAL		(__constant_cpu_to_le32(1L<<12))
#define aPURGE			(__constant_cpu_to_le32(1L<<16))
#define aRENAMEINHIBIT		(__constant_cpu_to_le32(1L<<17))
#define aDELETEINHIBIT		(__constant_cpu_to_le32(1L<<18))
#define aDONTCOMPRESS		(__constant_cpu_to_le32(1L<<27))
#define aRONLY			(__cpu_to_le32(1))
#define aHIDDEN			(__cpu_to_le32(2))
#define aSYSTEM			(__cpu_to_le32(4))
#define aEXECUTE		(__cpu_to_le32(8))
#define aDIR			(__cpu_to_le32(0x10))
#define aARCH			(__cpu_to_le32(0x20))
#define aSHARED			(__cpu_to_le32(0x80))
#define aDONTSUBALLOCATE	(__cpu_to_le32(1L<<11))
#define aTRANSACTIONAL		(__cpu_to_le32(1L<<12))
#define aPURGE			(__cpu_to_le32(1L<<16))
#define aRENAMEINHIBIT		(__cpu_to_le32(1L<<17))
#define aDELETEINHIBIT		(__cpu_to_le32(1L<<18))
#define aDONTCOMPRESS		(__cpu_to_le32(1L<<27))

#endif /* _NCP_NO */
+2 −2
Original line number Diff line number Diff line
@@ -1863,7 +1863,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)

		if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
			if ((dev->priv_flags & IFF_SLAVE_NEEDARP) &&
			    skb->protocol == __constant_htons(ETH_P_ARP))
			    skb->protocol == __cpu_to_be16(ETH_P_ARP))
				return 0;

			if (master->priv_flags & IFF_MASTER_ALB) {
@@ -1872,7 +1872,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
					return 0;
			}
			if (master->priv_flags & IFF_MASTER_8023AD &&
			    skb->protocol == __constant_htons(ETH_P_SLOW))
			    skb->protocol == __cpu_to_be16(ETH_P_SLOW))
				return 0;

			return 1;
+2 −2
Original line number Diff line number Diff line
@@ -59,9 +59,9 @@ static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb)
static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb)
{
	switch (skb->protocol) {
	case __constant_htons(ETH_P_8021Q):
	case __cpu_to_be16(ETH_P_8021Q):
		return VLAN_HLEN;
	case __constant_htons(ETH_P_PPP_SES):
	case __cpu_to_be16(ETH_P_PPP_SES):
		return PPPOE_SES_HLEN;
	default:
		return 0;
Loading