From 253906ecd212caa37de4eceaf64d9f8772ff5cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20=C5=A0imerda?= Date: Tue, 2 Jul 2013 22:45:25 +0200 Subject: [PATCH] trivial: simplify nm_ip[46]_config_diff() result check nm_ip[46]_config_diff() explicitly checks for NULL arguments. --- src/devices/nm-device.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index f6cfadf9cc..6be90c0e35 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4279,7 +4279,6 @@ nm_device_set_ip4_config (NMDevice *self, const char *ip_iface; NMIP4Config *old_config = NULL; gboolean success = TRUE; - NMIP4ConfigCompareFlags diff = NM_IP4_COMPARE_FLAG_ALL; int ip_ifindex; g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); @@ -4291,12 +4290,8 @@ nm_device_set_ip4_config (NMDevice *self, old_config = priv->ip4_config; - if (new_config && old_config) { - diff = nm_ip4_config_diff (new_config, old_config); - if (diff == NM_IP4_COMPARE_FLAG_NONE) - return TRUE; /* no actual change */ - } else if (!new_config && !old_config) - return TRUE; + if (!nm_ip4_config_diff (new_config, old_config)) + return success; priv->ip4_config = NULL; @@ -4336,7 +4331,6 @@ nm_device_set_ip6_config (NMDevice *self, const char *ip_iface; NMIP6Config *old_config = NULL; gboolean success = TRUE; - NMIP6ConfigCompareFlags diff = NM_IP6_COMPARE_FLAG_ALL; int ip_ifindex; g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); @@ -4348,12 +4342,8 @@ nm_device_set_ip6_config (NMDevice *self, old_config = priv->ip6_config; - if (new_config && old_config) { - diff = nm_ip6_config_diff (new_config, old_config); - if (diff == NM_IP6_COMPARE_FLAG_NONE) - return TRUE; /* no actual change */ - } else if (!new_config && !old_config) - return TRUE; + if (!nm_ip6_config_diff (new_config, old_config)); + return success; priv->ip6_config = NULL;