lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <F6F1175F-2DFB-4C9F-9E70-4278FE18D862@intel.com>
Date:   Wed, 19 Apr 2017 01:04:52 +0000
From:   "Dilger, Andreas" <andreas.dilger@...el.com>
To:     Rishiraj Manwatkar <manwatkar@...look.com>
CC:     "greg@...ah.com" <greg@...ah.com>,
        "lustre-devel@...ts.lustre.org" <lustre-devel@...ts.lustre.org>,
        "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Drokin, Oleg" <oleg.drokin@...el.com>
Subject: Re: [Patch v3 2/2] lustre: CONSTANTS put on right side of
 comparison test

On Apr 15, 2017, at 07:50, Rishiraj Manwatkar <manwatkar@...look.com> 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 <manwatkar@...look.com>
> ---
> 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







Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ