Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758832AbdDSBE6 convert rfc822-to-8bit (ORCPT ); Tue, 18 Apr 2017 21:04:58 -0400 Received: from mga01.intel.com ([192.55.52.88]:26820 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758475AbdDSBEz (ORCPT ); Tue, 18 Apr 2017 21:04:55 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,219,1488873600"; d="scan'208";a="78666567" From: "Dilger, Andreas" To: Rishiraj Manwatkar CC: "greg@kroah.com" , "lustre-devel@lists.lustre.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "Drokin, Oleg" Subject: Re: [Patch v3 2/2] lustre: CONSTANTS put on right side of comparison test Thread-Topic: [Patch v3 2/2] lustre: CONSTANTS put on right side of comparison test Thread-Index: AQHSte9NdZLpci3lR0K7PPe8YJWG1aHMW1+A Date: Wed, 19 Apr 2017 01:04:52 +0000 Message-ID: References: <677c0d437ce8d9f27213e408751a1058b5c9e482.1492263580.git.manwatkar@outlook.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.252.199.57] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <2AE55FD53630EF449237649194A16F1D@intel.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1882 Lines: 59 On Apr 15, 2017, at 07:50, Rishiraj Manwatkar wrote: > > Comparison should have the CONSTANT on the right side of the test I don't think this change really improves things. For standalone comparisons I agree that having the constant on the RHS is best, but here it is like a normal mathematical expression "X <= type < Y" which I think is reasonable to keep even if checkpatch.pl complains a bit. That said, I don't have strong feelings about this and Greg can apply it or not as he sees fit. I guess the benefit of applying it is that it stops anyone else from sending the same patch in the future... Cheers, Andreas > Signed-off-by: Rishiraj Manwatkar > --- > v1 -> v2: Added mailing list in cc. > v2 -> v3: Improved Subject line. > drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c > index 0997254..bec112f 100755 > --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c > +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c > @@ -58,7 +58,7 @@ > > static inline int cl_io_type_is_valid(enum cl_io_type type) > { > - return CIT_READ <= type && type < CIT_OP_NR; > + return type >= CIT_READ && type < CIT_OP_NR; > } > > static inline int cl_io_is_loopable(const struct cl_io *io) > @@ -389,7 +389,7 @@ void cl_io_unlock(const struct lu_env *env, struct cl_io *io) > const struct cl_io_slice *scan; > > LASSERT(cl_io_is_loopable(io)); > - LASSERT(CIS_IT_STARTED <= io->ci_state && io->ci_state < CIS_UNLOCKED); > + LASSERT(io->ci_state >= CIS_IT_STARTED && io->ci_state < CIS_UNLOCKED); > LINVRNT(cl_io_invariant(io)); > > set = &io->ci_lockset; > -- > 2.1.4 > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation