[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BANLkTi=Z--Qq1TBymERFCcNWrO--cpeMmw@mail.gmail.com>
Date: Sat, 18 Jun 2011 19:52:49 +0200
From: Bart Van Assche <bvanassche@....org>
To: Bernard Metzler <bmt@...ich.ibm.com>
Cc: netdev@...r.kernel.org, linux-rdma@...r.kernel.org
Subject: Re: [PATCH 02/14] SIWv2: iWARP Protocol headers: iwarp.h
On Thu, Jun 16, 2011 at 2:41 PM, Bernard Metzler <bmt@...ich.ibm.com> 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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists