From: Tobias Klauser Date: Wed, 12 Jan 2011 22:14:56 +0000 (+0000) Subject: etherdevice.h: Add is_unicast_ether_addr function X-Git-Tag: upstream/snapshot3+hdmi~11431^2~179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51e7eed79c41180919ff94942895ba38467d9ad4;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git etherdevice.h: Add is_unicast_ether_addr function From a check for !is_multicast_ether_addr it is not always obvious that we're checking for a unicast address. So add this helper function to make those code paths easier to read. Signed-off-by: Tobias Klauser Acked-by: Chris Metcalf Signed-off-by: David S. Miller --- diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index bec8b82..ab68f78 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -99,6 +99,17 @@ static inline int is_broadcast_ether_addr(const u8 *addr) } /** + * is_unicast_ether_addr - Determine if the Ethernet address is unicast + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Return true if the address is a unicast address. + */ +static inline int is_unicast_ether_addr(const u8 *addr) +{ + return !is_multicast_ether_addr(addr); +} + +/** * is_valid_ether_addr - Determine if the given Ethernet address is valid * @addr: Pointer to a six-byte array containing the Ethernet address *