提交 b442642d 编写于 作者: P Peter Maydell

fsdev/9p-iov-marshal.c: Don't use cpu_to_*w() functions

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: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-id: 1467908460-27048-2-git-send-email-peter.maydell@linaro.org
上级 b35399bb
...@@ -207,31 +207,25 @@ ssize_t v9fs_iov_vmarshal(struct iovec *in_sg, int in_num, size_t offset, ...@@ -207,31 +207,25 @@ ssize_t v9fs_iov_vmarshal(struct iovec *in_sg, int in_num, size_t offset,
break; break;
} }
case 'w': { case 'w': {
uint16_t val; uint16_t val = va_arg(ap, int);
if (bswap) { if (bswap) {
cpu_to_le16w(&val, va_arg(ap, int)); val = cpu_to_le16(val);
} else {
val = va_arg(ap, int);
} }
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val)); copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
break; break;
} }
case 'd': { case 'd': {
uint32_t val; uint32_t val = va_arg(ap, uint32_t);
if (bswap) { if (bswap) {
cpu_to_le32w(&val, va_arg(ap, uint32_t)); val = cpu_to_le32(val);
} else {
val = va_arg(ap, uint32_t);
} }
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val)); copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
break; break;
} }
case 'q': { case 'q': {
uint64_t val; uint64_t val = va_arg(ap, uint64_t);
if (bswap) { if (bswap) {
cpu_to_le64w(&val, va_arg(ap, uint64_t)); val = cpu_to_le64(val);
} else {
val = va_arg(ap, uint64_t);
} }
copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val)); copied = v9fs_pack(in_sg, in_num, offset, &val, sizeof(val));
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册