summaryrefslogtreecommitdiff
path: root/include/linux/linkmode.h
diff options
context:
space:
mode:
authorAlexander Lobakin <alobakin@marvell.com>2020-07-20 21:08:00 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-21 03:59:43 +0300
commite812916d3278baf03aabf10044661fc3b2848823 (patch)
tree42169d53b622b5e80437e45df3b6d2eb8b0e666b /include/linux/linkmode.h
parentcfd6920175ac848e057ed258e87c427792f371d0 (diff)
downloadlinux-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/linux/linkmode.h')
-rw-r--r--include/linux/linkmode.h6
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)
{