* [PATCH 35/37] 9p: use get/put_endian helpers
@ 2008-05-29 20:19 Harvey Harrison
0 siblings, 0 replies; only message in thread
From: Harvey Harrison @ 2008-05-29 20:19 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-arch
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
net/9p/conv.c | 14 +++++++-------
net/9p/trans_fd.c | 2 +-
net/9p/trans_virtio.c | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/net/9p/conv.c b/net/9p/conv.c
index 4454720..e9a21ce 100644
--- a/net/9p/conv.c
+++ b/net/9p/conv.c
@@ -92,7 +92,7 @@ static void buf_put_int8(struct cbuf *buf, u8 val)
static void buf_put_int16(struct cbuf *buf, u16 val)
{
if (buf_check_size(buf, 2)) {
- *(__le16 *) buf->p = cpu_to_le16(val);
+ put_le16(val, (__le16 *)buf->p);
buf->p += 2;
}
}
@@ -100,7 +100,7 @@ static void buf_put_int16(struct cbuf *buf, u16 val)
static void buf_put_int32(struct cbuf *buf, u32 val)
{
if (buf_check_size(buf, 4)) {
- *(__le32 *)buf->p = cpu_to_le32(val);
+ put_le32(val, (__le32 *)buf->p);
buf->p += 4;
}
}
@@ -108,7 +108,7 @@ static void buf_put_int32(struct cbuf *buf, u32 val)
static void buf_put_int64(struct cbuf *buf, u64 val)
{
if (buf_check_size(buf, 8)) {
- *(__le64 *)buf->p = cpu_to_le64(val);
+ put_le64(val, (__le64 *)buf->p);
buf->p += 8;
}
}
@@ -145,7 +145,7 @@ static u16 buf_get_int16(struct cbuf *buf)
u16 ret = 0;
if (buf_check_size(buf, 2)) {
- ret = le16_to_cpu(*(__le16 *)buf->p);
+ ret = get_le16((__le16 *)buf->p);
buf->p += 2;
}
@@ -157,7 +157,7 @@ static u32 buf_get_int32(struct cbuf *buf)
u32 ret = 0;
if (buf_check_size(buf, 4)) {
- ret = le32_to_cpu(*(__le32 *)buf->p);
+ ret = get_le32((__le32 *)buf->p);
buf->p += 4;
}
@@ -169,7 +169,7 @@ static u64 buf_get_int64(struct cbuf *buf)
u64 ret = 0;
if (buf_check_size(buf, 8)) {
- ret = le64_to_cpu(*(__le64 *)buf->p);
+ ret = get_le64((__le64 *)buf->p);
buf->p += 8;
}
@@ -520,7 +520,7 @@ p9_create_common(struct cbuf *bufp, u32 size, u8 id)
void p9_set_tag(struct p9_fcall *fc, u16 tag)
{
fc->tag = tag;
- *(__le16 *) (fc->sdata + 5) = cpu_to_le16(tag);
+ put_le16(tag, (__le16 *)(fc->sdata + 5));
}
EXPORT_SYMBOL(p9_set_tag);
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 4507f74..df2ba92 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -771,7 +771,7 @@ static void p9_read_work(struct work_struct *work)
m->rpos += err;
while (m->rpos > 4) {
- n = le32_to_cpu(*(__le32 *) m->rbuf);
+ n = get_le32((__le32 *)m->rbuf);
if (n >= m->msize) {
P9_DPRINTK(P9_DEBUG_ERROR,
"requested packet size too big: %d\n", n);
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 42adc05..240603d 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -339,7 +339,7 @@ p9_virtio_rpc(struct p9_trans *t, struct p9_fcall *tc, struct p9_fcall **rc)
wait_event(*req->wq, req->status == REQ_STATUS_RCVD);
- size = le32_to_cpu(*(__le32 *) rdata);
+ size = get_le32((__le32 *)rdata);
err = p9_deserialize_fcall(rdata, size, *rc, t->extended);
if (err < 0) {
--
1.5.6.rc0.277.g804cf
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-05-29 20:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 20:19 [PATCH 35/37] 9p: use get/put_endian helpers Harvey Harrison
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox