Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D540E810C4 for ; Wed, 27 Sep 2023 10:48:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.608884.947666 (Exim 4.92) (envelope-from ) id 1qlS5j-0002Yw-IW; Wed, 27 Sep 2023 10:48:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 608884.947666; Wed, 27 Sep 2023 10:48:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qlS5j-0002Yp-EP; Wed, 27 Sep 2023 10:48:27 +0000 Received: by outflank-mailman (input) for mailman id 608884; Wed, 27 Sep 2023 10:48:26 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qlS5i-0002Yh-4f for xen-devel@lists.xenproject.org; Wed, 27 Sep 2023 10:48:26 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qlS5h-00007v-El; Wed, 27 Sep 2023 10:48:25 +0000 Received: from [15.248.2.159] (helo=[10.24.67.27]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qlS5h-0005uH-92; Wed, 27 Sep 2023 10:48:25 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=8NbhY/7bO6QFbd/8bdAUIDcE3hm36e7grSYaoGNBZu8=; b=1+3u3UJ+hbVRkmeBE/8kSjFCWA 1molvidbarAbHZjw07Ee7n3qjfil2vPa8zj49QTo9fhE2Wy/N8U67WFb6rGKc+URDTLhL3h8qP1Ug xW9HZZJIP74MTVjCWKMQ+ebGBxQjr2hck7ASiHIiCmeqPbYExHjSc2oiKiB1WS9yG/h8=; Message-ID: <73f0c7c5-8a35-47df-a1ab-dfe784fed3d9@xen.org> Date: Wed, 27 Sep 2023 11:48:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] xen/arm: Skip memory nodes if not enabled Content-Language: en-GB To: Leo Yan , xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk References: <20230926053333.180811-1-leo.yan@linaro.org> From: Julien Grall In-Reply-To: <20230926053333.180811-1-leo.yan@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Leo, Adding some comments on top of what already said. On 26/09/2023 06:33, Leo Yan wrote: > +static bool __init memory_node_is_available(const void *fdt, unsigned long node) > +{ > + const char *status = fdt_getprop(fdt, node, "status", NULL); > + > + if (!status) > + return true; > + We have a similar implement based on the unflatten DT (see dt_device_is_available()). While trying to consolidate them is probably not worth it, I think the behavior should match. In this case, you want to check the len is greater than 0 before doing the comparison. Cheers, -- Julien Grall