summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-08-21 14:35:04 +0200
committerThomas Haller <thaller@redhat.com>2017-08-23 18:37:22 +0200
commitabaaf3a69368360d8bd78c5160c959faa505911a (patch)
tree4991b58d903c3223dba507ff0b9085a20b558451
parent2cd25d7a373e7422c6a14fb7d5827d19f8ec1851 (diff)
downloadNetworkManager-abaaf3a69368360d8bd78c5160c959faa505911a.tar.gz
platform/trivial: move code
Trivial code (like this which only depends on an enum defined in a header file) should go first, so that the complex stuff is close together.
-rw-r--r--src/platform/nm-platform.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index c950c85cf6..87967fcad5 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -240,6 +240,24 @@ NM_UTILS_LOOKUP_STR_DEFINE (_nm_platform_error_to_string, NMPlatformError,
NM_UTILS_LOOKUP_ITEM_IGNORE (_NM_PLATFORM_ERROR_MININT),
);
+NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_nmp_nlm_flag_to_string_lookup, NMPNlmFlags,
+ NM_UTILS_LOOKUP_DEFAULT (NULL),
+ NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_ADD, "add"),
+ NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_CHANGE, "change"),
+ NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_REPLACE, "replace"),
+ NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_PREPEND, "prepend"),
+ NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_APPEND, "append"),
+ NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_TEST, "test"),
+ NM_UTILS_LOOKUP_ITEM_IGNORE (NMP_NLM_FLAG_F_APPEND),
+);
+
+#define _nmp_nlm_flag_to_string(flags) \
+ ({ \
+ NMPNlmFlags _flags = (flags); \
+ \
+ _nmp_nlm_flag_to_string_lookup (flags) ?: nm_sprintf_bufa (100, "new[0x%x]", (unsigned) _flags); \
+ })
+
/*****************************************************************************/
gboolean
@@ -3453,24 +3471,6 @@ nm_platform_address_flush (NMPlatform *self, int ifindex)
/*****************************************************************************/
-NM_UTILS_LOOKUP_STR_DEFINE_STATIC (_nmp_nlm_flag_to_string_lookup, NMPNlmFlags,
- NM_UTILS_LOOKUP_DEFAULT (NULL),
- NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_ADD, "add"),
- NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_CHANGE, "change"),
- NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_REPLACE, "replace"),
- NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_PREPEND, "prepend"),
- NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_APPEND, "append"),
- NM_UTILS_LOOKUP_ITEM (NMP_NLM_FLAG_TEST, "test"),
- NM_UTILS_LOOKUP_ITEM_IGNORE (NMP_NLM_FLAG_F_APPEND),
-);
-
-#define _nmp_nlm_flag_to_string(flags) \
- ({ \
- NMPNlmFlags _flags = (flags); \
- \
- _nmp_nlm_flag_to_string_lookup (flags) ?: nm_sprintf_bufa (100, "new[0x%x]", (unsigned) _flags); \
- })
-
gboolean
nm_platform_ip4_route_add (NMPlatform *self,
NMPNlmFlags flags,