]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Use CMP() macro for comparison.
authorFilipe Brandenburger <filbranden@google.com>
Thu, 2 Aug 2018 23:00:53 +0000 (16:00 -0700)
committerFilipe Brandenburger <filbranden@google.com>
Tue, 7 Aug 2018 02:19:12 +0000 (19:19 -0700)
Follow up for PRs #9764 and #9760.

src/network/networkd-network.c

index c8f7c4f98a57b3b60c5499171e7a66a17175e655..77ba8c678ee32dd0a9f5b54fb2144ebdaad45848 100644 (file)
@@ -36,12 +36,7 @@ static int network_config_compare_func(const void *a, const void *b) {
         if (r != 0)
                 return r;
 
-        if (x->line < y->line)
-                return -1;
-        if (x->line > y->line)
-                return 1;
-
-        return 0;
+        return CMP(x->line, y->line);
 }
 
 const struct hash_ops network_config_hash_ops = {