diff options
author | Michael S. Tsirkin <mst@mellanox.co.il> | 2006-02-21 00:50:39 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-20 13:08:16 -0500 |
commit | 44af79f9524c29d6850591cc972f2667a27234d4 (patch) | |
tree | 8d88bdbd7c3fd015c692792bf1fcd3600ba0c275 /drivers/infiniband | |
parent | 4d9781c5ce1a517a07dbf03c37323c011037fe79 (diff) |
IPoIB: clarify to_ipoib_neigh()
Cosmetic change: make alignment explicit in to_ipoib_neigh.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 2f85a9a831b1..638eff745b2f 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -217,10 +217,16 @@ struct ipoib_neigh { | |||
217 | struct list_head list; | 217 | struct list_head list; |
218 | }; | 218 | }; |
219 | 219 | ||
220 | /* | ||
221 | * We stash a pointer to our private neighbour information after our | ||
222 | * hardware address in neigh->ha. The ALIGN() expression here makes | ||
223 | * sure that this pointer is stored aligned so that an unaligned | ||
224 | * load is not needed to dereference it. | ||
225 | */ | ||
220 | static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh) | 226 | static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh) |
221 | { | 227 | { |
222 | return (struct ipoib_neigh **) (neigh->ha + 24 - | 228 | return (void*) neigh + ALIGN(offsetof(struct neighbour, ha) + |
223 | (offsetof(struct neighbour, ha) & 4)); | 229 | INFINIBAND_ALEN, sizeof(void *)); |
224 | } | 230 | } |
225 | 231 | ||
226 | extern struct workqueue_struct *ipoib_workqueue; | 232 | extern struct workqueue_struct *ipoib_workqueue; |