[Drbd-dev] [PATCH 07/17] lru_cache: clean macro definition

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


checkpatch emits ERROR: trailing statements should be on next line.
Also macro definition is slightly cluttered. If we lay the definition
out more cleanly the code is easier to read.

Clean macro definition, clearing checkpatch error.

Signed-off-by: Tobin C. Harding <me at tobin.cc>
---
 lib/lru_cache.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/lru_cache.c b/lib/lru_cache.c
index 18043b9..c15df31 100644
--- a/lib/lru_cache.c
+++ b/lib/lru_cache.c
@@ -44,13 +44,14 @@ MODULE_LICENSE("GPL");
 	return x ; } while (0)
 
 /* BUG() if e is not one of the elements tracked by lc */
-#define PARANOIA_LC_ELEMENT(lc, e) do {	\
-	struct lru_cache *lc_ = (lc);	\
-	struct lc_element *e_ = (e);	\
-	unsigned int i = e_->lc_index;	\
-	BUG_ON(i >= lc_->nr_elements);	\
-	BUG_ON(lc_->lc_element[i] != e_); } while (0)
-
+#define PARANOIA_LC_ELEMENT(lc, e)			\
+	do {						\
+		struct lru_cache *lc_ = (lc);		\
+		struct lc_element *e_ = (e);		\
+		unsigned int i = e_->lc_index;		\
+		BUG_ON(i >= lc_->nr_elements);		\
+		BUG_ON(lc_->lc_element[i] != e_);	\
+	} while (0)
 
 /* We need to atomically
  *  - try to grab the lock (set LC_LOCKED)
-- 
2.7.4



More information about the drbd-dev mailing list