lkml.org 
[lkml]   [2008]   [Apr]   [27]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 27 Apr 2008 06:40:21 +0100
FromAl Viro <>
Subject[PATCH] tipc endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 net/tipc/msg.h |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 6ad070d..ad487e8 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -70,10 +70,9 @@ static inline void msg_set_bits(struct tipc_msg *m, u32 w,
 				u32 pos, u32 mask, u32 val)
 {
 	val = (val & mask) << pos;
-	val = htonl(val);
-	mask = htonl(mask << pos);
-	m->hdr[w] &= ~mask;
-	m->hdr[w] |= val;
+	mask = mask << pos;
+	m->hdr[w] &= ~htonl(mask);
+	m->hdr[w] |= htonl(val);
 }
 
 /*
-- 
1.5.3.GIT


\
 
 \ /
  Last update: 2008-04-27 07:43    [from the cache]
©2003-2008