Quoting Roland Dreier <[EMAIL PROTECTED]>: > Subject: Re: ipoib: question > > > Is this better? > > > > - return (struct ipoib_neigh **) (neigh->ha + 24 - > > - (offsetof(struct neighbour, ha) & > 4)); > > + return (void*)neigh + > > ALIGN(offsetof(struct neighbour, ha) + INFINIBAND_ALEN, x) > > I guess so, with "x" replaced by "sizeof (void *)". > > - R. >
Right, there's also a ; missing - I hope you figured out it wasnt a real patch. The below does compile. Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]> Index: linux-2.6.14/drivers/infiniband/ulp/ipoib/ipoib.h =================================================================== --- linux-2.6.14.orig/drivers/infiniband/ulp/ipoib/ipoib.h 2005-12-16 02:15:55.000000000 +0200 +++ linux-2.6.14/drivers/infiniband/ulp/ipoib/ipoib.h 2005-12-16 02:39:42.000000000 +0200 @@ -219,8 +219,8 @@ struct ipoib_neigh { 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; -- MST _______________________________________________ openib-general mailing list openib-general@openib.org http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general