From patchwork Fri Feb 19 15:58:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 585261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8760614076A for ; Sat, 20 Feb 2016 02:58:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946093AbcBSP6p (ORCPT ); Fri, 19 Feb 2016 10:58:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56790 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946111AbcBSP6n (ORCPT ); Fri, 19 Feb 2016 10:58:43 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id AB80691FE5; Fri, 19 Feb 2016 15:58:43 +0000 (UTC) Received: from hawk.localdomain.com (dhcp-1-251.brq.redhat.com [10.34.1.251]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JFwWkC002316; Fri, 19 Feb 2016 10:58:41 -0500 From: Andrew Jones To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: thuth@redhat.com, dgibson@redhat.com, david@gibson.dropbear.id.au, agraf@suse.de, lvivier@redhat.com, pbonzini@redhat.com, rkrcmar@redhat.com Subject: [kvm-unit-tests PATCH v6 03/18] lib: asm-generic: add missing casts Date: Fri, 19 Feb 2016 16:58:08 +0100 Message-Id: <1455897503-11835-4-git-send-email-drjones@redhat.com> In-Reply-To: <1455897503-11835-1-git-send-email-drjones@redhat.com> References: <1455897503-11835-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Signed-off-by: Andrew Jones Reviewed-by: David Gibson Tested-by: Laurent Vivier --- lib/asm-generic/io.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index a9939d3a5921f..931415a465b74 100644 --- a/lib/asm-generic/io.h +++ b/lib/asm-generic/io.h @@ -104,27 +104,27 @@ static inline u64 __bswap64(u64 x) #endif #define le16_to_cpu(x) \ - ({ u16 __r = __cpu_is_be() ? __bswap16(x) : (x); __r; }) + ({ u16 __r = __cpu_is_be() ? __bswap16(x) : ((u16)x); __r; }) #define cpu_to_le16 le16_to_cpu #define le32_to_cpu(x) \ - ({ u32 __r = __cpu_is_be() ? __bswap32(x) : (x); __r; }) + ({ u32 __r = __cpu_is_be() ? __bswap32(x) : ((u32)x); __r; }) #define cpu_to_le32 le32_to_cpu #define le64_to_cpu(x) \ - ({ u64 __r = __cpu_is_be() ? __bswap64(x) : (x); __r; }) + ({ u64 __r = __cpu_is_be() ? __bswap64(x) : ((u64)x); __r; }) #define cpu_to_le64 le64_to_cpu #define be16_to_cpu(x) \ - ({ u16 __r = !__cpu_is_be() ? __bswap16(x) : (x); __r; }) + ({ u16 __r = !__cpu_is_be() ? __bswap16(x) : ((u16)x); __r; }) #define cpu_to_be16 be16_to_cpu #define be32_to_cpu(x) \ - ({ u32 __r = !__cpu_is_be() ? __bswap32(x) : (x); __r; }) + ({ u32 __r = !__cpu_is_be() ? __bswap32(x) : ((u32)x); __r; }) #define cpu_to_be32 be32_to_cpu #define be64_to_cpu(x) \ - ({ u64 __r = !__cpu_is_be() ? __bswap64(x) : (x); __r; }) + ({ u64 __r = !__cpu_is_be() ? __bswap64(x) : ((u64)x); __r; }) #define cpu_to_be64 be64_to_cpu #ifndef rmb