summaryrefslogtreecommitdiff
path: root/fs/ceph/decode.h
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2010-06-11 23:58:48 (GMT)
committerSage Weil <sage@newdream.net>2010-08-02 03:11:40 (GMT)
commitcd84db6e4051a9fb7941d49d31a0193a3371fd61 (patch)
treebeb657b2cc6b4184d97a85502b29a291616a83ab /fs/ceph/decode.h
parentca81f3f6bd759f90a4b940cddda1f8bc61a7725a (diff)
downloadlinux-fsl-qoriq-cd84db6e4051a9fb7941d49d31a0193a3371fd61.tar.xz
ceph: code cleanup
Mainly fixing minor issues reported by sparse. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/decode.h')
-rw-r--r--fs/ceph/decode.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ceph/decode.h b/fs/ceph/decode.h
index 65b3e02..3d25415 100644
--- a/fs/ceph/decode.h
+++ b/fs/ceph/decode.h
@@ -99,11 +99,13 @@ static inline void ceph_encode_timespec(struct ceph_timespec *tv,
*/
static inline void ceph_encode_addr(struct ceph_entity_addr *a)
{
- a->in_addr.ss_family = htons(a->in_addr.ss_family);
+ __be16 ss_family = htons(a->in_addr.ss_family);
+ a->in_addr.ss_family = *(__u16 *)&ss_family;
}
static inline void ceph_decode_addr(struct ceph_entity_addr *a)
{
- a->in_addr.ss_family = ntohs(a->in_addr.ss_family);
+ __be16 ss_family = *(__be16 *)&a->in_addr.ss_family;
+ a->in_addr.ss_family = ntohs(ss_family);
WARN_ON(a->in_addr.ss_family == 512);
}