From: Frantisek Sumsal Date: Fri, 17 Dec 2021 19:16:18 +0000 (+0100) Subject: network: a couple of tweaks suggested by Coccinelle X-Git-Tag: v250-rc3~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0a2e0cc24491a4f4dbf5ad49aec2507f75ee8e3;p=thirdparty%2Fsystemd.git network: a couple of tweaks suggested by Coccinelle --- diff --git a/src/network/netdev/ipoib.c b/src/network/netdev/ipoib.c index c3f583fc467..e0ff9e8c62e 100644 --- a/src/network/netdev/ipoib.c +++ b/src/network/netdev/ipoib.c @@ -139,7 +139,7 @@ int config_parse_ipoib_pkey( rvalue); return 0; } - if (u == 0 || u == 0x8000) { + if (IN_SET(u, 0, 0x8000)) { log_syntax(unit, LOG_WARNING, filename, line, 0, "IPoIB pkey cannot be 0 nor 0x8000, ignoring assignment: %s", rvalue); diff --git a/src/network/networkd-address-generation.c b/src/network/networkd-address-generation.c index c9c53b22cc0..85110355a1d 100644 --- a/src/network/networkd-address-generation.c +++ b/src/network/networkd-address-generation.c @@ -358,10 +358,9 @@ int config_parse_address_generation_type( addr = addr_alloc; } - } else if (*addr == ',') { - comma = addr; - addr = NULL; - } else if (*addr == '\0') { + } else if (*addr == ',') + comma = TAKE_PTR(addr); + else if (*addr == '\0') { comma = NULL; addr = NULL; } else {