From patchwork Wed Jan 15 15:33:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11335115 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BF7C1398 for ; Wed, 15 Jan 2020 15:34:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DDE592053B for ; Wed, 15 Jan 2020 15:34:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="c1qn9TBE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDE592053B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 44DBF8E000F; Wed, 15 Jan 2020 10:34:08 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3FEF68E0003; Wed, 15 Jan 2020 10:34:08 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 33BD58E000F; Wed, 15 Jan 2020 10:34:08 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 1F4CF8E0003 for ; Wed, 15 Jan 2020 10:34:08 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id CBCE1824805A for ; Wed, 15 Jan 2020 15:34:07 +0000 (UTC) X-FDA: 76380264534.12.ball28_411cbc374c205 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,david@redhat.com,:stable@vger.kernel.org::osalvador@suse.de:mhocko@suse.com:aneesh.kumar@linux.ibm.com:gregkh@linuxfoundation.org:dan.j.williams@intel.com:akpm@linux-foundation.org:lvivier@redhat.com:bhe@redhat.com:david@redhat.com,RULES_HIT:30034:30054:30064,0,RBL:207.211.31.120:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:29,LUA_SUMMARY:none X-HE-Tag: ball28_411cbc374c205 X-Filterd-Recvd-Size: 5132 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 15:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579102446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iqgCaZviHLl0j25ZTLpmn0A6giTT4QsPeJlLoPbLi5c=; b=c1qn9TBE4Ny8PJ+UQErpmXW0+nK4ZFumfgmNx9K801ANThCxgGb3AvkwEJuHZ8HOJtf+OK a13o7NuK4xM0pynb9mug9qlncMOh77oDYom7+Aq605UrPSvxZ9LwqPfJOTRnGxB2fbQf9f EDW54tf6GFLIsXPVm5BLO/1/QbjaAVA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-VmF-FHJAMCaT26V_ZHofcw-1; Wed, 15 Jan 2020 10:34:03 -0500 X-MC-Unique: VmF-FHJAMCaT26V_ZHofcw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE53C1109881; Wed, 15 Jan 2020 15:34:01 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9936786CB2; Wed, 15 Jan 2020 15:33:59 +0000 (UTC) From: David Hildenbrand To: stable@vger.kernel.org Cc: linux-mm@kvack.org, Oscar Salvador , Michal Hocko , "Aneesh Kumar K . V" , Greg Kroah-Hartman , Dan Williams , Andrew Morton , Laurent Vivier , Baoquan He , David Hildenbrand Subject: [PATCH for 4.19-stable 07/25] drivers/base/memory.c: clean up relics in function parameters Date: Wed, 15 Jan 2020 16:33:21 +0100 Message-Id: <20200115153339.36409-8-david@redhat.com> In-Reply-To: <20200115153339.36409-1-david@redhat.com> References: <20200115153339.36409-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- drivers/base/memory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 5fca7225f3fe..b384f01ad29d 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -230,13 +230,14 @@ static bool pages_correctly_probed(unsigned long start_pfn) * 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_index, unsigned long action, int online_t 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 *memory) 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_section *section) if (!present_section(section)) return -EINVAL; - return remove_memory_section(0, section, 0); + return remove_memory_section(section); } #endif /* CONFIG_MEMORY_HOTREMOVE */