From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:60454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goTSp-0000La-V3 for qemu-devel@nongnu.org; Tue, 29 Jan 2019 08:30:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goTSk-0000SJ-GG for qemu-devel@nongnu.org; Tue, 29 Jan 2019 08:30:07 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1goTSk-0000Rl-5p for qemu-devel@nongnu.org; Tue, 29 Jan 2019 08:30:02 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0TDRJnb125533 for ; Tue, 29 Jan 2019 08:30:00 -0500 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qaqj08x1d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 29 Jan 2019 08:29:48 -0500 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 Jan 2019 13:29:41 -0000 From: "Jason J. Herne" Date: Tue, 29 Jan 2019 08:29:16 -0500 In-Reply-To: <1548768562-20007-1-git-send-email-jjherne@linux.ibm.com> References: <1548768562-20007-1-git-send-email-jjherne@linux.ibm.com> Message-Id: <1548768562-20007-10-git-send-email-jjherne@linux.ibm.com> Subject: [Qemu-devel] [PATCH 09/15] s390-bios: ptr2u32 and u32toptr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com, pasic@linux.ibm.com, alifm@linux.ibm.com, borntraeger@de.ibm.com Introduce inline functions to convert between pointers and unsigned 32-bit ints. These are used to hide the ugliness required to avoid compiler warnings. Signed-off-by: Jason J. Herne --- pc-bios/s390-ccw/libc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pc-bios/s390-ccw/libc.h b/pc-bios/s390-ccw/libc.h index 818517f..e198f0b 100644 --- a/pc-bios/s390-ccw/libc.h +++ b/pc-bios/s390-ccw/libc.h @@ -19,6 +19,18 @@ typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; +/* Avoids compiler warnings when casting a pointer to a u32 */ +static inline uint32_t ptr2u32(void *ptr) +{ + return (uint32_t)(uint64_t)ptr; +} + +/* Avoids compiler warnings when casting a u32 to a pointer */ +static inline void *u32toptr(uint32_t n) +{ + return (void *)(uint64_t)n; +} + static inline void *memset(void *s, int c, size_t n) { size_t i; -- 2.7.4