From nobody Fri Nov 29 06:52:47 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=1645641542; cv=none; d=zohomail.com; s=zohoarc; b=TeGJgI+Qco/og8GDWO2ldc4FmBqzfHVd2wSqk0n/rG8gwFUtedMz3y31x52o7THBRu7hTdxTsFRtPownWabQZbanSzFNdLw+Lq5q4CXDLqcrJp1kyTVEOWqvEHpTL6pYxnWqlHvIIePD16T/F5AQGoJjmOx/nB44oVVfCVD1xMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645641542; 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=db7wQhcHM2KaSYp1tp69mT23OXkzBHsFL2ieMLVezOk=; b=Df/JfwC3iaTDX4pAElbctpthOghtFjypKZb8Wl8hygj6s+SqlVWDEtF8l0flQXkAJOAINWESIOv0JvpUJeyRyz8yekg0GVjxOB2Ow5IVy3ZXJyxtzlr1sVFwhNp5xA9IOOuzpjoM1TSevIwIDUNUd/oRZP9ZMNibYk6xVzGTR/M= 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 1645641542813463.719997866221; Wed, 23 Feb 2022 10:39:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.277702.474496 (Exim 4.92) (envelope-from ) id 1nMwX6-0005bG-2J; Wed, 23 Feb 2022 18:38:36 +0000 Received: by outflank-mailman (output) from mailman id 277702.474496; Wed, 23 Feb 2022 18:38:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nMwX5-0005b9-VE; Wed, 23 Feb 2022 18:38:35 +0000 Received: by outflank-mailman (input) for mailman id 277702; Wed, 23 Feb 2022 18:38:35 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nMwX5-0005b3-6g for xen-devel@lists.xenproject.org; Wed, 23 Feb 2022 18:38:35 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nMwX4-0007sk-Qe; Wed, 23 Feb 2022 18:38:34 +0000 Received: from 54-240-197-224.amazon.com ([54.240.197.224] 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 1nMwX4-00011Z-HL; Wed, 23 Feb 2022 18:38:34 +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=db7wQhcHM2KaSYp1tp69mT23OXkzBHsFL2ieMLVezOk=; b=spwTFC 65CC+Z+WizJsZSAGziIK92DnA031XRMW3/SgHYcZFFZrxZ5eNehyrnW/YVxUtxluUP55QSN9BHvdM +FXdCxks+hM3jMeQyKzxPQagot0AjOtWsaEIMzPCrGiIgHR4QqzFin5HrVRPBCd/7Tst3YMUqVBP3 J0DccSyY/C8=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall , Andrew Cooper , George Dunlap , Jan Beulich , Stefano Stabellini , Wei Liu Subject: [PATCH] xen/mm: Remove always true ASSERT() in free_heap_pages() Date: Wed, 23 Feb 2022 18:38:31 +0000 Message-Id: <20220223183831.5951-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: 1645641543726100001 Content-Type: text/plain; charset="utf-8" From: Julien Grall free_heap_pages() has an ASSERT() checking that node is >=3D 0. However node is defined as an unsigned int. So it cannot be negative. Therefore remove the check as it will always be true. Signed-off-by: Julien Grall Acked-by: Andrew Cooper Acked-by: Jan Beulich --- I have looked at the history. AFAICT, node has always be defined as unsigned int. So the ASSERT() may have never been useful (?). --- xen/common/page_alloc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 46357182375a..e971bf91e0be 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1441,7 +1441,6 @@ static void free_heap_pages( unsigned int zone =3D page_to_zone(pg); =20 ASSERT(order <=3D MAX_ORDER); - ASSERT(node >=3D 0); =20 spin_lock(&heap_lock); =20 --=20 2.32.0