From a038764fc884f61dc78c9225167ff4dafd4dbfab Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Mon, 20 Feb 2006 21:50:39 -0800 Subject: [PATCH] --- yaml --- r: 21935 b: refs/heads/master c: 44af79f9524c29d6850591cc972f2667a27234d4 h: refs/heads/master i: 21933: bc6b1f793bdfbb2efbcfb63390f7529454da59ca 21931: b82111c8e86079431064544afc5c35ce543f8850 21927: 5ded1071540292ca4b64a954f8ac09d615f80b82 21919: 51358f9b0e35b441be2d7753797004b525826896 v: v3 --- [refs] | 2 +- trunk/drivers/infiniband/ulp/ipoib/ipoib.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 494a40c5a1fc..0db49cd98910 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4d9781c5ce1a517a07dbf03c37323c011037fe79 +refs/heads/master: 44af79f9524c29d6850591cc972f2667a27234d4 diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib.h b/trunk/drivers/infiniband/ulp/ipoib/ipoib.h index 2f85a9a831b1..638eff745b2f 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib.h @@ -217,10 +217,16 @@ struct ipoib_neigh { struct list_head list; }; +/* + * We stash a pointer to our private neighbour information after our + * hardware address in neigh->ha. The ALIGN() expression here makes + * sure that this pointer is stored aligned so that an unaligned + * load is not needed to dereference it. + */ static inline struct ipoib_neigh **to_ipoib_neigh(struct neighbour *neigh) { - return (struct ipoib_neigh **) (neigh->ha + 24 - - (offsetof(struct neighbour, ha) & 4)); + return (void*) neigh + ALIGN(offsetof(struct neighbour, ha) + + INFINIBAND_ALEN, sizeof(void *)); } extern struct workqueue_struct *ipoib_workqueue;