mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>
Cc: Sang-Heon Jeon <ekffu200098@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: [PATCH 1/5] x86/setup: remove unreachable memblock_reserve() return value check
Date: Wed, 17 Jun 2026 03:29:52 +0900	[thread overview]
Message-ID: <20260616182959.2429774-2-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260616182959.2429774-1-ekffu200098@gmail.com>

trim_snb_memory() runs from early_reserve_memory() in setup_arch(), before
e820__memblock_setup() calls memblock_allow_resize(). At that point
memblock_reserve() either succeeds or panics, never returning an error.

Therefore the return value check is unreachable, so remove it and the
related logic.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 arch/x86/kernel/setup.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 46882ce79c3a..f9395bc632ca 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -742,11 +742,8 @@ static void __init trim_snb_memory(void)
 	 * setup_arch(), so there is no need to reserve it here.
 	 */
 
-	for (i = 0; i < ARRAY_SIZE(bad_pages); i++) {
-		if (memblock_reserve(bad_pages[i], PAGE_SIZE))
-			printk(KERN_WARNING "failed to reserve 0x%08lx\n",
-			       bad_pages[i]);
-	}
+	for (i = 0; i < ARRAY_SIZE(bad_pages); i++)
+		memblock_reserve(bad_pages[i], PAGE_SIZE);
 }
 
 static void __init trim_bios_range(void)
-- 
2.43.0


  reply	other threads:[~2026-06-16 18:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 18:29 [PATCH 0/5] treewide: remove unreachable memblock_reserve() return value checks in early boot Sang-Heon Jeon
2026-06-16 18:29 ` Sang-Heon Jeon [this message]
2026-06-16 18:29 ` [PATCH 2/5] sh: remove unreachable memblock_reserve() return value check Sang-Heon Jeon
2026-06-16 18:29 ` [PATCH 3/5] powerpc/fadump: remove unreachable memblock_reserve() return value checks Sang-Heon Jeon
2026-06-17  9:27   ` Mukesh Kumar Chaurasiya
2026-06-16 18:29 ` [PATCH 4/5] xtensa: " Sang-Heon Jeon
2026-06-16 18:29 ` [PATCH 5/5] Revert "tpm: do not ignore memblock_reserve return value" 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=20260616182959.2429774-2-ekffu200098@gmail.com \
    --to=ekffu200098@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@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

all inboxes | Powered by JetHome®