From: Jan Beulich Date: Fri, 5 Apr 2019 08:15:10 +0000 (+0200) Subject: x86/mm: drop redundant local variable from _get_page_type() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2394 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a668d7d29c7e5104ad9c1e4c8d5fcd381083437c;p=xen.git x86/mm: drop redundant local variable from _get_page_type() Instead of the separate iommu_ret, the general rc can be used even for the IOMMU operations. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index a88cd9ce7c..45fadbab61 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2813,7 +2813,7 @@ static int _get_page_type(struct page_info *page, unsigned long type, bool preemptible) { unsigned long nx, x, y = page->u.inuse.type_info; - int rc = 0, iommu_ret = 0; + int rc = 0; ASSERT(!(type & ~(PGT_type_mask | PGT_pae_xen_l2))); ASSERT(!in_irq()); @@ -2925,18 +2925,14 @@ static int _get_page_type(struct page_info *page, unsigned long type, mfn_t mfn = page_to_mfn(page); if ( (x & PGT_type_mask) == PGT_writable_page ) - iommu_ret = iommu_legacy_unmap(d, _dfn(mfn_x(mfn)), - PAGE_ORDER_4K); + rc = iommu_legacy_unmap(d, _dfn(mfn_x(mfn)), PAGE_ORDER_4K); else if ( type == PGT_writable_page ) - iommu_ret = iommu_legacy_map(d, _dfn(mfn_x(mfn)), mfn, - PAGE_ORDER_4K, - IOMMUF_readable | - IOMMUF_writable); + rc = iommu_legacy_map(d, _dfn(mfn_x(mfn)), mfn, PAGE_ORDER_4K, + IOMMUF_readable | IOMMUF_writable); - if ( unlikely(iommu_ret) ) + if ( unlikely(rc) ) { _put_page_type(page, false, NULL); - rc = iommu_ret; goto out; } }