]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: drop unnecessary temporary variables
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Jan 2024 15:00:45 +0000 (00:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Jan 2024 19:05:43 +0000 (04:05 +0900)
src/network/networkd-network.c

index 2d5c847a6a66c5620341d16b5838a4fa2bb25861..845a8130bde3ef464b8a58bdb91d57844558de8b 100644 (file)
@@ -1213,8 +1213,6 @@ int config_parse_required_for_online(
                 void *userdata) {
 
         Network *network = ASSERT_PTR(userdata);
-        LinkOperationalStateRange range;
-        bool required = true;
         int r;
 
         assert(filename);
@@ -1227,7 +1225,7 @@ int config_parse_required_for_online(
                 return 0;
         }
 
-        r = parse_operational_state_range(rvalue, &range);
+        r = parse_operational_state_range(rvalue, &network->required_operstate_for_online);
         if (r < 0) {
                 r = parse_boolean(rvalue);
                 if (r < 0) {
@@ -1237,13 +1235,12 @@ int config_parse_required_for_online(
                         return 0;
                 }
 
-                required = r;
-                range = LINK_OPERSTATE_RANGE_DEFAULT;
+                network->required_for_online = r;
+                network->required_operstate_for_online = LINK_OPERSTATE_RANGE_DEFAULT;
+                return 0;
         }
 
-        network->required_for_online = required;
-        network->required_operstate_for_online = range;
-
+        network->required_for_online = true;
         return 0;
 }