aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2008-03-28 23:10:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-30 17:20:24 -0400
commit1b90c137cc2a0e9b813a8ae316827c493c664146 (patch)
tree2ca251f9875e44f02011bbd0b560ba384262398b /drivers
parenta4e6d5d3817ebae167e78e5957cd9e624be200c7 (diff)
trivial endianness annotations: infiniband core
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/addr.c8
-rw-r--r--drivers/infiniband/core/cm.c2
-rw-r--r--drivers/infiniband/core/cma.c24
3 files changed, 17 insertions, 17 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index a58ad8a470f9..781ea5950373 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -154,7 +154,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in)
154{ 154{
155 struct rtable *rt; 155 struct rtable *rt;
156 struct flowi fl; 156 struct flowi fl;
157 u32 dst_ip = dst_in->sin_addr.s_addr; 157 __be32 dst_ip = dst_in->sin_addr.s_addr;
158 158
159 memset(&fl, 0, sizeof fl); 159 memset(&fl, 0, sizeof fl);
160 fl.nl_u.ip4_u.daddr = dst_ip; 160 fl.nl_u.ip4_u.daddr = dst_ip;
@@ -169,8 +169,8 @@ static int addr_resolve_remote(struct sockaddr_in *src_in,
169 struct sockaddr_in *dst_in, 169 struct sockaddr_in *dst_in,
170 struct rdma_dev_addr *addr) 170 struct rdma_dev_addr *addr)
171{ 171{
172 u32 src_ip = src_in->sin_addr.s_addr; 172 __be32 src_ip = src_in->sin_addr.s_addr;
173 u32 dst_ip = dst_in->sin_addr.s_addr; 173 __be32 dst_ip = dst_in->sin_addr.s_addr;
174 struct flowi fl; 174 struct flowi fl;
175 struct rtable *rt; 175 struct rtable *rt;
176 struct neighbour *neigh; 176 struct neighbour *neigh;
@@ -257,7 +257,7 @@ static int addr_resolve_local(struct sockaddr_in *src_in,
257 struct rdma_dev_addr *addr) 257 struct rdma_dev_addr *addr)
258{ 258{
259 struct net_device *dev; 259 struct net_device *dev;
260 u32 src_ip = src_in->sin_addr.s_addr; 260 __be32 src_ip = src_in->sin_addr.s_addr;
261 __be32 dst_ip = dst_in->sin_addr.s_addr; 261 __be32 dst_ip = dst_in->sin_addr.s_addr;
262 int ret; 262 int ret;
263 263
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 4df405157086..faa7ce318a6d 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -393,7 +393,7 @@ static int cm_alloc_id(struct cm_id_private *cm_id_priv)
393 spin_unlock_irqrestore(&cm.lock, flags); 393 spin_unlock_irqrestore(&cm.lock, flags);
394 } while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) ); 394 } while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) );
395 395
396 cm_id_priv->id.local_id = (__force __be32) (id ^ cm.random_id_operand); 396 cm_id_priv->id.local_id = (__force __be32)id ^ cm.random_id_operand;
397 return ret; 397 return ret;
398} 398}
399 399
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 34507daaf9b6..d81c156a22b4 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -168,15 +168,15 @@ struct cma_work {
168union cma_ip_addr { 168union cma_ip_addr {
169 struct in6_addr ip6; 169 struct in6_addr ip6;
170 struct { 170 struct {
171 __u32 pad[3]; 171 __be32 pad[3];
172 __u32 addr; 172 __be32 addr;
173 } ip4; 173 } ip4;
174}; 174};
175 175
176struct cma_hdr { 176struct cma_hdr {
177 u8 cma_version; 177 u8 cma_version;
178 u8 ip_version; /* IP version: 7:4 */ 178 u8 ip_version; /* IP version: 7:4 */
179 __u16 port; 179 __be16 port;
180 union cma_ip_addr src_addr; 180 union cma_ip_addr src_addr;
181 union cma_ip_addr dst_addr; 181 union cma_ip_addr dst_addr;
182}; 182};
@@ -186,8 +186,8 @@ struct sdp_hh {
186 u8 sdp_version; /* Major version: 7:4 */ 186 u8 sdp_version; /* Major version: 7:4 */
187 u8 ip_version; /* IP version: 7:4 */ 187 u8 ip_version; /* IP version: 7:4 */
188 u8 sdp_specific1[10]; 188 u8 sdp_specific1[10];
189 __u16 port; 189 __be16 port;
190 __u16 sdp_specific2; 190 __be16 sdp_specific2;
191 union cma_ip_addr src_addr; 191 union cma_ip_addr src_addr;
192 union cma_ip_addr dst_addr; 192 union cma_ip_addr dst_addr;
193}; 193};
@@ -663,7 +663,7 @@ static inline int cma_any_port(struct sockaddr *addr)
663} 663}
664 664
665static int cma_get_net_info(void *hdr, enum rdma_port_space ps, 665static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
666 u8 *ip_ver, __u16 *port, 666 u8 *ip_ver, __be16 *port,
667 union cma_ip_addr **src, union cma_ip_addr **dst) 667 union cma_ip_addr **src, union cma_ip_addr **dst)
668{ 668{
669 switch (ps) { 669 switch (ps) {
@@ -695,7 +695,7 @@ static int cma_get_net_info(void *hdr, enum rdma_port_space ps,
695 695
696static void cma_save_net_info(struct rdma_addr *addr, 696static void cma_save_net_info(struct rdma_addr *addr,
697 struct rdma_addr *listen_addr, 697 struct rdma_addr *listen_addr,
698 u8 ip_ver, __u16 port, 698 u8 ip_ver, __be16 port,
699 union cma_ip_addr *src, union cma_ip_addr *dst) 699 union cma_ip_addr *src, union cma_ip_addr *dst)
700{ 700{
701 struct sockaddr_in *listen4, *ip4; 701 struct sockaddr_in *listen4, *ip4;
@@ -996,7 +996,7 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id,
996 struct rdma_cm_id *id; 996 struct rdma_cm_id *id;
997 struct rdma_route *rt; 997 struct rdma_route *rt;
998 union cma_ip_addr *src, *dst; 998 union cma_ip_addr *src, *dst;
999 __u16 port; 999 __be16 port;
1000 u8 ip_ver; 1000 u8 ip_ver;
1001 1001
1002 if (cma_get_net_info(ib_event->private_data, listen_id->ps, 1002 if (cma_get_net_info(ib_event->private_data, listen_id->ps,
@@ -1043,7 +1043,7 @@ static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id,
1043 struct rdma_id_private *id_priv; 1043 struct rdma_id_private *id_priv;
1044 struct rdma_cm_id *id; 1044 struct rdma_cm_id *id;
1045 union cma_ip_addr *src, *dst; 1045 union cma_ip_addr *src, *dst;
1046 __u16 port; 1046 __be16 port;
1047 u8 ip_ver; 1047 u8 ip_ver;
1048 int ret; 1048 int ret;
1049 1049
@@ -1165,7 +1165,7 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
1165{ 1165{
1166 struct cma_hdr *cma_data, *cma_mask; 1166 struct cma_hdr *cma_data, *cma_mask;
1167 struct sdp_hh *sdp_data, *sdp_mask; 1167 struct sdp_hh *sdp_data, *sdp_mask;
1168 __u32 ip4_addr; 1168 __be32 ip4_addr;
1169 struct in6_addr ip6_addr; 1169 struct in6_addr ip6_addr;
1170 1170
1171 memset(compare, 0, sizeof *compare); 1171 memset(compare, 0, sizeof *compare);
@@ -1181,12 +1181,12 @@ static void cma_set_compare_data(enum rdma_port_space ps, struct sockaddr *addr,
1181 sdp_set_ip_ver(sdp_data, 4); 1181 sdp_set_ip_ver(sdp_data, 4);
1182 sdp_set_ip_ver(sdp_mask, 0xF); 1182 sdp_set_ip_ver(sdp_mask, 0xF);
1183 sdp_data->dst_addr.ip4.addr = ip4_addr; 1183 sdp_data->dst_addr.ip4.addr = ip4_addr;
1184 sdp_mask->dst_addr.ip4.addr = ~0; 1184 sdp_mask->dst_addr.ip4.addr = htonl(~0);
1185 } else { 1185 } else {
1186 cma_set_ip_ver(cma_data, 4); 1186 cma_set_ip_ver(cma_data, 4);
1187 cma_set_ip_ver(cma_mask, 0xF); 1187 cma_set_ip_ver(cma_mask, 0xF);
1188 cma_data->dst_addr.ip4.addr = ip4_addr; 1188 cma_data->dst_addr.ip4.addr = ip4_addr;
1189 cma_mask->dst_addr.ip4.addr = ~0; 1189 cma_mask->dst_addr.ip4.addr = htonl(~0);
1190 } 1190 }
1191 break; 1191 break;
1192 case AF_INET6: 1192 case AF_INET6: