Skip to content

Commit 497677a

Browse files
Hal RosenstockLinus Torvalds
authored andcommitted
[PATCH] IB: A couple of IB core bug fixes
Replace be32_to_cpup with be32_to_cpu and fix bug referencing pointer rather than value in ib_create_ah_from_wc(). Signed-off-by: Tom Duffy <[email protected]> Signed-off-by: Sean Hefty <[email protected]> Signed-off-by: Hal Rosenstock <[email protected]> Cc: Roland Dreier <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 513789e commit 497677a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/infiniband/core/agent.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ static int agent_mad_send(struct ib_mad_agent *mad_agent,
156156
/* Should sgid be looked up ? */
157157
ah_attr.grh.sgid_index = 0;
158158
ah_attr.grh.hop_limit = grh->hop_limit;
159-
ah_attr.grh.flow_label = be32_to_cpup(
160-
&grh->version_tclass_flow) & 0xfffff;
161-
ah_attr.grh.traffic_class = (be32_to_cpup(
162-
&grh->version_tclass_flow) >> 20) & 0xff;
159+
ah_attr.grh.flow_label = be32_to_cpu(
160+
grh->version_tclass_flow) & 0xfffff;
161+
ah_attr.grh.traffic_class = (be32_to_cpu(
162+
grh->version_tclass_flow) >> 20) & 0xff;
163163
memcpy(ah_attr.grh.dgid.raw,
164164
grh->sgid.raw,
165165
sizeof(ah_attr.grh.dgid));

drivers/infiniband/core/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct ib_ah *ib_create_ah_from_wc(struct ib_pd *pd, struct ib_wc *wc,
113113
return ERR_PTR(ret);
114114

115115
ah_attr.grh.sgid_index = (u8) gid_index;
116-
flow_class = be32_to_cpu(&grh->version_tclass_flow);
116+
flow_class = be32_to_cpu(grh->version_tclass_flow);
117117
ah_attr.grh.flow_label = flow_class & 0xFFFFF;
118118
ah_attr.grh.traffic_class = (flow_class >> 20) & 0xFF;
119119
ah_attr.grh.hop_limit = grh->hop_limit;

0 commit comments

Comments
 (0)