Thread (2 messages) 2 messages, 2 authors, 2012-08-22

[B.A.T.M.A.N.] [PATCH] batctl: use the BIT macro instead of constant values

From: Antonio Quartulli <hidden>
Date: 2012-08-09 00:35:43
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Antonio Quartulli <redacted>
---
 sys.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys.c b/sys.c
index e40ddcd..6f94483 100644
--- a/sys.c
+++ b/sys.c
@@ -318,14 +318,14 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
 
 	printf("[%c] %s (%s)\n", (!log_level) ? 'x' : ' ',
 	       "all debug output disabled", "none");
-	printf("[%c] %s (%s)\n", (log_level & 1) ? 'x' : ' ',
+	printf("[%c] %s (%s)\n", (log_level & BIT(0)) ? 'x' : ' ',
 	       "messages related to routing / flooding / broadcasting",
 	       "batman");
-	printf("[%c] %s (%s)\n", (log_level & 2) ? 'x' : ' ',
+	printf("[%c] %s (%s)\n", (log_level & BIT(1)) ? 'x' : ' ',
 	       "messages related to route added / changed / deleted", "routes");
-	printf("[%c] %s (%s)\n", (log_level & 4) ? 'x' : ' ',
+	printf("[%c] %s (%s)\n", (log_level & BIT(2)) ? 'x' : ' ',
 	       "messages related to translation table operations", "tt");
-	printf("[%c] %s (%s)\n", (log_level & 8) ? 'x' : ' ',
+	printf("[%c] %s (%s)\n", (log_level & BIT(3)) ? 'x' : ' ',
 	       "messages related to bridge loop avoidance", "bla");
 
 out:
-- 
1.7.9.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help