aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/etherdevice.h11
1 files changed, 6 insertions, 5 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.