From: Jason Gunthorpe <[EMAIL PROTECTED]>

Make the untyped data region in ib_user_mad u64 aligned so that casting
ib_user_mad data to structs with u64s in them is safe on 64 bit platforms.

Note this does not affect the ABI - ib_user_mad format stays the same,
the only effect this has is in how ib_user_mad is placed within larger
kernel-only structures.

Signed-off-by: Jason Gunthorpe <[EMAIL PROTECTED]>
Acked-by: Michael S. Tsirkin <[EMAIL PROTECTED]>

---

Works fine for me, and while this mainly removes an annoying message
from kernel log on ia64, I think this is safe enough to be 2.6.20 material.
Further, compiler has right to assume a structure with a 64 bit field
is naturally aligned on a 64 bit platform, so current code might
thinkably trigger incorrect code to be generated with e.g. memcpy
(never observed this in practice though).

Roland, could you queue this please?

diff --git a/include/rdma/ib_user_mad.h b/include/rdma/ib_user_mad.h
index 44537aa..d66b15e 100644
--- a/include/rdma/ib_user_mad.h
+++ b/include/rdma/ib_user_mad.h
@@ -98,7 +98,7 @@ struct ib_user_mad_hdr {
  */
 struct ib_user_mad {
        struct ib_user_mad_hdr hdr;
-       __u8    data[0];
+       __u64   data[0];
 };
 
 /**


-- 
MST

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to