Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 1/4] percpu: remove redundant assignments to bits
Date: Wed,  2 Sep 2026 01:53:01 +0900	[thread overview]
Message-ID: <20260901165307.1026248-2-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260901165307.1026248-1-ekffu200098@gmail.com>

pcpu_chunk_refresh_hint() and pcpu_find_block_fit() set bits to 0 and
later call pcpu_next_md_free_region() or pcpu_next_fit_region(), which
unconditionally set *bits to 0. Nothing uses it in between, so the
assignments have no effect.

Remove redundant assignments.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 mm/percpu.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index a802d72c116f..5700385fe6a4 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -758,7 +758,6 @@ static void pcpu_chunk_refresh_hint(struct pcpu_chunk *chunk, bool full_scan)
 		chunk_md->contig_hint = 0;
 	}
 
-	bits = 0;
 	pcpu_for_each_md_free_region(chunk, bit_off, bits)
 		pcpu_block_update(chunk_md, bit_off, bit_off + bits);
 }
@@ -1122,7 +1121,6 @@ static int pcpu_find_block_fit(struct pcpu_chunk *chunk, int alloc_bits,
 		return -1;
 
 	bit_off = pcpu_next_hint(chunk_md, alloc_bits);
-	bits = 0;
 	pcpu_for_each_fit_region(chunk, alloc_bits, align, bit_off, bits) {
 		if (!pop_only || pcpu_is_populated(chunk, bit_off, bits,
 						   &next_off))
-- 
2.43.0



  reply	other threads:[~2026-09-01 16:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 16:53 [PATCH 0/4] percpu: remove code with no effect Sang-Heon Jeon
2026-09-01 16:53 ` Sang-Heon Jeon [this message]
2026-09-01 16:53 ` [PATCH 2/4] percpu: remove unnecessary initialization in pcpu_build_alloc_info() Sang-Heon Jeon
2026-09-01 16:53 ` [PATCH 3/4] percpu: remove unnecessary cpumask_clear() " Sang-Heon Jeon
2026-09-01 16:53 ` [PATCH 4/4] percpu: remove unnecessary return in pcpu_populate_pte() Sang-Heon Jeon

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=20260901165307.1026248-2-ekffu200098@gmail.com \
    --to=ekffu200098@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=dennis@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    /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