diff options
author | Alexander Lobakin <alobakin@marvell.com> | 2020-07-20 21:08:00 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-21 03:59:43 +0300 |
commit | e812916d3278baf03aabf10044661fc3b2848823 (patch) | |
tree | 42169d53b622b5e80437e45df3b6d2eb8b0e666b /include | |
parent | cfd6920175ac848e057ed258e87c427792f371d0 (diff) | |
download | linux-e812916d3278baf03aabf10044661fc3b2848823.tar.xz |
linkmode: introduce linkmode_intersects()
Add a new helper to find intersections between Ethtool link modes,
linkmode_intersects(), similar to the other linkmode helpers.
Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/linkmode.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/linkmode.h b/include/linux/linkmode.h index c664c27a29a0..f8397f300fcd 100644 --- a/include/linux/linkmode.h +++ b/include/linux/linkmode.h @@ -82,6 +82,12 @@ static inline int linkmode_equal(const unsigned long *src1, return bitmap_equal(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS); } +static inline int linkmode_intersects(const unsigned long *src1, + const unsigned long *src2) +{ + return bitmap_intersects(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS); +} + static inline int linkmode_subset(const unsigned long *src1, const unsigned long *src2) { |