@@ -3628,52 +3628,6 @@ static inline bool netif_attr_test_online(unsigned long j,
return (j < nr_bits);
}
-
-/**
- * netif_attrmask_next - get the next CPU/Rx queue in a cpu/Rx queues mask
- * @n: CPU/Rx queue index
- * @srcp: the cpumask/Rx queue mask pointer
- * @nr_bits: number of bits in the bitmask
- *
- * Returns >= nr_bits if no further CPUs/Rx queues set.
- */
-static inline unsigned int netif_attrmask_next(int n, const unsigned long *srcp,
- unsigned int nr_bits)
-{
- /* n is a prior cpu */
- cpu_max_bits_warn(n + 1, nr_bits);
-
- if (srcp)
- return find_next_bit(srcp, nr_bits, n + 1);
-
- return n + 1;
-}
-
-/**
- * netif_attrmask_next_and - get the next CPU/Rx queue in \*src1p & \*src2p
- * @n: CPU/Rx queue index
- * @src1p: the first CPUs/Rx queues mask pointer
- * @src2p: the second CPUs/Rx queues mask pointer
- * @nr_bits: number of bits in the bitmask
- *
- * Returns >= nr_bits if no further CPUs/Rx queues set in both.
- */
-static inline int netif_attrmask_next_and(int n, const unsigned long *src1p,
- const unsigned long *src2p,
- unsigned int nr_bits)
-{
- /* n is a prior cpu */
- cpu_max_bits_warn(n + 1, nr_bits);
-
- if (src1p && src2p)
- return find_next_and_bit(src1p, src2p, nr_bits, n + 1);
- else if (src1p)
- return find_next_bit(src1p, nr_bits, n + 1);
- else if (src2p)
- return find_next_bit(src2p, nr_bits, n + 1);
-
- return n + 1;
-}
#else
static inline int netif_set_xps_queue(struct net_device *dev,
const struct cpumask *mask,
@@ -2591,8 +2591,7 @@ int __netif_set_xps_queue(struct net_device *dev, const unsigned long *mask,
copy = true;
/* allocate memory for queue storage */
- for (j = -1; j = netif_attrmask_next_and(j, online_mask, mask, nr_ids),
- j < nr_ids;) {
+ for_each_and_bit(j, online_mask, mask ? : online_mask, nr_ids) {
if (!new_dev_maps) {
new_dev_maps = kzalloc(maps_sz, GFP_KERNEL);
if (!new_dev_maps)
Replace opencoded bitmap traversing and drop unused netif_attrmask_next*() functions Signed-off-by: Yury Norov <yury.norov@gmail.com> --- include/linux/netdevice.h | 46 --------------------------------------- net/core/dev.c | 3 +-- 2 files changed, 1 insertion(+), 48 deletions(-)