From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753630AbbH3RMO (ORCPT ); Sun, 30 Aug 2015 13:12:14 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:45094 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753530AbbH3RMN (ORCPT ); Sun, 30 Aug 2015 13:12:13 -0400 X-IronPort-AV: E=Sophos;i="5.17,435,1437429600"; d="scan'208";a="144199516" Date: Sun, 30 Aug 2015 19:12:09 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Joe Perches cc: Oleg Drokin , kernel-janitors@vger.kernel.org, Andreas Dilger , Greg Kroah-Hartman , 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 In-Reply-To: <1440892412.3276.10.camel@perches.com> Message-ID: References: <1440869412-4899-1-git-send-email-Julia.Lawall@lip6.fr> <1440869412-4899-9-git-send-email-Julia.Lawall@lip6.fr> <1440892412.3276.10.camel@perches.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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