From patchwork Thu Jul 7 16:20:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9219161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 03CB46048B for ; Thu, 7 Jul 2016 16:25:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E85DA26A64 for ; Thu, 7 Jul 2016 16:25:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCF272832B; Thu, 7 Jul 2016 16:25:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9BD2926A64 for ; Thu, 7 Jul 2016 16:25:45 +0000 (UTC) Received: from localhost ([::1]:41084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLC7U-0004Vb-Of for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Jul 2016 12:25:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLC30-0007js-PB for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:21:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLC2y-0004tv-Gb for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:21:05 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLC2y-0004t9-98 for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:21:04 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bLC2v-0004lC-Eq; Thu, 07 Jul 2016 17:21:01 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 7 Jul 2016 17:20:56 +0100 Message-Id: <1467908460-27048-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467908460-27048-1-git-send-email-peter.maydell@linaro.org> References: <1467908460-27048-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH v2 1/5] fsdev/9p-iov-marshal.c: Don't use cpu_to_*w() functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Don't use the cpu_to_*w() functions, which we are trying to deprecate. Instead just use cpu_to_*() to do the byteswap, which brings the code in the marshal function in line with that in the unmarshal. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake --- fsdev/9p-iov-marshal.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/fsdev/9p-iov-marshal.c b/fsdev/9p-iov-marshal.c index 584082b..663cad5 100644 --- a/fsdev/9p-iov-marshal.c +++ b/fsdev/9p-iov-marshal.c @@ -207,31 +207,25 @@ ssize_t v9fs_iov_vmarshal(struct iovec *in_sg, int in_num, size_t offset, break; } case 'w': { - uint16_t val; + uint16_t val = va_arg(ap, int); if (bswap) { - cpu_to_le16w(&val, va_arg(ap, int)); - } else { - val = va_arg(ap, int); + val = cpu_to_le16(val); } copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val)); break; } case 'd': { - uint32_t val; + uint32_t val = va_arg(ap, uint32_t); if (bswap) { - cpu_to_le32w(&val, va_arg(ap, uint32_t)); - } else { - val = va_arg(ap, uint32_t); + val = cpu_to_le32(val); } copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val)); break; } case 'q': { - uint64_t val; + uint64_t val = va_arg(ap, uint64_t); if (bswap) { - cpu_to_le64w(&val, va_arg(ap, uint64_t)); - } else { - val = va_arg(ap, uint64_t); + val = cpu_to_le64(val); } copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val)); break;