]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
lldp: use structured initializer at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Nov 2018 05:26:00 +0000 (14:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Nov 2018 13:57:42 +0000 (22:57 +0900)
src/libsystemd-network/sd-lldp.c

index 993ca13727ba422084d6499a296f7bbd2141bf3f..ffc6db030c27faea20d026886d869f0d23457587 100644 (file)
@@ -361,14 +361,16 @@ _public_ int sd_lldp_new(sd_lldp **ret) {
 
         assert_return(ret, -EINVAL);
 
-        lldp = new0(sd_lldp, 1);
+        lldp = new(sd_lldp, 1);
         if (!lldp)
                 return -ENOMEM;
 
-        lldp->n_ref = 1;
-        lldp->fd = -1;
-        lldp->neighbors_max = LLDP_DEFAULT_NEIGHBORS_MAX;
-        lldp->capability_mask = (uint16_t) -1;
+        *lldp = (sd_lldp) {
+                .n_ref = 1,
+                .fd = -1,
+                .neighbors_max = LLDP_DEFAULT_NEIGHBORS_MAX,
+                .capability_mask = (uint16_t) -1,
+        };
 
         lldp->neighbor_by_id = hashmap_new(&lldp_neighbor_id_hash_ops);
         if (!lldp->neighbor_by_id)