On Thu, Jun 16, 2011 at 2:41 PM, Bernard Metzler <[email protected]> wrote: > --- > drivers/infiniband/hw/siw/iwarp.h | 324 > +++++++++++++++++++++++++++++++++++++ > 1 files changed, 324 insertions(+), 0 deletions(-) > create mode 100644 drivers/infiniband/hw/siw/iwarp.h > > diff --git a/drivers/infiniband/hw/siw/iwarp.h > b/drivers/infiniband/hw/siw/iwarp.h > [ ... ] > +struct mpa_rr_params { > +#if defined(__LITTLE_ENDIAN_BITFIELD) > + __be16 res:5, > + r:1, > + c:1, > + m:1, > + rev:8; > +#elif defined(__BIG_ENDIAN_BITFIELD) > + __be16 m:1, > + c:1, > + r:1, > + res:5, > + rev:8; > +#else > +#error "Adjust your <asm/byteorder.h> defines" > +#endif > + __be16 pd_len; > +};
The above style for declaring endianness specific bitfields in the kernel is generally frowned upon. The preferred style is to declare a __be32 or __le32 member variable, to define the bitmasks explicitly, to use the __constant_cpu_to_be32() conversion function and friends and to verify the resulting code with sparse (make C=1 CF=-D__CHECK_ENDIAN__ ...). Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
