Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5142904pxb; Tue, 28 Sep 2021 11:24:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIZu0YC0zpPcnxSwOR+XcNieTqfRTxkOWjJ6aGGEE9H4SROl+uZo0xg6klywFw6RcqSIu2 X-Received: by 2002:a17:90a:f418:: with SMTP id ch24mr1428757pjb.134.1632853495566; Tue, 28 Sep 2021 11:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632853495; cv=none; d=google.com; s=arc-20160816; b=tOyiRGRmK6tKlEWfxpGdqNPxub9TdpYg5jkBVz9PiLfRsc6cgxkmbgNOLKD/s8W9yB gxVE1DcP0O1/rJQdUr0J4RzRisLslWx6ha6Wj/LZQ2++Th/5HD5EGfV2ZQ50V/cbx8A9 KjxPoGySJhzu/csvUgmA/GnNi/BMzbrmcAmD3OimtkmROidTce4ZuE/5uxREQnOhxsim ywID3d6kR15bNBtceNAkVh9M7TFwDcZkk2Ye8ZdBfSrqaoEejCvUQ65k2mznO/yCVQiK nDRkdrHNfMfCgsrBvxCwQWCgqPYzo/VV82Yrw1YOwYg/Pdp+F+sH+8iM+IevwLYmwLJ5 +Bkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iXipVHA7HDBxHYsFQ8A47J68c7im5DD1EeD2KWkQL+g=; b=xBKuIVuBmIYMLrkISrQo1rTnh3QvKn2OTKBWgTO5K8ypdKoyIJ9JDDLolAR1uxwW78 0qpL3hMF2aiIPUFoNOfUhhE5mspldQJDBD3l1qYLTnXCbl+27Yc8S7KcDjWfR+hXlI+u 8MByulOcXXDF2IIj85ogao7V3Po7AjCv6DXTOJZIia0xWalhn4idGk5qPDrYOwuekNQN 4e+Pb2PabOS9dstJr7Lf1hrVw/clCNv1oBGpYhlW4tNvh+ujF6Y8ct95KicQKIwZqvxn CJSabA/ULguiExJTNPRL+AtZ0+1Ig1vFm8KSbudOsgozG/uP7EvBJpjygy4ofPKCQ+PF Dn/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LpJTz1uG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t189si26112393pfd.132.2021.09.28.11.24.43; Tue, 28 Sep 2021 11:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LpJTz1uG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242346AbhI1SZf (ORCPT + 99 others); Tue, 28 Sep 2021 14:25:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38460 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242312AbhI1SZZ (ORCPT ); Tue, 28 Sep 2021 14:25:25 -0400 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= 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 X-MC-Unique: 5NJ-y1XEOa2GaoLjlra03g-1 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) 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: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = DOMID_SELF, .pfn = pfn, }; - int ram; if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a)) return -ENXIO; switch (a.mem_type) { case HVMMEM_mmio_dm: - ram = 0; - break; - case HVMMEM_ram_rw: - case HVMMEM_ram_ro: + return 0; default: - ram = 1; - break; + return 1; } - - return ram; } #endif -- 2.31.1