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=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable 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 D2996C10F05 for ; Tue, 26 Mar 2019 09:33:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A083620863 for ; Tue, 26 Mar 2019 09:33:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553592798; bh=b1z2AM41SPVknXwOSjCVU1GiDkrZnKZG35kyPZtrgjQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=POlw/0gB2REdwlmAe2+hVY3MR+qEJk1LvOmoWGfS6byIooAW1eUiZI7wpR2Sy/0C9 9MgPxtwf4s/OnNwNti+uE2AN/RdPn9cPpLSutGmbbfSGKJOPFhCW03lGr59/ylptx3 n0mxmac6jUdRxOFNrzLl+oJkCWQ3Oj0XzCsSDppo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731116AbfCZJdR (ORCPT ); Tue, 26 Mar 2019 05:33:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:42304 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726261AbfCZJdQ (ORCPT ); Tue, 26 Mar 2019 05:33:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B393FAD65; Tue, 26 Mar 2019 09:33:15 +0000 (UTC) Date: Tue, 26 Mar 2019 10:33:15 +0100 From: Michal Hocko To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, rppt@linux.ibm.com, osalvador@suse.de, willy@infradead.org, william.kucharski@oracle.com, Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: Re: [PATCH v2 4/4] drivers/base/memory.c: Rename the misleading parameter Message-ID: <20190326093315.GL28406@dhcp22.suse.cz> References: <20190326090227.3059-1-bhe@redhat.com> <20190326090227.3059-5-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190326090227.3059-5-bhe@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 26-03-19 17:02:27, Baoquan He wrote: > The input parameter 'phys_index' of memory_block_action() is actually > the section number, but not the phys_index of memory_block. Fix it. phys_index is a relict from the past and it indeed denotes the section number which is exported as phys_index via sysfs. start_section_nr would be a better name IMHO but nothing to really bike shed about. > Signed-off-by: Baoquan He > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" Acked-by: Michal Hocko > --- > drivers/base/memory.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > index cb8347500ce2..184f4f8d1b62 100644 > --- a/drivers/base/memory.c > +++ b/drivers/base/memory.c > @@ -231,13 +231,13 @@ 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 sec, 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(sec); > > switch (action) { > case MEM_ONLINE: > @@ -251,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__, sec, action, action); > ret = -EINVAL; > } > > -- > 2.17.2 > -- Michal Hocko SUSE Labs