From: Elizabeth Ferdman <gnudevliz@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: amsfield22@gmail.com, daniel.baluta@intel.com,
oleg.drokin@intel.com, andreas.dilger@intel.com,
jsimmons@infradead.org, gregkh@linuxfoundation.org
Subject: [PATCH] staging: lustre: move int literal to right side of comparison test
Date: Mon, 3 Oct 2016 17:58:10 -0700 [thread overview]
Message-ID: <20161004005807.GA13033@localhost> (raw)
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
next reply other threads:[~2016-10-04 0:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-04 0:58 Elizabeth Ferdman [this message]
[not found] ` <C9C47919-34D8-49D2-80AA-345EDD169236@intel.com>
2016-10-04 2:20 ` [PATCH] staging: lustre: move int literal to right side of comparison test Elizabeth Ferdman
2016-10-04 6:00 ` [Outreachy kernel] " Julia Lawall
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=20161004005807.GA13033@localhost \
--to=gnudevliz@gmail.com \
--cc=amsfield22@gmail.com \
--cc=andreas.dilger@intel.com \
--cc=daniel.baluta@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jsimmons@infradead.org \
--cc=oleg.drokin@intel.com \
--cc=outreachy-kernel@googlegroups.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 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.