From nobody Fri May 17 09:38:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1645643346; cv=none; d=zohomail.com; s=zohoarc; b=hw5juKnG6Luwvb5eryXxRCJmMO7cZNScIl4TYYXA+YSL31wc7BVWxWf1ysqltGjYVQZrjqLPxPjHj52Fp5F81T/6siQik6GNn45tg2ryB7fdWmUARmbhwIOl4TVY5T9dgl9Gg5ge/bGu+aa4fwuw3gcwc5FCxZKmeVkyX7/wbaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645643346; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ms66EeFpnDlrLxveB85xTVbo3f8VYA2lVaSo3C96Zkc=; b=BqqJnf5J1Bwt9Ly1B1+Eo+wO5w3rRthLIA2OP3y90Nk9uUw9qtcZmqdAhczLuniTB1G/zFwaGSKSG/j5PZuubkZgvN8jNWyq3mARS8gREb9eLQZ9rf0olViOILcr3MDPpZWaEVtbOE3IHuWMUWt3+sPWbQ3u06iCOgMjE+dma2o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1645643346043189.876980481931; Wed, 23 Feb 2022 11:09:06 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.277755.474572 (Exim 4.92) (envelope-from ) id 1nMx09-000418-5F; Wed, 23 Feb 2022 19:08:37 +0000 Received: by outflank-mailman (output) from mailman id 277755.474572; Wed, 23 Feb 2022 19:08:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nMx09-000411-2O; Wed, 23 Feb 2022 19:08:37 +0000 Received: by outflank-mailman (input) for mailman id 277755; Wed, 23 Feb 2022 19:08:35 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nMx07-00040v-NW for xen-devel@lists.xenproject.org; Wed, 23 Feb 2022 19:08:35 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nMx07-0008S9-ML; Wed, 23 Feb 2022 19:08:35 +0000 Received: from 54-240-197-232.amazon.com ([54.240.197.232] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nMx07-0002xC-DE; Wed, 23 Feb 2022 19:08:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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:MIME-Version:Message-Id:Date: Subject:Cc:To:From; bh=ms66EeFpnDlrLxveB85xTVbo3f8VYA2lVaSo3C96Zkc=; b=af0ZqY zr4NI5IHb3MKBxe8s6LSrQ1XyhnsTgXN/Uff88qARXBwTkw49ILRlVC9Q8JuK9mX/OhMl3NPSQTA8 b62TTssQZV5S8o0+XaJapUjaH3W9Tq6/DS/pLdmCeMHn1jpgh/YoeSMMDGsw3J0+manMydS+GLirZ yUj6F1hDNg8=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall Subject: [PATCH v2] xen/mm: pg_offlined can be defined as bool in free_heap_pages() Date: Wed, 23 Feb 2022 19:08:33 +0000 Message-Id: <20220223190833.24710-1-julien@xen.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1645643348571100001 Content-Type: text/plain; charset="utf-8" From: Julien Grall The local variable pg_offlined in free_heap_pages() can only take two values. So switch it to a bool. Signed-off-by: Julien Grall --- Changes in v2: - pg_offlined should be initialized to false rather than true --- xen/common/page_alloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index e971bf91e0be..319029140f30 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1437,8 +1437,9 @@ static void free_heap_pages( { unsigned long mask; mfn_t mfn =3D page_to_mfn(pg); - unsigned int i, node =3D phys_to_nid(mfn_to_maddr(mfn)), pg_offlined = =3D 0; + unsigned int i, node =3D phys_to_nid(mfn_to_maddr(mfn)); unsigned int zone =3D page_to_zone(pg); + bool pg_offlined =3D false; =20 ASSERT(order <=3D MAX_ORDER); =20 @@ -1447,7 +1448,7 @@ static void free_heap_pages( for ( i =3D 0; i < (1 << order); i++ ) { if ( mark_page_free(&pg[i], mfn_add(mfn, i)) ) - pg_offlined =3D 1; + pg_offlined =3D true; =20 if ( need_scrub ) { --=20 2.32.0