From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9751CC33CB2 for ; Tue, 28 Jan 2020 14:29:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 680D62468F for ; Tue, 28 Jan 2020 14:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221777; bh=sbUtdqQ70k6dULsK6EFRiFeRzi1RS4x+BpqnYqMhc9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=eV3ap8PrmtdkXokSQPM35tccH9u5NPh1VqlXyQmH8nbyD+TigW1BBldGQgsGunXW3 66cf4uvkzjvRJEij/B98upxuFdlaEt2xCrOus7OFIYDc+xhI8H81Xxxw0hOBZ5eugx 0qjvzr4htSZaErUTUc4V0fnPDAZ0uj+2GW3K9wvU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387678AbgA1O3g (ORCPT ); Tue, 28 Jan 2020 09:29:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:58180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387507AbgA1O3e (ORCPT ); Tue, 28 Jan 2020 09:29:34 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAE6A2468F; Tue, 28 Jan 2020 14:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221773; bh=sbUtdqQ70k6dULsK6EFRiFeRzi1RS4x+BpqnYqMhc9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ksc02caMglDJVUUtdf8TVqaoWnVLJE9K0vVnGPIFWz/fL9t4NGKYukTN/Tiq7heyQ DuteDP/C7zjVDb6p3WDQeFdCoGa4uLyLRJy0ZgohwyefjSWQj5Dh3YveOo1SfWA+yJ MMjYVe/nFcueoAyBLJNLe7n56L79HPHwF2VtL9eI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Baoquan He , Michal Hocko , "Rafael J. Wysocki" , Mukesh Ojha , Oscar Salvador , Andrew Morton , Linus Torvalds , David Hildenbrand Subject: [PATCH 4.19 75/92] drivers/base/memory.c: clean up relics in function parameters Date: Tue, 28 Jan 2020 15:08:43 +0100 Message-Id: <20200128135819.027417564@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135809.344954797@linuxfoundation.org> References: <20200128135809.344954797@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Baoquan He commit 063b8a4cee8088224bcdb79bcd08db98df16178e upstream. The input parameter 'phys_index' of memory_block_action() is actually the section number, but not the phys_index of memory_block. This is a relic from the past when one memory block could only contain one section. Rename it to start_section_nr. And also in remove_memory_section(), the 'node_id' and 'phys_device' arguments are not used by anyone. Remove them. Link: http://lkml.kernel.org/r/20190329144250.14315-2-bhe@redhat.com Signed-off-by: Baoquan He Acked-by: Michal Hocko Reviewed-by: Rafael J. Wysocki Reviewed-by: Mukesh Ojha Reviewed-by: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: David Hildenbrand Signed-off-by: Greg Kroah-Hartman --- drivers/base/memory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -230,13 +230,14 @@ static bool pages_correctly_probed(unsig * OK to have direct references to sparsemem variables in here. */ static int -memory_block_action(unsigned long phys_index, unsigned long action, int online_type) +memory_block_action(unsigned long start_section_nr, unsigned long action, + int online_type) { unsigned long start_pfn; unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; int ret; - start_pfn = section_nr_to_pfn(phys_index); + start_pfn = section_nr_to_pfn(start_section_nr); switch (action) { case MEM_ONLINE: @@ -250,7 +251,7 @@ memory_block_action(unsigned long phys_i break; default: WARN(1, KERN_WARNING "%s(%ld, %ld) unknown action: " - "%ld\n", __func__, phys_index, action, action); + "%ld\n", __func__, start_section_nr, action, action); ret = -EINVAL; } @@ -747,8 +748,7 @@ unregister_memory(struct memory_block *m device_unregister(&memory->dev); } -static int remove_memory_section(unsigned long node_id, - struct mem_section *section, int phys_device) +static int remove_memory_section(struct mem_section *section) { struct memory_block *mem; @@ -780,7 +780,7 @@ int unregister_memory_section(struct mem if (!present_section(section)) return -EINVAL; - return remove_memory_section(0, section, 0); + return remove_memory_section(section); } #endif /* CONFIG_MEMORY_HOTREMOVE */