Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3710401rdb; Wed, 13 Sep 2023 23:24:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEumtd5rmpgVJZwcZgrgLT4TWt/bmHGqMf23QMaqSxDiPlpp4OoG48KoN91d7wT2BE0YYC0 X-Received: by 2002:a17:90b:2353:b0:26b:726:118 with SMTP id ms19-20020a17090b235300b0026b07260118mr4281642pjb.19.1694672691292; Wed, 13 Sep 2023 23:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694672691; cv=none; d=google.com; s=arc-20160816; b=aJrEoZTMCYsqPIvLbsG+ZwJWUx5hF3iEBOZuk+p5SIbPAP4s6I6PHJnJUo2V0r5+rA n9bxNjrvXrK5DUTWMz0zW5a+1pcI4RKk0K8Cb369trO2I0NdVnEvuDkhnI9YV2oR2hfF EGUGB7H7g+EtLzK5lGwpNftIL6o5YbQ+i0prnijRK3x6lxVBhhcEmTIkN4REdXcg1S/c Hzk602H5Z5NYxbVbBhIM8LqD6BQgT/BC7EhupBf2yDtOgRNytI5ziEdcWyXEJiG0zdvr Yw7uZLGtwHAmG/PuoPIm8XJ7vRlWamGxFBPlkPnVVzspq0WWSZ40S0P+wepOrwy/n7C3 PXGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5lLrsLtBLz8MmJE+6Lhxzbn1pcFOnXuuhQwf5bfixtg=; fh=Kt6ZAAlB//jf7srk0fRF9zSKwvVS5s8Ksj+rbTTF4BE=; b=hyGdEW9bM/3IQ8tsu+hoWNP31PYsGVLm3FFhlMCnR87i8nx7ZtBrFqH71STJx5uJhN BDgCq1jLGsNrxlqxZhoSWAH49F2lk3xjPbzWduZBvrDloU4ziq/EnEU0p3mqspGcOa+V UweszU3vh5NXBmZwUSljw/Bj8ZKDgIelHxU575Z91eXWfHntwCbSszhVHehkwCufRuSg +Pl+N1lnX4SWxe6ut9Bs6BGNFfACi3YL1Fu/Qf2vPqquPmEP9mP2zpV+rAcUrdYNLpn+ yMr6ttJJKjKxEPI+6B53JJjTyMCKt46Y3Z1g6FuxrGBc4y3g3hRvFdlG8GUeoAS8Lb0S RCSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JMZ42zVu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f7-20020a17090ab94700b0026b47b87042si1033714pjw.35.2023.09.13.23.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 23:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JMZ42zVu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 76668801F95C; Wed, 13 Sep 2023 23:13:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232706AbjINGNe (ORCPT + 99 others); Thu, 14 Sep 2023 02:13:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjINGNd (ORCPT ); Thu, 14 Sep 2023 02:13:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7E45DF for ; Wed, 13 Sep 2023 23:13:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85377C433C8; Thu, 14 Sep 2023 06:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694672009; bh=hxjVQjecSSBe4DgtU67qykRXre0HLHIWQ7IopGfkXIM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JMZ42zVuZeVBPvF/ovSnME9MEwonKV0Q8UIOkcNbr3tfciVQbjrR4AkwdJeT4gTxe xAHTUJGLWfpECZvE5RC6RTKQkZxWi3Jyq8SAUnb5IFTiw3+sVapzz0DNEJBmq0A81E OV6wLOsAtH2exc5S2F2VmxKlyOJ+CddmobuQpEmKuN8iSRbFOe4AApDxkFpJ2RpERU Wz3uaszxFyEPyAVBEARffhTgwURrUHL8F8bfk83wLtZ46sDU02Y077crT1DL9Y9Zrx PHA+vEhOuHpaemgoV8q2AjasocHfOlVWkjxEz/+S4C5BSSVoGxpcwxrzSEv6WTc2AD 8kUYtQbb9D7pw== Date: Thu, 14 Sep 2023 09:12:54 +0300 From: Mike Rapoport To: Rong Tao Cc: rongtao@cestc.cn, open list , "open list:MEMBLOCK AND MEMORY MANAGEMENT INITIALIZATION" Subject: Re: [PATCH] memblock tests: Fix compilation errors. Message-ID: <20230914061254.GB3303@kernel.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 23:13:46 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email On Mon, Sep 11, 2023 at 10:32:56PM +0800, Rong Tao wrote: > From: Rong Tao > > This patch fix the follow errors. > > commit 61167ad5fecd("mm: pass nid to reserve_bootmem_region()") pass nid > parameter to reserve_bootmem_region(), > > $ make -C tools/testing/memblock/ > ... > memblock.c: In function ‘memmap_init_reserved_pages’: > memblock.c:2111:25: error: too many arguments to function ‘reserve_bootmem_region’ > 2111 | reserve_bootmem_region(start, end, nid); > | ^~~~~~~~~~~~~~~~~~~~~~ > ../../include/linux/mm.h:32:6: note: declared here > 32 | void reserve_bootmem_region(phys_addr_t start, phys_addr_t end); > | ^~~~~~~~~~~~~~~~~~~~~~ > memblock.c:2122:17: error: too many arguments to function ‘reserve_bootmem_region’ > 2122 | reserve_bootmem_region(start, end, nid); > | ^~~~~~~~~~~~~~~~~~~~~~ > > commit dcdfdd40fa82("mm: Add support for unaccepted memory") call > accept_memory() in memblock.c > > $ make -C tools/testing/memblock/ > ... > cc -fsanitize=address -fsanitize=undefined main.o memblock.o \ > lib/slab.o mmzone.o slab.o tests/alloc_nid_api.o \ > tests/alloc_helpers_api.o tests/alloc_api.o tests/basic_api.o \ > tests/common.o tests/alloc_exact_nid_api.o -o main > /usr/bin/ld: memblock.o: in function `memblock_alloc_range_nid': > memblock.c:(.text+0x7ae4): undefined reference to `accept_memory' > > Signed-off-by: Rong Tao Applied, thanks! > --- > tools/include/linux/mm.h | 2 +- > tools/testing/memblock/internal.h | 4 ++++ > tools/testing/memblock/mmzone.c | 2 +- > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h > index a03d9bba5151..2bc94079d616 100644 > --- a/tools/include/linux/mm.h > +++ b/tools/include/linux/mm.h > @@ -29,7 +29,7 @@ static inline void *phys_to_virt(unsigned long address) > return __va(address); > } > > -void reserve_bootmem_region(phys_addr_t start, phys_addr_t end); > +void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid); > > static inline void totalram_pages_inc(void) > { > diff --git a/tools/testing/memblock/internal.h b/tools/testing/memblock/internal.h > index fdb7f5db7308..f6c6e5474c3a 100644 > --- a/tools/testing/memblock/internal.h > +++ b/tools/testing/memblock/internal.h > @@ -20,4 +20,8 @@ void memblock_free_pages(struct page *page, unsigned long pfn, > { > } > > +static inline void accept_memory(phys_addr_t start, phys_addr_t end) > +{ > +} > + > #endif > diff --git a/tools/testing/memblock/mmzone.c b/tools/testing/memblock/mmzone.c > index 7b0909e8b759..d3d58851864e 100644 > --- a/tools/testing/memblock/mmzone.c > +++ b/tools/testing/memblock/mmzone.c > @@ -11,7 +11,7 @@ struct pglist_data *next_online_pgdat(struct pglist_data *pgdat) > return NULL; > } > > -void reserve_bootmem_region(phys_addr_t start, phys_addr_t end) > +void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid) > { > } > > -- > 2.41.0 > -- Sincerely yours, Mike.