From: Bart Van Assche <bvanassche@acm.org>
To: Bernard Metzler <bmt@zurich.ibm.com>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH 02/14] SIWv2: iWARP Protocol headers: iwarp.h
Date: Sat, 18 Jun 2011 19:52:49 +0200 [thread overview]
Message-ID: <BANLkTi=Z--Qq1TBymERFCcNWrO--cpeMmw@mail.gmail.com> (raw)
In-Reply-To: <1308228112-22582-1-git-send-email-bmt@zurich.ibm.com>
On Thu, Jun 16, 2011 at 2:41 PM, Bernard Metzler <bmt@zurich.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.
prev parent reply other threads:[~2011-06-18 18:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 12:41 [PATCH 02/14] SIWv2: iWARP Protocol headers: iwarp.h Bernard Metzler
2011-06-18 17:52 ` Bart Van Assche [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTi=Z--Qq1TBymERFCcNWrO--cpeMmw@mail.gmail.com' \
--to=bvanassche@acm.org \
--cc=bmt@zurich.ibm.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).