linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gautam Menghani <gautammenghani201@gmail.com>
To: akpm@linux-foundation.org
Cc: Gautam Menghani <gautammenghani201@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages()
Date: Sun, 12 Jun 2022 11:23:20 -0700	[thread overview]
Message-ID: <20220612182320.160651-1-gautammenghani201@gmail.com> (raw)

Remove unwanted initialization for the variable 'next'. This fixes the
clang scan warning: Value stored to 'next' during its initialization is 
never read [deadcode.DeadStores]

Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
---
 mm/sparse-vmemmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index f4fa61dbbee3..3008aa7859e0 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -737,7 +737,7 @@ static int __meminit vmemmap_populate_compound_pages(unsigned long start_pfn,
 
 	size = min(end - start, pgmap_vmemmap_nr(pgmap) * sizeof(struct page));
 	for (addr = start; addr < end; addr += size) {
-		unsigned long next = addr, last = addr + size;
+		unsigned long next, last = addr + size;
 
 		/* Populate the head page vmemmap page */
 		pte = vmemmap_populate_address(addr, node, NULL, NULL);
-- 
2.25.1



             reply	other threads:[~2022-06-12 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12 18:23 Gautam Menghani [this message]
2022-06-13  7:18 ` [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages() Muchun Song
2022-06-13 15:43 ` David Hildenbrand
2022-06-14 10:33 ` Joao Martins
2022-06-15  7:34 ` Oscar Salvador

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=20220612182320.160651-1-gautammenghani201@gmail.com \
    --to=gautammenghani201@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).