From ace437338d2d80a2fd83a416034149324c14cfbd Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 6 May 2020 16:01:09 +0200 Subject: [PATCH] ifcfg-rh: minor cleanup of make_match_setting() --- .../plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 991ad77d0d..2b9d5fd528 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -1539,19 +1539,19 @@ make_user_setting (shvarFile *ifcfg) static void -make_match_setting_prop (const char *v, NMSettingMatch **s_match, - void (*add_fcn) (NMSettingMatch *s_match, const char *value) ) { +make_match_setting_prop (const char *v, + NMSettingMatch **s_match, + void (*add_fcn) (NMSettingMatch *s_match, const char *value)) +{ gs_free const char **strv = NULL; gsize i; - if (v) { - strv = nm_utils_escaped_tokens_split (v, NM_ASCII_SPACES); - if (strv) { - for (i = 0; strv[i]; i++) { - if (!(*s_match)) - *s_match = (NMSettingMatch *) nm_setting_match_new (); - add_fcn (*s_match, strv[i]); - } + strv = nm_utils_escaped_tokens_split (v, NM_ASCII_SPACES); + if (strv) { + for (i = 0; strv[i]; i++) { + if (!(*s_match)) + *s_match = NM_SETTING_MATCH (nm_setting_match_new ()); + add_fcn (*s_match, strv[i]); } } } @@ -1572,7 +1572,7 @@ make_match_setting (shvarFile *ifcfg) v = svGetValueStr (ifcfg, "MATCH_DRIVER", &value_d); make_match_setting_prop(v, &s_match, nm_setting_match_add_driver); - return (NMSetting *) s_match; + return NM_SETTING (s_match); } static NMSetting *