aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/etherdevice.h11
-rw-r--r--include/linux/ftrace_event.h2
-rw-r--r--include/linux/netdevice.h9
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h16
-rw-r--r--include/linux/usb/usbnet.h3
5 files changed, 26 insertions, 15 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 8a1835855faa..fe5136d81454 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -159,7 +159,8 @@ static inline void eth_hw_addr_random(struct net_device *dev)
159 * @addr1: Pointer to a six-byte array containing the Ethernet address 159 * @addr1: Pointer to a six-byte array containing the Ethernet address
160 * @addr2: Pointer other six-byte array containing the Ethernet address 160 * @addr2: Pointer other six-byte array containing the Ethernet address
161 * 161 *
162 * Compare two ethernet addresses, returns 0 if equal 162 * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise.
163 * Unlike memcmp(), it doesn't return a value suitable for sorting.
163 */ 164 */
164static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) 165static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
165{ 166{
@@ -184,10 +185,10 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
184 * @addr1: Pointer to an array of 8 bytes 185 * @addr1: Pointer to an array of 8 bytes
185 * @addr2: Pointer to an other array of 8 bytes 186 * @addr2: Pointer to an other array of 8 bytes
186 * 187 *
187 * Compare two ethernet addresses, returns 0 if equal. 188 * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise.
188 * Same result than "memcmp(addr1, addr2, ETH_ALEN)" but without conditional 189 * Unlike memcmp(), it doesn't return a value suitable for sorting.
189 * branches, and possibly long word memory accesses on CPU allowing cheap 190 * The function doesn't need any conditional branches and possibly uses
190 * unaligned memory reads. 191 * word memory accesses on CPU allowing cheap unaligned memory reads.
191 * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2} 192 * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2}
192 * 193 *
193 * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits. 194 * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits.
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 5f3f3be5af09..176a939d1547 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -179,6 +179,7 @@ enum {
179 TRACE_EVENT_FL_RECORDED_CMD_BIT, 179 TRACE_EVENT_FL_RECORDED_CMD_BIT,
180 TRACE_EVENT_FL_CAP_ANY_BIT, 180 TRACE_EVENT_FL_CAP_ANY_BIT,
181 TRACE_EVENT_FL_NO_SET_FILTER_BIT, 181 TRACE_EVENT_FL_NO_SET_FILTER_BIT,
182 TRACE_EVENT_FL_IGNORE_ENABLE_BIT,
182}; 183};
183 184
184enum { 185enum {
@@ -187,6 +188,7 @@ enum {
187 TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), 188 TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT),
188 TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), 189 TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT),
189 TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), 190 TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT),
191 TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT),
190}; 192};
191 193
192struct ftrace_event_call { 194struct ftrace_event_call {
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5cbaa20f1659..33900a53c990 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1403,15 +1403,6 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev)
1403 return 0; 1403 return 0;
1404} 1404}
1405 1405
1406#ifndef CONFIG_NET_NS
1407static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
1408{
1409 skb->dev = dev;
1410}
1411#else /* CONFIG_NET_NS */
1412void skb_set_dev(struct sk_buff *skb, struct net_device *dev);
1413#endif
1414
1415static inline bool netdev_uses_trailer_tags(struct net_device *dev) 1406static inline bool netdev_uses_trailer_tags(struct net_device *dev)
1416{ 1407{
1417#ifdef CONFIG_NET_DSA_TAG_TRAILER 1408#ifdef CONFIG_NET_DSA_TAG_TRAILER
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index 05a5d72680be..230a290e1973 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -99,6 +99,22 @@ struct ip_set_hash {
99#endif 99#endif
100}; 100};
101 101
102static size_t
103htable_size(u8 hbits)
104{
105 size_t hsize;
106
107 /* We must fit both into u32 in jhash and size_t */
108 if (hbits > 31)
109 return 0;
110 hsize = jhash_size(hbits);
111 if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket)
112 < hsize)
113 return 0;
114
115 return hsize * sizeof(struct hbucket) + sizeof(struct htable);
116}
117
102/* Compute htable_bits from the user input parameter hashsize */ 118/* Compute htable_bits from the user input parameter hashsize */
103static u8 119static u8
104htable_bits(u32 hashsize) 120htable_bits(u32 hashsize)
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 605b0aa8d852..76f439647c4b 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -191,7 +191,8 @@ extern void usbnet_cdc_status(struct usbnet *, struct urb *);
191enum skb_state { 191enum skb_state {
192 illegal = 0, 192 illegal = 0,
193 tx_start, tx_done, 193 tx_start, tx_done,
194 rx_start, rx_done, rx_cleanup 194 rx_start, rx_done, rx_cleanup,
195 unlink_start
195}; 196};
196 197
197struct skb_data { /* skb->cb is one of these */ 198struct skb_data { /* skb->cb is one of these */