[Drbd-dev] [PATCH 13/17] lru_cache: move constant to the right side of test

Tobin C. Harding me at tobin.cc
Mon Oct 2 00:34:12 CEST 2017


checkpatch emits WARNING: Comparisons should place the constant on the
right side of the test.

Move constant to the right hand side of the test.

Signed-off-by: Tobin C. Harding <me at tobin.cc>
---
 lib/lru_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lru_cache.c b/lib/lru_cache.c
index 9eed675..a581b33 100644
--- a/lib/lru_cache.c
+++ b/lib/lru_cache.c
@@ -69,7 +69,7 @@ int lc_try_lock(struct lru_cache *lc)
 		val = cmpxchg(&lc->flags, 0, LC_LOCKED);
 	} while (unlikely(val == LC_PARANOIA));
 	/* Spin until no-one is inside a PARANOIA_ENTRY()/RETURN() section. */
-	return 0 == val;
+	return val == 0;
 #if 0
 	/* Alternative approach, spin in case someone enters or leaves a
 	 * PARANOIA_ENTRY()/RETURN() section.
-- 
2.7.4



More information about the drbd-dev mailing list