From: Zbigniew Jędrzejewski-Szmek Date: Tue, 16 Feb 2021 13:14:41 +0000 (+0100) Subject: networkd: make network_config_section_free() inline X-Git-Tag: v248-rc1~99^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d160a23041254f58acfd35584103df57dc347ae;p=thirdparty%2Fsystemd.git networkd: make network_config_section_free() inline --- diff --git a/src/network/networkd-util.c b/src/network/networkd-util.c index b41148d2c69..a5c6fa8d006 100644 --- a/src/network/networkd-util.c +++ b/src/network/networkd-util.c @@ -155,10 +155,6 @@ int network_config_section_new(const char *filename, unsigned line, NetworkConfi return 0; } -void network_config_section_free(NetworkConfigSection *cs) { - free(cs); -} - unsigned hashmap_find_free_section_line(Hashmap *hashmap) { NetworkConfigSection *cs; unsigned n = 0; diff --git a/src/network/networkd-util.h b/src/network/networkd-util.h index 0cfb009890d..efeeb86eb0b 100644 --- a/src/network/networkd-util.h +++ b/src/network/networkd-util.h @@ -47,9 +47,12 @@ sd_dhcp_lease_server_type dhcp_lease_server_type_from_string(const char *s) _pur int kernel_route_expiration_supported(void); -int network_config_section_new(const char *filename, unsigned line, NetworkConfigSection **s); -void network_config_section_free(NetworkConfigSection *network); +static inline void network_config_section_free(NetworkConfigSection *cs) { + free(cs); +} DEFINE_TRIVIAL_CLEANUP_FUNC(NetworkConfigSection*, network_config_section_free); + +int network_config_section_new(const char *filename, unsigned line, NetworkConfigSection **s); extern const struct hash_ops network_config_hash_ops; unsigned hashmap_find_free_section_line(Hashmap *hashmap);