From nobody Fri Nov 29 18:50:43 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1632853447; cv=none; d=zohomail.com; s=zohoarc; b=AK7RUF45rQwG2oe5Dzi7L4AyyYmKxWIuvYL4DMXxGwJXKIu4OzZ+1fES2A9jGmS00t0nHA8aKQn1hoHcnstoY3qb0hkUgETra1YrA7Nfimdanxh5XiZdiZOG+L+1JmcSXZRKUZfMTkwjRWC8H7YBnZ5mvu4Z9QFNBGQo5VNYDUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632853447; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iXipVHA7HDBxHYsFQ8A47J68c7im5DD1EeD2KWkQL+g=; b=OnxVtOg2leeiqcJf7QyRyr1Q/qx2uAdluWQXhaZJIBx2I7Xjna49TWKuushYB/J4rcnAPBOERIbgGQKrLcoXpaAAZveg+dPOUILchfyzZEHM7uuFTLZlnlszaX3ZgbtZDjho4uiIQEtoC42LQx5ylDO9sBQc35C8YhPf2Sp6UCQ= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1632853447206560.3492921766317; Tue, 28 Sep 2021 11:24:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.198309.351740 (Exim 4.92) (envelope-from ) id 1mVHlj-0007fz-FD; Tue, 28 Sep 2021 18:23:55 +0000 Received: by outflank-mailman (output) from mailman id 198309.351740; Tue, 28 Sep 2021 18:23:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVHlj-0007ez-A1; Tue, 28 Sep 2021 18:23:55 +0000 Received: by outflank-mailman (input) for mailman id 198309; Tue, 28 Sep 2021 18:23:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mVHlh-0007E1-Uc for xen-devel@lists.xenproject.org; Tue, 28 Sep 2021 18:23:53 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [170.10.133.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 3796cc6f-2089-11ec-bcc4-12813bfff9fa; Tue, 28 Sep 2021 18:23:45 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-440-5NJ-y1XEOa2GaoLjlra03g-1; Tue, 28 Sep 2021 14:23:44 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8A7EA40C6; Tue, 28 Sep 2021 18:23:41 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.194.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id A78BE60877; Tue, 28 Sep 2021 18:23:22 +0000 (UTC) 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" X-Inumbo-ID: 3796cc6f-2089-11ec-bcc4-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632853425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iXipVHA7HDBxHYsFQ8A47J68c7im5DD1EeD2KWkQL+g=; b=LpJTz1uGsziiZ185xv3fNcqHaXbhuTXq0cAUbF6brEUYvl4hrhukpgOC+EQjvTX3IZYCz9 KZl5xw2TPg8ePtcTRu3FsSFyzXPu+rAL0hyAB6rPbFjqetroq+H57YxDn9h9Axf9hlfuxP RyB4vH39NI3QkpnP+7/TOWxmdoW+Aac= X-MC-Unique: 5NJ-y1XEOa2GaoLjlra03g-1 From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: David Hildenbrand , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Michael S. Tsirkin" , Jason Wang , Dave Young , Baoquan He , Vivek Goyal , Michal Hocko , Oscar Salvador , Mike Rapoport , "Rafael J. Wysocki" , x86@kernel.org, xen-devel@lists.xenproject.org, virtualization@lists.linux-foundation.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v1 2/8] x86/xen: simplify xen_oldmem_pfn_is_ram() Date: Tue, 28 Sep 2021 20:22:52 +0200 Message-Id: <20210928182258.12451-3-david@redhat.com> In-Reply-To: <20210928182258.12451-1-david@redhat.com> References: <20210928182258.12451-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1632853449284100001 Content-Type: text/plain; charset="utf-8" Let's simplify return handling. Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index b242d1f4b426..eb61622df75b 100644 --- a/arch/x86/xen/mmu_hvm.c +++ b/arch/x86/xen/mmu_hvm.c @@ -21,23 +21,16 @@ static int xen_oldmem_pfn_is_ram(unsigned long pfn) .domid =3D DOMID_SELF, .pfn =3D pfn, }; - int ram; =20 if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a)) return -ENXIO; =20 switch (a.mem_type) { case HVMMEM_mmio_dm: - ram =3D 0; - break; - case HVMMEM_ram_rw: - case HVMMEM_ram_ro: + return 0; default: - ram =3D 1; - break; + return 1; } - - return ram; } #endif =20 --=20 2.31.1