From: Harvey Harrison <harvey.harrison@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-arch <linux-arch@vger.kernel.org>
Subject: [PATCH 35/37] 9p: use get/put_endian helpers
Date: Thu, 29 May 2008 13:19:13 -0700 [thread overview]
Message-ID: <1212092353.28403.137.camel@brick> (raw)
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
reply other threads:[~2008-05-29 20:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1212092353.28403.137.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-arch@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox