summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-06-04 11:26:00 +0200
committerSven Eckelmann <sven@narfation.org>2011-06-09 20:40:38 +0200
commite8958dbf0da377e11f385a9888da3f72e827ab26 (patch)
treebf2c84c423ebdfba4b88afad1fcb7d9a96070902 /net/batman-adv/main.h
parent3d222bbaa7329e8ef45129e1bd6801000d7e05e4 (diff)
downloadop-kernel-dev-e8958dbf0da377e11f385a9888da3f72e827ab26.zip
op-kernel-dev-e8958dbf0da377e11f385a9888da3f72e827ab26.tar.gz
batman-adv: Use enums for related constants
CodingStyle "Chapter 12: Macros, Enums and RTL" recommends to use enums for several related constants. Internal states can be used without defining the actual value, but all values which are visible to the outside must be defined as before. Normal values are assigned as usual and flags are defined by shifts of a bit. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r--net/batman-adv/main.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 610eaf0..27ad734 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -72,9 +72,11 @@
#define RESET_PROTECTION_MS 30000
#define EXPECTED_SEQNO_RANGE 65536
-#define MESH_INACTIVE 0
-#define MESH_ACTIVE 1
-#define MESH_DEACTIVATING 2
+enum mesh_state {
+ MESH_INACTIVE,
+ MESH_ACTIVE,
+ MESH_DEACTIVATING
+};
#define BCAST_QUEUE_LEN 256
#define BATMAN_QUEUE_LEN 256
@@ -89,10 +91,11 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
/* all messages related to routing / flooding / broadcasting / etc */
-#define DBG_BATMAN 1
-/* route or tt entry added / changed / deleted */
-#define DBG_ROUTES 2
-#define DBG_ALL 3
+enum dbg_level {
+ DBG_BATMAN = 1 << 0,
+ DBG_ROUTES = 1 << 1, /* route added / changed / deleted */
+ DBG_ALL = 3
+};
/*
OpenPOWER on IntegriCloud