From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkZqb-0007mE-Ia for qemu-devel@nongnu.org; Tue, 21 Apr 2015 11:12:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkZqa-0002OL-JM for qemu-devel@nongnu.org; Tue, 21 Apr 2015 11:12:25 -0400 From: Thomas Huth Date: Tue, 21 Apr 2015 17:12:11 +0200 Message-Id: <1429629131-23800-1-git-send-email-thuth@redhat.com> Subject: [Qemu-devel] [PATCH v2] hw/ppc/spapr_iommu: Fix the check for invalid upper bits in liobn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de Cc: aik@ozlabs.ru, david@gibson.dropbear.id.au 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 --- v2: - Do not change the hcall_dprintf() into a qemu_log_mask() statement. --- hw/ppc/spapr_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index f3990fd..995f21b 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; -static sPAPRTCETable *spapr_tce_find_by_liobn(uint32_t liobn) +static sPAPRTCETable *spapr_tce_find_by_liobn(target_ulong liobn) { sPAPRTCETable *tcet; @@ -52,7 +52,7 @@ static 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; } } -- 1.8.3.1