From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 923AB3C1960 for ; Sun, 3 May 2026 13:05:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777813502; cv=none; b=hV+JxDqjRedUww+Zi4e4WDBbeDv3uYdGwDuAcIR8beekuFRAMVQl9d1EH3qtwfFVMxCb6yyXwG8C7DnPQQyBxjoxmNUpMjkcwZpHLoz3j29KhQQSKq3NFIYLvJjUhYC+a/I9o+i4rgXZ+ACr471wrt4Pnq/2cewcvLHEFAdp3+M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777813502; c=relaxed/simple; bh=LmnJHwmYrctWcSRvA4jSbtSCZcxac8sMHyhc7V+wdaw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MrTC7wUWR1vd1324qO/0ON7wZcfwLTRpuT9GanrUGoOGuA3PfUY1OVKsYWPmXBQ6TJFdTaemf5PKHKh6jh4qiwAyAddj2iyAlLdz2QXAWM420jXoM5MuR6uVnnZbFllCCtvc4ye5AEkmYC5fFwcYoV1e9SsIIaekpLFigaSSzFU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=U/JOMoyn; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="U/JOMoyn" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-44d9ace59efso228243f8f.1 for ; Sun, 03 May 2026 06:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777813499; x=1778418299; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=tWy1TTd9buQTYV2GohGlIVlAiwHntOQ7yKetYcNVu+E=; b=U/JOMoynUie7BGkHuhf7FWtQ2ScR9kYstIF11HX3uKtUg4Z8rs/2/qXX4lk3injlrf VTywpQI7+ly+5Jqj02txpsg25YYwWp5CsYGOZrWp+zHLw+14ispmeYummRxhkUIbNkx5 bLJTU6MxCft1cal9MrN8anL0R06QblLIPqZwHVh79xOiQOBJ5L8WW7ZMFewaKG/hlVVi eMMNvS+uPuBn/EBM7OxLVoDU92oDGRqlaUmYdYVqi9rvIqOECiD3dSi5i5cAEgjuz8pq RKXBI8YHnUdx5k1JAkuClvy5ar8m1NhYy5LbxJjbTVCMZGMtNo+Y9VevdqnyTcingaRr N5Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777813499; x=1778418299; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tWy1TTd9buQTYV2GohGlIVlAiwHntOQ7yKetYcNVu+E=; b=rO9kHHGtVPUhU2LDQfSL5/5PnaHa+3H1N80ohqXdNeoA3NCUvvhBNxrtBGWssrZmhr yRd7vwqIkfLdhfmz2M1aKE0Zkm6Y5ZPYSH/XxbqlOyYIJbQro6oD5eztsfSTPrqer4Z6 fu3hsZOG1/CEwdh98+s6Poia6DXo0DfK0gMveLflPSB2ztCQJdxHVYKhsU3lGWAqbmkO kpIK2F6JizmYJ0LQ8DLZYo5LZwL95xvZAl8HEEOl2/GqvNA53hMEQzKBpfb0gv5V/I/S 98xzlDhdIyFeTRUnOCh5uiSxU3BHWVktZQrJm5j/6tIOwOv+d3Ghu4LTgZIr2AkHWFU3 vjhA== X-Gm-Message-State: AOJu0YxG7kaY1WU6l3tahTMnFsFRTZ0DurAeiljgaIYjqd22VGLddLLs QSicp4qyp3EzMhTQ8g4X6cEL5odZl5p6aZDMW/WcrokGaj403eRLUQvSZ5hJvfDqDG9nXsP8sNK FXMWf9IB2QUGPBA== X-Received: from wroc15.prod.google.com ([2002:adf:ed8f:0:b0:44d:d5cb:c96]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:1a8b:b0:441:362c:39c1 with SMTP id ffacd0b85a97d-44bb65e0293mr9485934f8f.33.1777813498660; Sun, 03 May 2026 06:04:58 -0700 (PDT) Date: Sun, 03 May 2026 13:04:54 +0000 In-Reply-To: <20260503-x86-init-cleanup-v2-0-bb690bd2477c@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260503-x86-init-cleanup-v2-0-bb690bd2477c@google.com> X-Mailer: b4 0.14.3 Message-ID: <20260503-x86-init-cleanup-v2-1-bb690bd2477c@google.com> Subject: [PATCH v2 1/3] x86/mm: drop unused return from init_memory_mapping() From: Brendan Jackman To: Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" None of the callers look at the return value. Signed-off-by: Brendan Jackman --- arch/x86/include/asm/pgtable.h | 3 +-- arch/x86/mm/init.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 2187e9cfcefa1..eb09fa7840b49 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -1170,8 +1170,7 @@ extern int direct_gbpages; void init_mem_mapping(void); void early_alloc_pgt_buf(void); void __init poking_init(void); -unsigned long init_memory_mapping(unsigned long start, - unsigned long end, pgprot_t prot); +void init_memory_mapping(unsigned long start, unsigned long end, pgprot_t prot); #ifdef CONFIG_X86_64 extern pgd_t trampoline_pgd_entry; diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index fb67217fddcd3..ae3e9e0820153 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -531,11 +531,11 @@ bool pfn_range_is_mapped(unsigned long start_pfn, unsigned long end_pfn) * This runs before bootmem is initialized and gets pages directly from * the physical memory. To access them they are temporarily mapped. */ -unsigned long __ref init_memory_mapping(unsigned long start, - unsigned long end, pgprot_t prot) +void __ref init_memory_mapping(unsigned long start, + unsigned long end, pgprot_t prot) { struct map_range mr[NR_RANGE_MR]; - unsigned long ret = 0; + unsigned long paddr_last = 0; int nr_range, i; pr_debug("init_memory_mapping: [mem %#010lx-%#010lx]\n", @@ -545,13 +545,11 @@ unsigned long __ref init_memory_mapping(unsigned long start, nr_range = split_mem_range(mr, 0, start, end); for (i = 0; i < nr_range; i++) - ret = kernel_physical_mapping_init(mr[i].start, mr[i].end, - mr[i].page_size_mask, - prot); + paddr_last = kernel_physical_mapping_init(mr[i].start, mr[i].end, + mr[i].page_size_mask, + prot); - add_pfn_range_mapped(start >> PAGE_SHIFT, ret >> PAGE_SHIFT); - - return ret >> PAGE_SHIFT; + add_pfn_range_mapped(start >> PAGE_SHIFT, paddr_last >> PAGE_SHIFT); } /* -- 2.51.2