From patchwork Fri May 1 06:41:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 466868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8254A140761 for ; Fri, 1 May 2015 16:42:46 +1000 (AEST) Received: from localhost ([::1]:46950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yo4eq-0001dV-C7 for incoming@patchwork.ozlabs.org; Fri, 01 May 2015 02:42:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yo4e8-0008KP-Sb for qemu-devel@nongnu.org; Fri, 01 May 2015 02:42:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yo4e5-0001Hz-Kc for qemu-devel@nongnu.org; Fri, 01 May 2015 02:42:00 -0400 Received: from ozlabs.org ([103.22.144.67]:56965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yo4e5-0001Hc-A1; Fri, 01 May 2015 02:41:57 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 1052C140783; Fri, 1 May 2015 16:41:52 +1000 (AEST) From: David Gibson To: agraf@suse.de Date: Fri, 1 May 2015 16:41:30 +1000 Message-Id: <1430462510-14195-13-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430462510-14195-1-git-send-email-david@gibson.dropbear.id.au> References: <1430462510-14195-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Cc: Thomas Huth , qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, afaerber@suse.de, David Gibson Subject: [Qemu-devel] [PATCH 12/32] hw/ppc/spapr_iommu: Fix the check for invalid upper bits in liobn X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth The check "liobn & 0xFFFFFFFF00000000ULL" in spapr_tce_find_by_liobn() is completely useless since liobn is only declared as an uint32_t parameter. Fix this by using target_ulong instead (this is what most of the callers of this function are using, too). Signed-off-by: Thomas Huth Signed-off-by: David Gibson --- hw/ppc/spapr_iommu.c | 4 ++-- include/hw/ppc/spapr.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index a14cdc4..8cd9dba 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -41,7 +41,7 @@ enum sPAPRTCEAccess { static QLIST_HEAD(spapr_tce_tables, sPAPRTCETable) spapr_tce_tables; -sPAPRTCETable *spapr_tce_find_by_liobn(uint32_t liobn) +sPAPRTCETable *spapr_tce_find_by_liobn(target_ulong liobn) { sPAPRTCETable *tcet; @@ -52,7 +52,7 @@ sPAPRTCETable *spapr_tce_find_by_liobn(uint32_t liobn) } QLIST_FOREACH(tcet, &spapr_tce_tables, list) { - if (tcet->liobn == liobn) { + if (tcet->liobn == (uint32_t)liobn) { return tcet; } } diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 7d9ab9d..317feb6 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -511,7 +511,7 @@ struct sPAPRTCETable { QLIST_ENTRY(sPAPRTCETable) list; }; -sPAPRTCETable *spapr_tce_find_by_liobn(uint32_t liobn); +sPAPRTCETable *spapr_tce_find_by_liobn(target_ulong liobn); void spapr_events_init(sPAPREnvironment *spapr); void spapr_events_fdt_skel(void *fdt, uint32_t epow_irq); int spapr_h_cas_compose_response(target_ulong addr, target_ulong size);