Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2220049rdb; Fri, 8 Dec 2023 01:35:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEzbTGR+XFdcnZ/EnQehbhbjpCwEDqNnFmZyLyzWL1loEIADKhdZ6ki+au+tAxKodBt3za X-Received: by 2002:a05:6871:79a7:b0:1fa:edc2:892e with SMTP id pb39-20020a05687179a700b001faedc2892emr4252987oac.11.1702028144550; Fri, 08 Dec 2023 01:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702028144; cv=none; d=google.com; s=arc-20160816; b=MbDQqQN53RuPwois+8YlVKR41V1ryVqQ+iu6CGV0lX+PsZwU7Loe3wcjQ28HonlNO1 ekbRsW+7i/rMepQ3M59HuQqY4yxyHA1j1lEH///PxUjweu6M9TGmeKeO7PAQPvflJuO3 /4SgR878Lu0fUphFs5ifCsT3U25fWvf/BkwjF8AK5awSNzriTg8EoknXfTHi7IfAddtA OrbgcPfu+c2JJHhBAxll8FZAbd09auMx2+c8TbQ0ifIRrSYxr6irb92uJLsChPQ3FOfC uBWR7yIJHTOdV0cvhRgCTdXmtEoC6cHejkAMyJr7PbtrVZ282UonMhv2hvrk55Zu4Gus nloA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=B7J8ysymYw3KT+JkAqH5YAJqqTMDimCNhUjELEuxrfE=; fh=XNrEvA3+5Ewadssbwzmnvc7EcL20WqaRZ5RjDnVMq60=; b=0MylNo2id6GYvTnPmee7QZmOx+xhFOwxcO5ZNhJWOzNvzk08JGImP9z7Yq8FYIirul wfHz79DpbC7D33KlV/wrOtsPV1skvYeyeRZAn7bt+/qjAtmM+BGMyH52TS0an/Sf+dL1 kmCKwJgUUAW8lw7Nz8p+WLJZK+LJJo3s7uVna8Dx7N9EAvfuP86LoQ1ibSWHBmqcQlCX FOeAu505GULH6WP5Kc2afSmitj3mSmQcrMYduqSuYZrml+nWmwWpDx//Iyg1GYv9k4kK w+PkespzKnHOUNipX5B3/MsZlG1jfaNzn7GgjApheDol1F2JnPXhbFH+FTRSFkzA/PFF V+sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gG6QeilF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id c32-20020a634e20000000b005bdfbf1d562si1221132pgb.192.2023.12.08.01.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 01:35:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gG6QeilF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id A16B9823B3C2; Fri, 8 Dec 2023 01:35:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233259AbjLHJfX (ORCPT + 99 others); Fri, 8 Dec 2023 04:35:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231902AbjLHJfV (ORCPT ); Fri, 8 Dec 2023 04:35:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70BA90 for ; Fri, 8 Dec 2023 01:35:27 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA98DC433C7; Fri, 8 Dec 2023 09:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702028127; bh=2RDEVzmuLhz2tEm7RLeEBtH8w/GArNTHcFtmWcAE6Dw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gG6QeilFYtk+3SeDmXLLfGh0A6HyGUgUpd5hmq6w/s5pgLCQkrKjWgIfIQft4McJe WlmdLj9+Jyr32y6T3eHIiztaLmtMany7q4LdUdUKkXx15Wj2t7dMl0r4botTKelIps agKXjuKrN6tajgXFSssjAfmoQYh+YwfDvF5aiOWuqO90Q3FTihlyKfH4JgzTRgsd1g XTsH4MDMYn+gHG5dQlMZVP7pazHmBSfqdfMujoRoxYjbbjuiUgP9S1ul6VErL6gN5L qC2qdzHk2FxSKjo+o/OsGQtyoFgpro7bE2S+xvgse6zdAf1bYk4nM1ezKI0lD9HG1q Q0FYSd6sk04Ag== Date: Fri, 8 Dec 2023 11:35:16 +0200 From: Mike Rapoport To: Yuntao Wang Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH] memblock: Return NUMA_NO_NODE instead of -1 to improve code readability Message-ID: <20231208093515.GN636165@kernel.org> References: <20231207131001.224914-1-ytcoode@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231207131001.224914-1-ytcoode@gmail.com> 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Fri, 08 Dec 2023 01:35:41 -0800 (PST) On Thu, Dec 07, 2023 at 09:10:01PM +0800, Yuntao Wang wrote: > When no corresponding memory region is found for the given pfn, return > NUMA_NO_NODE instead of -1. This improves code readability and aligns with > the existing logic of the memblock_search_pfn_nid() function's user. > > Signed-off-by: Yuntao Wang Applied, thanks! > --- > mm/memblock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memblock.c b/mm/memblock.c > index 5a88d6d24d79..c1f579c23396 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -1851,7 +1851,7 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn, > int mid = memblock_search(type, PFN_PHYS(pfn)); > > if (mid == -1) > - return -1; > + return NUMA_NO_NODE; > > *start_pfn = PFN_DOWN(type->regions[mid].base); > *end_pfn = PFN_DOWN(type->regions[mid].base + type->regions[mid].size); > -- > 2.43.0 > -- Sincerely yours, Mike.