From patchwork Tue Mar 4 06:15:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 326161 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 C8B3E2C00B3 for ; Tue, 4 Mar 2014 18:10:07 +1100 (EST) Received: from localhost ([::1]:43378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKiwm-0004J1-8K for incoming@patchwork.ozlabs.org; Tue, 04 Mar 2014 01:35:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKiw5-0004CW-Vt for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:34:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKivw-0007e0-2h for qemu-devel@nongnu.org; Tue, 04 Mar 2014 01:34:41 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:50465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKivv-0007dR-RD; Tue, 04 Mar 2014 01:34:32 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A7E794084F; Tue, 4 Mar 2014 10:34:30 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 2BD0E64F; Tue, 4 Mar 2014 10:16:04 +0400 (MSK) Received: (nullmailer pid 16577 invoked by uid 1000); Tue, 04 Mar 2014 06:16:03 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 4 Mar 2014 10:15:52 +0400 Message-Id: <1393913761-16516-5-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1393913761-16516-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Stefan Weil , Michael Tokarev Subject: [Qemu-devel] [PULL 04/13] bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions) 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: Stefan Weil The functions use uint16_t or uint32_t values, so show this in the function prototypes. Non-optimizing compilers will avoid unnecessary type conversions when generating calls of these inline functions. stq_le_p, stq_be_p already use similar prototypes. Signed-off-by: Stefan Weil Reviewed-by: Laszlo Ersek Signed-off-by: Michael Tokarev --- include/qemu/bswap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 0cc11a5..0cb7c05 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -300,12 +300,12 @@ static inline uint64_t ldq_le_p(const void *ptr) return le_bswap(ldq_p(ptr), 64); } -static inline void stw_le_p(void *ptr, int v) +static inline void stw_le_p(void *ptr, uint16_t v) { stw_p(ptr, le_bswap(v, 16)); } -static inline void stl_le_p(void *ptr, int v) +static inline void stl_le_p(void *ptr, uint32_t v) { stl_p(ptr, le_bswap(v, 32)); } @@ -365,12 +365,12 @@ static inline uint64_t ldq_be_p(const void *ptr) return be_bswap(ldq_p(ptr), 64); } -static inline void stw_be_p(void *ptr, int v) +static inline void stw_be_p(void *ptr, uint16_t v) { stw_p(ptr, be_bswap(v, 16)); } -static inline void stl_be_p(void *ptr, int v) +static inline void stl_be_p(void *ptr, uint32_t v) { stl_p(ptr, be_bswap(v, 32)); }