linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: aklimov@redhat.com, akpm@linux-foundation.org, alobakin@pm.me,
	andriy.shevchenko@linux.intel.com, dennis@kernel.org,
	jolsa@redhat.com, linux-mm@kvack.org, mm-commits@vger.kernel.org,
	torvalds@linux-foundation.org, ulf.hansson@linaro.org,
	will@kernel.org, wsa+renesas@sang-engineering.com,
	yury.norov@gmail.com
Subject: [patch 113/147] all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
Date: Tue, 07 Sep 2021 19:59:16 -0700	[thread overview]
Message-ID: <20210908025916.XhEiyDfwR%akpm@linux-foundation.org> (raw)
In-Reply-To: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org>

From: Yury Norov <yury.norov@gmail.com>
Subject: all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate

find_first{,_zero}_bit is a more effective analogue of 'next' version if
start == 0.  This patch replaces 'next' with 'first' where things look
trivial.

Link: https://lkml.kernel.org/r/20210814211713.180533-8-yury.norov@gmail.com
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Alexander Lobakin <alobakin@pm.me>
Cc: Alexey Klimov <aklimov@redhat.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/platforms/pasemi/dma_lib.c |    4 ++--
 arch/s390/kvm/kvm-s390.c                |    2 +-
 drivers/block/rnbd/rnbd-clt.c           |    2 +-
 drivers/dma/ti/edma.c                   |    2 +-
 drivers/iio/adc/ad7124.c                |    2 +-
 drivers/infiniband/hw/irdma/hw.c        |   16 ++++++++--------
 drivers/media/cec/core/cec-core.c       |    2 +-
 drivers/media/mc/mc-devnode.c           |    2 +-
 drivers/pci/controller/dwc/pci-dra7xx.c |    2 +-
 drivers/scsi/lpfc/lpfc_sli.c            |   10 +++++-----
 drivers/soc/ti/k3-ringacc.c             |    4 ++--
 drivers/tty/n_tty.c                     |    2 +-
 drivers/virt/acrn/ioreq.c               |    3 +--
 fs/f2fs/segment.c                       |    8 ++++----
 fs/ocfs2/cluster/heartbeat.c            |    2 +-
 fs/ocfs2/dlm/dlmdomain.c                |    4 ++--
 fs/ocfs2/dlm/dlmmaster.c                |   18 +++++++++---------
 fs/ocfs2/dlm/dlmrecovery.c              |    2 +-
 fs/ocfs2/dlm/dlmthread.c                |    2 +-
 lib/genalloc.c                          |    2 +-
 net/ncsi/ncsi-manage.c                  |    4 ++--
 21 files changed, 47 insertions(+), 48 deletions(-)

--- a/arch/powerpc/platforms/pasemi/dma_lib.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/arch/powerpc/platforms/pasemi/dma_lib.c
@@ -375,7 +375,7 @@ int pasemi_dma_alloc_flag(void)
 	int bit;
 
 retry:
-	bit = find_next_bit(flags_free, MAX_FLAGS, 0);
+	bit = find_first_bit(flags_free, MAX_FLAGS);
 	if (bit >= MAX_FLAGS)
 		return -ENOSPC;
 	if (!test_and_clear_bit(bit, flags_free))
@@ -440,7 +440,7 @@ int pasemi_dma_alloc_fun(void)
 	int bit;
 
 retry:
-	bit = find_next_bit(fun_free, MAX_FLAGS, 0);
+	bit = find_first_bit(fun_free, MAX_FLAGS);
 	if (bit >= MAX_FLAGS)
 		return -ENOSPC;
 	if (!test_and_clear_bit(bit, fun_free))
--- a/arch/s390/kvm/kvm-s390.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/arch/s390/kvm/kvm-s390.c
@@ -2023,7 +2023,7 @@ static unsigned long kvm_s390_next_dirty
 	while ((slotidx > 0) && (ofs >= ms->npages)) {
 		slotidx--;
 		ms = slots->memslots + slotidx;
-		ofs = find_next_bit(kvm_second_dirty_bitmap(ms), ms->npages, 0);
+		ofs = find_first_bit(kvm_second_dirty_bitmap(ms), ms->npages);
 	}
 	return ms->base_gfn + ofs;
 }
--- a/drivers/block/rnbd/rnbd-clt.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/block/rnbd/rnbd-clt.c
@@ -196,7 +196,7 @@ rnbd_get_cpu_qlist(struct rnbd_clt_sessi
 		return per_cpu_ptr(sess->cpu_queues, bit);
 	} else if (cpu != 0) {
 		/* Search from 0 to cpu */
-		bit = find_next_bit(sess->cpu_queues_bm, cpu, 0);
+		bit = find_first_bit(sess->cpu_queues_bm, cpu);
 		if (bit < cpu)
 			return per_cpu_ptr(sess->cpu_queues, bit);
 	}
--- a/drivers/dma/ti/edma.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/dma/ti/edma.c
@@ -1681,7 +1681,7 @@ static irqreturn_t dma_ccerr_handler(int
 
 			dev_dbg(ecc->dev, "EMR%d 0x%08x\n", j, val);
 			emr = val;
-			for (i = find_next_bit(&emr, 32, 0); i < 32;
+			for (i = find_first_bit(&emr, 32); i < 32;
 			     i = find_next_bit(&emr, 32, i + 1)) {
 				int k = (j << 5) + i;
 
--- a/drivers/iio/adc/ad7124.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/iio/adc/ad7124.c
@@ -347,7 +347,7 @@ static int ad7124_find_free_config_slot(
 {
 	unsigned int free_cfg_slot;
 
-	free_cfg_slot = find_next_zero_bit(&st->cfg_slots_status, AD7124_MAX_CONFIGS, 0);
+	free_cfg_slot = find_first_zero_bit(&st->cfg_slots_status, AD7124_MAX_CONFIGS);
 	if (free_cfg_slot == AD7124_MAX_CONFIGS)
 		return -1;
 
--- a/drivers/infiniband/hw/irdma/hw.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/infiniband/hw/irdma/hw.c
@@ -1696,14 +1696,14 @@ clean_msixtbl:
  */
 static void irdma_get_used_rsrc(struct irdma_device *iwdev)
 {
-	iwdev->rf->used_pds = find_next_zero_bit(iwdev->rf->allocated_pds,
-						 iwdev->rf->max_pd, 0);
-	iwdev->rf->used_qps = find_next_zero_bit(iwdev->rf->allocated_qps,
-						 iwdev->rf->max_qp, 0);
-	iwdev->rf->used_cqs = find_next_zero_bit(iwdev->rf->allocated_cqs,
-						 iwdev->rf->max_cq, 0);
-	iwdev->rf->used_mrs = find_next_zero_bit(iwdev->rf->allocated_mrs,
-						 iwdev->rf->max_mr, 0);
+	iwdev->rf->used_pds = find_first_zero_bit(iwdev->rf->allocated_pds,
+						 iwdev->rf->max_pd);
+	iwdev->rf->used_qps = find_first_zero_bit(iwdev->rf->allocated_qps,
+						 iwdev->rf->max_qp);
+	iwdev->rf->used_cqs = find_first_zero_bit(iwdev->rf->allocated_cqs,
+						 iwdev->rf->max_cq);
+	iwdev->rf->used_mrs = find_first_zero_bit(iwdev->rf->allocated_mrs,
+						 iwdev->rf->max_mr);
 }
 
 void irdma_ctrl_deinit_hw(struct irdma_pci_f *rf)
--- a/drivers/media/cec/core/cec-core.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/media/cec/core/cec-core.c
@@ -106,7 +106,7 @@ static int __must_check cec_devnode_regi
 
 	/* Part 1: Find a free minor number */
 	mutex_lock(&cec_devnode_lock);
-	minor = find_next_zero_bit(cec_devnode_nums, CEC_NUM_DEVICES, 0);
+	minor = find_first_zero_bit(cec_devnode_nums, CEC_NUM_DEVICES);
 	if (minor == CEC_NUM_DEVICES) {
 		mutex_unlock(&cec_devnode_lock);
 		pr_err("could not get a free minor\n");
--- a/drivers/media/mc/mc-devnode.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/media/mc/mc-devnode.c
@@ -217,7 +217,7 @@ int __must_check media_devnode_register(
 
 	/* Part 1: Find a free minor number */
 	mutex_lock(&media_devnode_lock);
-	minor = find_next_zero_bit(media_devnode_nums, MEDIA_NUM_DEVICES, 0);
+	minor = find_first_zero_bit(media_devnode_nums, MEDIA_NUM_DEVICES);
 	if (minor == MEDIA_NUM_DEVICES) {
 		mutex_unlock(&media_devnode_lock);
 		pr_err("could not get a free minor\n");
--- a/drivers/pci/controller/dwc/pci-dra7xx.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -211,7 +211,7 @@ static int dra7xx_pcie_handle_msi(struct
 	if (!val)
 		return 0;
 
-	pos = find_next_bit(&val, MAX_MSI_IRQS_PER_CTRL, 0);
+	pos = find_first_bit(&val, MAX_MSI_IRQS_PER_CTRL);
 	while (pos != MAX_MSI_IRQS_PER_CTRL) {
 		irq = irq_find_mapping(pp->irq_domain,
 				       (index * MAX_MSI_IRQS_PER_CTRL) + pos);
--- a/drivers/scsi/lpfc/lpfc_sli.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/scsi/lpfc/lpfc_sli.c
@@ -17250,8 +17250,8 @@ lpfc_sli4_alloc_xri(struct lpfc_hba *phb
 	 * the driver starts at 0 each time.
 	 */
 	spin_lock_irq(&phba->hbalock);
-	xri = find_next_zero_bit(phba->sli4_hba.xri_bmask,
-				 phba->sli4_hba.max_cfg_param.max_xri, 0);
+	xri = find_first_zero_bit(phba->sli4_hba.xri_bmask,
+				 phba->sli4_hba.max_cfg_param.max_xri);
 	if (xri >= phba->sli4_hba.max_cfg_param.max_xri) {
 		spin_unlock_irq(&phba->hbalock);
 		return NO_XRI;
@@ -18928,7 +18928,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phb
 	max_rpi = phba->sli4_hba.max_cfg_param.max_rpi;
 	rpi_limit = phba->sli4_hba.next_rpi;
 
-	rpi = find_next_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit, 0);
+	rpi = find_first_zero_bit(phba->sli4_hba.rpi_bmask, rpi_limit);
 	if (rpi >= rpi_limit)
 		rpi = LPFC_RPI_ALLOC_ERROR;
 	else {
@@ -19571,8 +19571,8 @@ next_priority:
 		 * have been tested so that we can detect when we should
 		 * change the priority level.
 		 */
-		next_fcf_index = find_next_bit(phba->fcf.fcf_rr_bmask,
-					       LPFC_SLI4_FCF_TBL_INDX_MAX, 0);
+		next_fcf_index = find_first_bit(phba->fcf.fcf_rr_bmask,
+					       LPFC_SLI4_FCF_TBL_INDX_MAX);
 	}
 
 
--- a/drivers/soc/ti/k3-ringacc.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/soc/ti/k3-ringacc.c
@@ -358,8 +358,8 @@ struct k3_ring *k3_ringacc_request_ring(
 		goto out;
 
 	if (flags & K3_RINGACC_RING_USE_PROXY) {
-		proxy_id = find_next_zero_bit(ringacc->proxy_inuse,
-					      ringacc->num_proxies, 0);
+		proxy_id = find_first_zero_bit(ringacc->proxy_inuse,
+					      ringacc->num_proxies);
 		if (proxy_id == ringacc->num_proxies)
 			goto error;
 	}
--- a/drivers/tty/n_tty.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/tty/n_tty.c
@@ -1975,7 +1975,7 @@ static bool canon_copy_from_read_buf(str
 	more = n - (size - tail);
 	if (eol == N_TTY_BUF_SIZE && more) {
 		/* scan wrapped without finding set bit */
-		eol = find_next_bit(ldata->read_flags, more, 0);
+		eol = find_first_bit(ldata->read_flags, more);
 		found = eol != more;
 	} else
 		found = eol != size;
--- a/drivers/virt/acrn/ioreq.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/drivers/virt/acrn/ioreq.c
@@ -246,8 +246,7 @@ void acrn_ioreq_request_clear(struct acr
 	spin_lock_bh(&vm->ioreq_clients_lock);
 	client = vm->default_client;
 	if (client) {
-		vcpu = find_next_bit(client->ioreqs_map,
-				     ACRN_IO_REQUEST_MAX, 0);
+		vcpu = find_first_bit(client->ioreqs_map, ACRN_IO_REQUEST_MAX);
 		while (vcpu < ACRN_IO_REQUEST_MAX) {
 			acrn_ioreq_complete_request(client, vcpu, NULL);
 			vcpu = find_next_bit(client->ioreqs_map,
--- a/fs/f2fs/segment.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/fs/f2fs/segment.c
@@ -2495,8 +2495,8 @@ find_other_zone:
 	secno = find_next_zero_bit(free_i->free_secmap, MAIN_SECS(sbi), hint);
 	if (secno >= MAIN_SECS(sbi)) {
 		if (dir == ALLOC_RIGHT) {
-			secno = find_next_zero_bit(free_i->free_secmap,
-							MAIN_SECS(sbi), 0);
+			secno = find_first_zero_bit(free_i->free_secmap,
+							MAIN_SECS(sbi));
 			f2fs_bug_on(sbi, secno >= MAIN_SECS(sbi));
 		} else {
 			go_left = 1;
@@ -2511,8 +2511,8 @@ find_other_zone:
 			left_start--;
 			continue;
 		}
-		left_start = find_next_zero_bit(free_i->free_secmap,
-							MAIN_SECS(sbi), 0);
+		left_start = find_first_zero_bit(free_i->free_secmap,
+							MAIN_SECS(sbi));
 		f2fs_bug_on(sbi, left_start >= MAIN_SECS(sbi));
 		break;
 	}
--- a/fs/ocfs2/cluster/heartbeat.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/fs/ocfs2/cluster/heartbeat.c
@@ -379,7 +379,7 @@ static void o2hb_nego_timeout(struct wor
 
 	o2hb_fill_node_map(live_node_bitmap, sizeof(live_node_bitmap));
 	/* lowest node as master node to make negotiate decision. */
-	master_node = find_next_bit(live_node_bitmap, O2NM_MAX_NODES, 0);
+	master_node = find_first_bit(live_node_bitmap, O2NM_MAX_NODES);
 
 	if (master_node == o2nm_this_node()) {
 		if (!test_bit(master_node, reg->hr_nego_node_bitmap)) {
--- a/fs/ocfs2/dlm/dlmdomain.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/fs/ocfs2/dlm/dlmdomain.c
@@ -1045,7 +1045,7 @@ static int dlm_send_regions(struct dlm_c
 	int status, ret = 0, i;
 	char *p;
 
-	if (find_next_bit(node_map, O2NM_MAX_NODES, 0) >= O2NM_MAX_NODES)
+	if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES)
 		goto bail;
 
 	qr = kzalloc(sizeof(struct dlm_query_region), GFP_KERNEL);
@@ -1217,7 +1217,7 @@ static int dlm_send_nodeinfo(struct dlm_
 	struct o2nm_node *node;
 	int ret = 0, status, count, i;
 
-	if (find_next_bit(node_map, O2NM_MAX_NODES, 0) >= O2NM_MAX_NODES)
+	if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES)
 		goto bail;
 
 	qn = kzalloc(sizeof(struct dlm_query_nodeinfo), GFP_KERNEL);
--- a/fs/ocfs2/dlm/dlmmaster.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/fs/ocfs2/dlm/dlmmaster.c
@@ -861,7 +861,7 @@ lookup:
 		 * to see if there are any nodes that still need to be
 		 * considered.  these will not appear in the mle nodemap
 		 * but they might own this lockres.  wait on them. */
-		bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0);
+		bit = find_first_bit(dlm->recovery_map, O2NM_MAX_NODES);
 		if (bit < O2NM_MAX_NODES) {
 			mlog(0, "%s: res %.*s, At least one node (%d) "
 			     "to recover before lock mastery can begin\n",
@@ -912,7 +912,7 @@ redo_request:
 		dlm_wait_for_recovery(dlm);
 
 		spin_lock(&dlm->spinlock);
-		bit = find_next_bit(dlm->recovery_map, O2NM_MAX_NODES, 0);
+		bit = find_first_bit(dlm->recovery_map, O2NM_MAX_NODES);
 		if (bit < O2NM_MAX_NODES) {
 			mlog(0, "%s: res %.*s, At least one node (%d) "
 			     "to recover before lock mastery can begin\n",
@@ -1079,7 +1079,7 @@ recheck:
 		sleep = 1;
 		/* have all nodes responded? */
 		if (voting_done && !*blocked) {
-			bit = find_next_bit(mle->maybe_map, O2NM_MAX_NODES, 0);
+			bit = find_first_bit(mle->maybe_map, O2NM_MAX_NODES);
 			if (dlm->node_num <= bit) {
 				/* my node number is lowest.
 			 	 * now tell other nodes that I am
@@ -1234,8 +1234,8 @@ static int dlm_restart_lock_mastery(stru
 		} else {
 			mlog(ML_ERROR, "node down! %d\n", node);
 			if (blocked) {
-				int lowest = find_next_bit(mle->maybe_map,
-						       O2NM_MAX_NODES, 0);
+				int lowest = find_first_bit(mle->maybe_map,
+						       O2NM_MAX_NODES);
 
 				/* act like it was never there */
 				clear_bit(node, mle->maybe_map);
@@ -1795,7 +1795,7 @@ int dlm_assert_master_handler(struct o2n
 		     "MLE for it! (%.*s)\n", assert->node_idx,
 		     namelen, name);
 	} else {
-		int bit = find_next_bit (mle->maybe_map, O2NM_MAX_NODES, 0);
+		int bit = find_first_bit(mle->maybe_map, O2NM_MAX_NODES);
 		if (bit >= O2NM_MAX_NODES) {
 			/* not necessarily an error, though less likely.
 			 * could be master just re-asserting. */
@@ -2521,7 +2521,7 @@ static int dlm_is_lockres_migratable(str
 	}
 
 	if (!nonlocal) {
-		node_ref = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
+		node_ref = find_first_bit(res->refmap, O2NM_MAX_NODES);
 		if (node_ref >= O2NM_MAX_NODES)
 			return 0;
 	}
@@ -3303,7 +3303,7 @@ static void dlm_clean_block_mle(struct d
 	BUG_ON(mle->type != DLM_MLE_BLOCK);
 
 	spin_lock(&mle->spinlock);
-	bit = find_next_bit(mle->maybe_map, O2NM_MAX_NODES, 0);
+	bit = find_first_bit(mle->maybe_map, O2NM_MAX_NODES);
 	if (bit != dead_node) {
 		mlog(0, "mle found, but dead node %u would not have been "
 		     "master\n", dead_node);
@@ -3542,7 +3542,7 @@ void dlm_force_free_mles(struct dlm_ctxt
 	spin_lock(&dlm->master_lock);
 
 	BUG_ON(dlm->dlm_state != DLM_CTXT_LEAVING);
-	BUG_ON((find_next_bit(dlm->domain_map, O2NM_MAX_NODES, 0) < O2NM_MAX_NODES));
+	BUG_ON((find_first_bit(dlm->domain_map, O2NM_MAX_NODES) < O2NM_MAX_NODES));
 
 	for (i = 0; i < DLM_HASH_BUCKETS; i++) {
 		bucket = dlm_master_hash(dlm, i);
--- a/fs/ocfs2/dlm/dlmrecovery.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/fs/ocfs2/dlm/dlmrecovery.c
@@ -451,7 +451,7 @@ static int dlm_do_recovery(struct dlm_ct
 	if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) {
 		int bit;
 
-		bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES, 0);
+		bit = find_first_bit(dlm->recovery_map, O2NM_MAX_NODES);
 		if (bit >= O2NM_MAX_NODES || bit < 0)
 			dlm_set_reco_dead_node(dlm, O2NM_INVALID_NODE_NUM);
 		else
--- a/fs/ocfs2/dlm/dlmthread.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/fs/ocfs2/dlm/dlmthread.c
@@ -92,7 +92,7 @@ int __dlm_lockres_unused(struct dlm_lock
 		return 0;
 
 	/* Another node has this resource with this node as the master */
-	bit = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
+	bit = find_first_bit(res->refmap, O2NM_MAX_NODES);
 	if (bit < O2NM_MAX_NODES)
 		return 0;
 
--- a/lib/genalloc.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/lib/genalloc.c
@@ -251,7 +251,7 @@ void gen_pool_destroy(struct gen_pool *p
 		list_del(&chunk->next_chunk);
 
 		end_bit = chunk_size(chunk) >> order;
-		bit = find_next_bit(chunk->bits, end_bit, 0);
+		bit = find_first_bit(chunk->bits, end_bit);
 		BUG_ON(bit < end_bit);
 
 		vfree(chunk);
--- a/net/ncsi/ncsi-manage.c~all-replace-find_next_zero_bit-with-find_first_zero_bit-where-appropriate
+++ a/net/ncsi/ncsi-manage.c
@@ -608,7 +608,7 @@ static int clear_one_vid(struct ncsi_dev
 	bitmap = &ncf->bitmap;
 
 	spin_lock_irqsave(&nc->lock, flags);
-	index = find_next_bit(bitmap, ncf->n_vids, 0);
+	index = find_first_bit(bitmap, ncf->n_vids);
 	if (index >= ncf->n_vids) {
 		spin_unlock_irqrestore(&nc->lock, flags);
 		return -1;
@@ -667,7 +667,7 @@ static int set_one_vid(struct ncsi_dev_p
 		return -1;
 	}
 
-	index = find_next_zero_bit(bitmap, ncf->n_vids, 0);
+	index = find_first_zero_bit(bitmap, ncf->n_vids);
 	if (index < 0 || index >= ncf->n_vids) {
 		netdev_err(ndp->ndev.dev,
 			   "Channel %u already has all VLAN filters set\n",
_


  parent reply	other threads:[~2021-09-08  2:59 UTC|newest]

Thread overview: 186+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08  2:52 incoming Andrew Morton
2021-09-08  2:52 ` [patch 001/147] mm, slub: don't call flush_all() from slab_debug_trace_open() Andrew Morton
2021-09-08  2:53 ` [patch 002/147] mm, slub: allocate private object map for debugfs listings Andrew Morton
2021-09-08  2:53 ` [patch 003/147] mm, slub: allocate private object map for validate_slab_cache() Andrew Morton
2021-09-08  2:53 ` [patch 004/147] mm, slub: don't disable irq for debug_check_no_locks_freed() Andrew Morton
2021-09-08  2:53 ` [patch 005/147] mm, slub: remove redundant unfreeze_partials() from put_cpu_partial() Andrew Morton
2021-09-08  2:53 ` [patch 006/147] mm, slub: extract get_partial() from new_slab_objects() Andrew Morton
2021-09-08  2:53 ` [patch 007/147] mm, slub: dissolve new_slab_objects() into ___slab_alloc() Andrew Morton
2021-09-08  2:53 ` [patch 008/147] mm, slub: return slab page from get_partial() and set c->page afterwards Andrew Morton
2021-09-08  2:53 ` [patch 009/147] mm, slub: restructure new page checks in ___slab_alloc() Andrew Morton
2021-09-08  2:53 ` [patch 010/147] mm, slub: simplify kmem_cache_cpu and tid setup Andrew Morton
2021-09-08  2:53 ` [patch 011/147] mm, slub: move disabling/enabling irqs to ___slab_alloc() Andrew Morton
2021-09-08  2:53 ` [patch 012/147] mm, slub: do initial checks in ___slab_alloc() with irqs enabled Andrew Morton
2021-09-08  2:53 ` [patch 013/147] mm, slub: move disabling irqs closer to get_partial() in ___slab_alloc() Andrew Morton
2021-09-08  2:53 ` [patch 014/147] mm, slub: restore irqs around calling new_slab() Andrew Morton
2021-09-08  2:53 ` [patch 015/147] mm, slub: validate slab from partial list or page allocator before making it cpu slab Andrew Morton
2021-09-08  2:53 ` [patch 016/147] mm, slub: check new pages with restored irqs Andrew Morton
2021-09-08  2:53 ` [patch 017/147] mm, slub: stop disabling irqs around get_partial() Andrew Morton
2021-09-08  2:53 ` [patch 018/147] mm, slub: move reset of c->page and freelist out of deactivate_slab() Andrew Morton
2021-09-08  2:53 ` [patch 019/147] mm, slub: make locking in deactivate_slab() irq-safe Andrew Morton
2021-09-08  2:54 ` [patch 020/147] mm, slub: call deactivate_slab() without disabling irqs Andrew Morton
2021-09-08  2:54 ` [patch 021/147] mm, slub: move irq control into unfreeze_partials() Andrew Morton
2021-09-08  2:54 ` [patch 022/147] mm, slub: discard slabs in unfreeze_partials() without irqs disabled Andrew Morton
2021-09-08  2:54 ` [patch 023/147] mm, slub: detach whole partial list at once in unfreeze_partials() Andrew Morton
2021-09-08  2:54 ` [patch 024/147] mm, slub: separate detaching of partial list in unfreeze_partials() from unfreezing Andrew Morton
2021-09-08  2:54 ` [patch 025/147] mm, slub: only disable irq with spin_lock in __unfreeze_partials() Andrew Morton
2021-09-08  2:54 ` [patch 026/147] mm, slub: don't disable irqs in slub_cpu_dead() Andrew Morton
2021-09-08  2:54 ` [patch 027/147] mm, slab: split out the cpu offline variant of flush_slab() Andrew Morton
2021-09-08  2:54 ` [patch 028/147] mm: slub: move flush_cpu_slab() invocations __free_slab() invocations out of IRQ context Andrew Morton
2021-09-08  2:54 ` [patch 029/147] mm: slub: make object_map_lock a raw_spinlock_t Andrew Morton
2021-09-08  2:54 ` [patch 030/147] mm, slub: make slab_lock() disable irqs with PREEMPT_RT Andrew Morton
2021-09-08  2:54 ` [patch 031/147] mm, slub: protect put_cpu_partial() with disabled irqs instead of cmpxchg Andrew Morton
2021-09-08 13:05   ` Jesper Dangaard Brouer
2021-09-08 13:58     ` Vlastimil Babka
2021-09-08 14:55       ` David Hildenbrand
2021-09-08 14:59         ` David Hildenbrand
2021-09-08 17:14           ` Jesper Dangaard Brouer
2021-09-08 17:24             ` David Hildenbrand
2021-09-08 16:11       ` Jesper Dangaard Brouer
2021-09-08 16:31         ` Linus Torvalds
2021-09-08  2:54 ` [patch 032/147] mm, slub: use migrate_disable() on PREEMPT_RT Andrew Morton
2021-09-08  2:54 ` [patch 033/147] mm, slub: convert kmem_cpu_slab protection to local_lock Andrew Morton
2021-09-08  2:54 ` [patch 034/147] memory-hotplug.rst: remove locking details from admin-guide Andrew Morton
2021-09-08  2:54 ` [patch 035/147] memory-hotplug.rst: complete admin-guide overhaul Andrew Morton
2021-09-08  2:54 ` [patch 036/147] mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE Andrew Morton
2021-09-08  2:54 ` [patch 037/147] mm: memory_hotplug: cleanup after removal of pfn_valid_within() Andrew Morton
2021-09-08  2:54 ` [patch 038/147] mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range() Andrew Morton
2021-09-08  2:55 ` [patch 039/147] mm/memory_hotplug: remove nid parameter from arch_remove_memory() Andrew Morton
2021-09-08  2:55 ` [patch 040/147] mm/memory_hotplug: remove nid parameter from remove_memory() and friends Andrew Morton
2021-09-08  2:55 ` [patch 041/147] ACPI: memhotplug: memory resources cannot be enabled yet Andrew Morton
2021-09-08  2:55 ` [patch 042/147] mm: track present early pages per zone Andrew Morton
2021-09-08  2:55 ` [patch 043/147] mm/memory_hotplug: introduce "auto-movable" online policy Andrew Morton
2021-09-08  2:55 ` [patch 044/147] drivers/base/memory: introduce "memory groups" to logically group memory blocks Andrew Morton
2021-09-08  2:55 ` [patch 045/147] mm/memory_hotplug: track present pages in memory groups Andrew Morton
2021-09-08  2:55 ` [patch 046/147] ACPI: memhotplug: use a single static memory group for a single memory device Andrew Morton
2021-09-08  2:55 ` [patch 047/147] dax/kmem: use a single static memory group for a single probed unit Andrew Morton
2021-09-08  2:55 ` [patch 048/147] virtio-mem: use a single dynamic memory group for a single virtio-mem device Andrew Morton
2021-09-08  2:55 ` [patch 049/147] mm/memory_hotplug: memory group aware "auto-movable" online policy Andrew Morton
2021-09-08  2:55 ` [patch 050/147] mm/memory_hotplug: improved dynamic " Andrew Morton
2021-09-08  2:55 ` [patch 051/147] mm/memory_hotplug: use helper zone_is_zone_device() to simplify the code Andrew Morton
2021-09-08  2:55 ` [patch 052/147] mm: remove redundant compound_head() calling Andrew Morton
2021-09-08  2:55 ` [patch 053/147] riscv: only select GENERIC_IOREMAP if MMU support is enabled Andrew Morton
2021-09-08  2:56 ` [patch 054/147] mm: move ioremap_page_range to vmalloc.c Andrew Morton
2021-09-08  2:56 ` [patch 055/147] mm: don't allow executable ioremap mappings Andrew Morton
2021-09-08  2:56 ` [patch 056/147] mm/early_ioremap.c: remove redundant early_ioremap_shutdown() Andrew Morton
2021-09-08  2:56 ` [patch 057/147] highmem: don't disable preemption on RT in kmap_atomic() Andrew Morton
2021-09-08  2:56 ` [patch 058/147] mm: in_irq() cleanup Andrew Morton
2021-09-08  2:56 ` [patch 059/147] mm: introduce PAGEFLAGS_MASK to replace ((1UL << NR_PAGEFLAGS) - 1) Andrew Morton
2021-09-08  2:56 ` [patch 060/147] mm/secretmem: use refcount_t instead of atomic_t Andrew Morton
2021-09-08  2:56 ` [patch 061/147] kfence: show cpu and timestamp in alloc/free info Andrew Morton
2021-09-08  2:56 ` [patch 062/147] kfence: test: fail fast if disabled at boot Andrew Morton
2021-09-08  2:56 ` [patch 063/147] mm: introduce Data Access MONitor (DAMON) Andrew Morton
2021-09-08  2:56 ` [patch 064/147] mm/damon/core: implement region-based sampling Andrew Morton
2021-09-08  2:56 ` [patch 065/147] mm/damon: adaptively adjust regions Andrew Morton
2021-09-08  2:56 ` [patch 066/147] mm/idle_page_tracking: make PG_idle reusable Andrew Morton
2021-09-08  2:56 ` [patch 067/147] mm/damon: implement primitives for the virtual memory address spaces Andrew Morton
2021-09-08  2:56 ` [patch 068/147] mm/damon: add a tracepoint Andrew Morton
2021-09-08  2:56 ` [patch 069/147] mm/damon: implement a debugfs-based user space interface Andrew Morton
2021-09-08  2:56 ` [patch 070/147] mm/damon/dbgfs: export kdamond pid to the user space Andrew Morton
2021-09-08  2:57 ` [patch 071/147] mm/damon/dbgfs: support multiple contexts Andrew Morton
2021-09-08  2:57 ` [patch 072/147] Documentation: add documents for DAMON Andrew Morton
2021-09-08  2:57 ` [patch 073/147] mm/damon: add kunit tests Andrew Morton
2021-09-08  2:57 ` [patch 074/147] mm/damon: add user space selftests Andrew Morton
2021-09-08  2:57 ` [patch 075/147] MAINTAINERS: update for DAMON Andrew Morton
2021-09-08  2:57 ` [patch 076/147] alpha: agp: make empty macros use do-while-0 style Andrew Morton
2021-09-08  2:57 ` [patch 077/147] alpha: pci-sysfs: fix all kernel-doc warnings Andrew Morton
2021-09-08  2:57 ` [patch 078/147] percpu: remove export of pcpu_base_addr Andrew Morton
2021-09-08  2:57 ` [patch 079/147] fs/proc/kcore.c: add mmap interface Andrew Morton
2021-09-08 18:13   ` Linus Torvalds
2021-09-09  9:56     ` [External] " Feng Zhou
2021-09-09 17:32       ` Linus Torvalds
2021-09-09 17:34         ` Linus Torvalds
2021-09-10  3:18           ` Feng Zhou
2021-09-10 10:08   ` David Hildenbrand
2021-09-10 12:00     ` Mike Rapoport
2021-09-10 12:02       ` David Hildenbrand
2021-09-08  2:57 ` [patch 080/147] proc: stop using seq_get_buf in proc_task_name Andrew Morton
2021-09-08  2:57 ` [patch 081/147] connector: send event on write to /proc/[pid]/comm Andrew Morton
2021-09-08  2:57 ` [patch 082/147] arch: Kconfig: fix spelling mistake "seperate" -> "separate" Andrew Morton
2021-09-08  2:57 ` [patch 083/147] include/linux/once.h: fix trivia typo Not -> Note Andrew Morton
2021-09-08  2:57 ` [patch 084/147] units: change from 'L' to 'UL' Andrew Morton
2021-09-08  2:57 ` [patch 085/147] units: add the HZ macros Andrew Morton
2021-09-08  2:57 ` [patch 086/147] thermal/drivers/devfreq_cooling: use " Andrew Morton
2021-09-08  2:57 ` [patch 087/147] devfreq: " Andrew Morton
2021-09-08  2:57 ` [patch 088/147] iio/drivers/as73211: " Andrew Morton
2021-09-08  2:58 ` [patch 089/147] hwmon/drivers/mr75203: " Andrew Morton
2021-09-08  2:58 ` [patch 090/147] iio/drivers/hid-sensor: " Andrew Morton
2021-09-08  2:58 ` [patch 091/147] i2c/drivers/ov02q10: " Andrew Morton
2021-09-08  2:58 ` [patch 092/147] mtd/drivers/nand: " Andrew Morton
2021-09-08  6:39   ` Miquel Raynal
2021-09-08  2:58 ` [patch 093/147] phy/drivers/stm32: " Andrew Morton
2021-09-08  2:58 ` [patch 094/147] kernel/acct.c: use dedicated helper to access rlimit values Andrew Morton
2021-09-08  2:58 ` [patch 095/147] profiling: fix shift-out-of-bounds bugs Andrew Morton
2021-09-08  2:58 ` [patch 096/147] MAINTAINERS: update ClangBuiltLinux mailing list Andrew Morton
2021-09-08  2:58 ` [patch 097/147] Documentation/llvm: update " Andrew Morton
2021-09-08  2:58 ` [patch 098/147] Documentation/llvm: update IRC location Andrew Morton
2021-09-08  2:58 ` [patch 099/147] math: make RATIONAL tristate Andrew Morton
2021-09-08  2:58 ` [patch 100/147] math: RATIONAL_KUNIT_TEST should depend on RATIONAL instead of selecting it Andrew Morton
2021-09-08  2:58 ` [patch 101/147] lib/string: optimized memcpy Andrew Morton
2021-09-08 18:26   ` Linus Torvalds
2021-09-08  2:58 ` [patch 102/147] lib/string: optimized memmove Andrew Morton
2021-09-08 18:29   ` Linus Torvalds
2021-09-09  8:28     ` David Laight
2021-09-08  2:58 ` [patch 103/147] lib/string: optimized memset Andrew Morton
2021-09-08 18:34   ` Linus Torvalds
2021-09-09 10:27     ` Matteo Croce
2021-09-08  2:58 ` [patch 104/147] lib/test: convert test_sort.c to use KUnit Andrew Morton
2021-09-08  2:58 ` [patch 105/147] lib/dump_stack: correct kernel-doc notation Andrew Morton
2021-09-08  2:58 ` [patch 106/147] lib/iov_iter.c: fix kernel-doc warnings Andrew Morton
2021-09-08  2:58 ` [patch 107/147] bitops: protect find_first_{,zero}_bit properly Andrew Morton
2021-09-08  2:59 ` [patch 108/147] bitops: move find_bit_*_le functions from le.h to find.h Andrew Morton
2021-09-08 18:37   ` Linus Torvalds
2021-09-08 19:38     ` Yury Norov
2021-09-08 19:46       ` Linus Torvalds
2021-09-08 19:49       ` Andrew Morton
2021-09-08 19:56         ` Linus Torvalds
2021-09-08 20:08           ` Linus Torvalds
2021-09-08 20:16         ` Yury Norov
2021-09-08  2:59 ` [patch 109/147] include: move find.h from asm_generic to linux Andrew Morton
2021-09-08  2:59 ` [patch 110/147] arch: remove GENERIC_FIND_FIRST_BIT entirely Andrew Morton
2021-09-08  2:59 ` [patch 111/147] lib: add find_first_and_bit() Andrew Morton
2021-09-08  2:59 ` [patch 112/147] cpumask: use find_first_and_bit() Andrew Morton
2021-09-08  2:59 ` Andrew Morton [this message]
2021-09-08  2:59 ` [patch 114/147] tools: sync tools/bitmap with mother linux Andrew Morton
2021-09-08  2:59 ` [patch 115/147] cpumask: replace cpumask_next_* with cpumask_first_* where appropriate Andrew Morton
2021-09-08  2:59 ` [patch 116/147] include/linux: move for_each_bit() macros from bitops.h to find.h Andrew Morton
2021-09-08  2:59 ` [patch 117/147] find: micro-optimize for_each_{set,clear}_bit() Andrew Morton
2021-09-08  2:59 ` [patch 118/147] bitops: replace for_each_*_bit_from() with for_each_*_bit() where appropriate Andrew Morton
2021-09-08  2:59 ` [patch 119/147] tools: rename bitmap_alloc() to bitmap_zalloc() Andrew Morton
2021-09-08  2:59 ` [patch 120/147] mm/percpu: micro-optimize pcpu_is_populated() Andrew Morton
2021-09-08  2:59 ` [patch 121/147] bitmap: unify find_bit operations Andrew Morton
2021-09-08  2:59 ` [patch 122/147] lib: bitmap: add performance test for bitmap_print_to_pagebuf Andrew Morton
2021-09-08  2:59 ` [patch 123/147] vsprintf: rework bitmap_list_string Andrew Morton
2021-09-08  2:59 ` [patch 124/147] checkpatch: support wide strings Andrew Morton
2021-09-08  2:59 ` [patch 125/147] checkpatch: make email address check case insensitive Andrew Morton
2021-09-08  2:59 ` [patch 126/147] checkpatch: improve GIT_COMMIT_ID test Andrew Morton
2021-09-08  3:00 ` [patch 127/147] fs/epoll: use a per-cpu counter for user's watches count Andrew Morton
2021-09-08  3:00 ` [patch 128/147] init: move usermodehelper_enable() to populate_rootfs() Andrew Morton
2021-09-08 15:44   ` Luis Chamberlain
2021-09-10  8:12     ` Rasmus Villemoes
2021-09-10 17:47       ` H. Peter Anvin
2021-09-10 17:51       ` Luis Chamberlain
2021-09-08  3:00 ` [patch 130/147] nilfs2: fix memory leak in nilfs_sysfs_create_device_group Andrew Morton
2021-09-08  3:00 ` [patch 131/147] nilfs2: fix NULL pointer in nilfs_##name##_attr_release Andrew Morton
2021-09-08  3:00 ` [patch 132/147] nilfs2: fix memory leak in nilfs_sysfs_create_##name##_group Andrew Morton
2021-09-08  3:00 ` [patch 133/147] nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group Andrew Morton
2021-09-08  3:00 ` [patch 134/147] nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group Andrew Morton
2021-09-08  3:00 ` [patch 135/147] nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group Andrew Morton
2021-09-08  3:00 ` [patch 136/147] nilfs2: use refcount_dec_and_lock() to fix potential UAF Andrew Morton
2021-09-24 10:35   ` Pavel Machek
2021-09-24 11:09     ` Ryusuke Konishi
2021-09-24 12:12   ` Matthew Wilcox
2021-09-24 15:09     ` Ryusuke Konishi
2021-09-08  3:00 ` [patch 137/147] fs/coredump.c: log if a core dump is aborted due to changed file permissions Andrew Morton
2021-09-08  3:00 ` [patch 138/147] coredump: fix memleak in dump_vma_snapshot() Andrew Morton
2021-09-08  3:00 ` [patch 139/147] kernel/fork.c: unexport get_{mm,task}_exe_file Andrew Morton
2021-09-08  3:00 ` [patch 140/147] pid: cleanup the stale comment mentioning pidmap_init() Andrew Morton
2021-09-08  3:00 ` [patch 141/147] prctl: allow to setup brk for et_dyn executables Andrew Morton
2021-09-08  3:00 ` [patch 142/147] configs: remove the obsolete CONFIG_INPUT_POLLDEV Andrew Morton
2021-09-08  3:00 ` [patch 143/147] Kconfig.debug: drop selecting non-existing HARDLOCKUP_DETECTOR_ARCH Andrew Morton
2021-09-08  3:00 ` [patch 144/147] selftests/memfd: remove unused variable Andrew Morton
2021-09-08  3:00 ` [patch 145/147] ipc: replace costly bailout check in sysvipc_find_ipc() Andrew Morton
2021-09-08  3:00 ` [patch 146/147] mm/workingset: correct kernel-doc notations Andrew Morton
2021-09-08  3:00 ` [patch 147/147] scripts: check_extable: fix typo in user error message Andrew Morton
2021-09-08  3:16 ` [patch 129/147] trap: cleanup trap_init() Andrew Morton
2021-09-08  8:57 ` incoming Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210908025916.XhEiyDfwR%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aklimov@redhat.com \
    --cc=alobakin@pm.me \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dennis@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=ulf.hansson@linaro.org \
    --cc=will@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).