diff options
Diffstat (limited to 'include/linux/sunrpc/xdr.h')
-rw-r--r-- | include/linux/sunrpc/xdr.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index b99c625fddfe..7da466ba4b0d 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -117,17 +117,15 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le | |||
117 | static inline __be32 * | 117 | static inline __be32 * |
118 | xdr_encode_hyper(__be32 *p, __u64 val) | 118 | xdr_encode_hyper(__be32 *p, __u64 val) |
119 | { | 119 | { |
120 | *p++ = htonl(val >> 32); | 120 | *(__be64 *)p = cpu_to_be64(val); |
121 | *p++ = htonl(val & 0xFFFFFFFF); | 121 | return p + 2; |
122 | return p; | ||
123 | } | 122 | } |
124 | 123 | ||
125 | static inline __be32 * | 124 | static inline __be32 * |
126 | xdr_decode_hyper(__be32 *p, __u64 *valp) | 125 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
127 | { | 126 | { |
128 | *valp = ((__u64) ntohl(*p++)) << 32; | 127 | *valp = be64_to_cpup((__be64 *)p); |
129 | *valp |= ntohl(*p++); | 128 | return p + 2; |
130 | return p; | ||
131 | } | 129 | } |
132 | 130 | ||
133 | /* | 131 | /* |