diff options
author | Thomas Haller <thaller@redhat.com> | 2016-11-02 15:22:56 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-11-02 15:22:59 +0100 |
commit | 64ed2773803ff470e63a6e1d12c8992e3d84bb35 (patch) | |
tree | b8ac415510f7a3da2e4a332759510bdf76caefd8 /libnm-core/nm-setting-vlan.c | |
parent | f23320478d4e3829843b8b688a3fa2c45d76eb0c (diff) | |
download | NetworkManager-64ed2773803ff470e63a6e1d12c8992e3d84bb35.tar.gz |
libnm-core: minor cleanups in nm-setting-vlan.c
Don't g_warn() from within the library. It's not clear
that the caller did something wrong, we shouldn't issue
glog warnings.
Diffstat (limited to 'libnm-core/nm-setting-vlan.c')
-rw-r--r-- | libnm-core/nm-setting-vlan.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c index 7d7d8e9243..e00acf03dd 100644 --- a/libnm-core/nm-setting-vlan.c +++ b/libnm-core/nm-setting-vlan.c @@ -147,13 +147,11 @@ priority_map_new_from_str (NMVlanPriorityMap map, const char *str) to = g_ascii_strtoull (t[1], NULL, 10); if ((from <= get_max_prio (map, TRUE)) && (to <= get_max_prio (map, FALSE))) { - p = g_malloc0 (sizeof (NMVlanQosMapping)); + G_STATIC_ASSERT (sizeof (*p) == sizeof (p->from) + sizeof (p->to)); + p = g_malloc (sizeof (NMVlanQosMapping)); p->from = from; p->to = to; } - } else { - /* Warn */ - g_warn_if_fail (len == 2); } g_strfreev (t); @@ -747,13 +745,11 @@ set_property (GObject *object, guint prop_id, break; case PROP_INGRESS_PRIORITY_MAP: g_slist_free_full (priv->ingress_priority_map, g_free); - priv->ingress_priority_map = - priority_strv_to_maplist (NM_VLAN_INGRESS_MAP, g_value_get_boxed (value)); + priv->ingress_priority_map = priority_strv_to_maplist (NM_VLAN_INGRESS_MAP, g_value_get_boxed (value)); break; case PROP_EGRESS_PRIORITY_MAP: g_slist_free_full (priv->egress_priority_map, g_free); - priv->egress_priority_map = - priority_strv_to_maplist (NM_VLAN_EGRESS_MAP, g_value_get_boxed (value)); + priv->egress_priority_map = priority_strv_to_maplist (NM_VLAN_EGRESS_MAP, g_value_get_boxed (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |