All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: move int literal to right side of comparison test
@ 2016-10-04  0:58 Elizabeth Ferdman
       [not found] ` <C9C47919-34D8-49D2-80AA-345EDD169236@intel.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Elizabeth Ferdman @ 2016-10-04  0:58 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: amsfield22, daniel.baluta, oleg.drokin, andreas.dilger, jsimmons,
	gregkh

Move the integer literal 0 to the right side of the comparison test
for improved readability.

Error caught by checkpatch: 
Constants should be placed on the right side of the comparison.

Signed-off-by: Elizabeth Ferdman <gnudevliz@gmail.com>
---
 drivers/staging/lustre/lustre/lov/lov_object.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c
index 52f7363..49a288f 100644
--- a/drivers/staging/lustre/lustre/lov/lov_object.c
+++ b/drivers/staging/lustre/lustre/lov/lov_object.c
@@ -597,7 +597,7 @@ static const struct lov_layout_operations lov_dispatch[] = {
 	enum lov_layout_type		    __llt;		  \
 									\
 	__llt = __obj->lo_type;					 \
-	LASSERT(0 <= __llt && __llt < ARRAY_SIZE(lov_dispatch));	\
+	LASSERT(__llt >= 0 && __llt < ARRAY_SIZE(lov_dispatch));	\
 	lov_dispatch[__llt].op(__VA_ARGS__);			    \
 })
 
@@ -652,7 +652,7 @@ do {								    \
 									\
 	lov_conf_freeze(__obj);						\
 	__llt = __obj->lo_type;					 \
-	LASSERT(0 <= __llt && __llt < ARRAY_SIZE(lov_dispatch));	\
+	LASSERT(__llt >= 0 && __llt < ARRAY_SIZE(lov_dispatch));	\
 	lov_dispatch[__llt].op(__VA_ARGS__);			    \
 	lov_conf_thaw(__obj);						\
 } while (0)
@@ -700,11 +700,11 @@ static int lov_layout_change(const struct lu_env *unused,
 	struct lu_env *env;
 	int refcheck;
 
-	LASSERT(0 <= lov->lo_type && lov->lo_type < ARRAY_SIZE(lov_dispatch));
+	LASSERT(lov->lo_type >= 0 && lov->lo_type < ARRAY_SIZE(lov_dispatch));
 
 	if (conf->u.coc_md)
 		llt = lov_type(conf->u.coc_md->lsm);
-	LASSERT(0 <= llt && llt < ARRAY_SIZE(lov_dispatch));
+	LASSERT(llt >= 0 && llt < ARRAY_SIZE(lov_dispatch));
 
 	cookie = cl_env_reenter();
 	env = cl_env_get(&refcheck);
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-04  6:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-04  0:58 [PATCH] staging: lustre: move int literal to right side of comparison test Elizabeth Ferdman
     [not found] ` <C9C47919-34D8-49D2-80AA-345EDD169236@intel.com>
2016-10-04  2:20   ` Elizabeth Ferdman
2016-10-04  6:00     ` [Outreachy kernel] " Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.