From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>,
kernel-janitors@vger.kernel.org,
Andreas Dilger <andreas.dilger@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/8] staging: lustre: put constant on the right of binary operator
Date: Sun, 30 Aug 2015 19:12:09 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1508301907310.2062@localhost6.localdomain6> (raw)
In-Reply-To: <1440892412.3276.10.camel@perches.com>
On Sat, 29 Aug 2015, Joe Perches wrote:
> On Sat, 2015-08-29 at 19:30 +0200, Julia Lawall wrote:
> > Move constants to the right of binary operators.
> []
> > diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
> []
> > @@ -2954,7 +2954,7 @@ void ptlrpc_init_xid(void)
> > }
> >
> > /* Always need to be aligned to a power-of-two for multi-bulk BRW */
> > - CLASSERT((PTLRPC_BULK_OPS_COUNT & (PTLRPC_BULK_OPS_COUNT - 1)) == 0);
> > + CLASSERT(((PTLRPC_BULK_OPS_COUNT - 1) & PTLRPC_BULK_OPS_COUNT) == 0);
>
> This one would probably be better as
>
> CLASSERT(is_power_of_2(PTLRPC_BULK_OPS_COUNT));
Actually not. CLASSERT requires that the expression is considered to be a
constant by the compiler, such that there will be a compiler error, and
the result of is_power_of_2 is not constant enough.
julia
prev parent reply other threads:[~2015-08-30 17:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-29 17:30 [PATCH 0/8] " Julia Lawall
2015-08-29 17:30 ` [PATCH 1/8] staging: lustre: include: " Julia Lawall
2015-08-29 17:30 ` [PATCH 2/8] staging: lustre: lnet: lib-ptl.c: " Julia Lawall
2015-08-29 17:30 ` [PATCH 3/8] staging: lustre: ldlm: " Julia Lawall
2015-08-29 17:30 ` [PATCH 4/8] staging: lustre: libcfs: " Julia Lawall
2015-08-29 17:30 ` [PATCH 5/8] staging: lustre: llite: " Julia Lawall
2015-08-29 17:30 ` [PATCH 6/8] Staging: lustre: obd: " Julia Lawall
2015-08-29 17:30 ` [PATCH 7/8] staging: lustre: osc: " Julia Lawall
2015-08-29 17:30 ` [PATCH 8/8] staging: lustre: " Julia Lawall
2015-08-29 23:53 ` Joe Perches
2015-08-30 8:42 ` Julia Lawall
2015-08-30 17:12 ` Julia Lawall [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=alpine.DEB.2.02.1508301907310.2062@localhost6.localdomain6 \
--to=julia.lawall@lip6.fr \
--cc=HPDD-discuss@ml01.01.org \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.com \
/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
all inboxes | Powered by JetHome®