From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Peter Maydell Date: Thu, 7 Jul 2016 17:20:56 +0100 Message-Id: <1467908460-27048-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1467908460-27048-1-git-send-email-peter.maydell@linaro.org> References: <1467908460-27048-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v2 1/5] fsdev/9p-iov-marshal.c: Don't use cpu_to_*w() functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org 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; -- 1.9.1