platform: remove unreachable code from nmp_cache_lookup_link_full()

If @ifname is set, we above lookup by name (nmp_lookup_init_link_by_ifname)
and set ifname to NULL. Hence, inside the loop, the check for ifname is
never true.
This commit is contained in:
Thomas Haller 2017-10-30 14:34:04 +01:00
parent 89a9908abf
commit f088afe7e9

View file

@ -1709,7 +1709,6 @@ nmp_cache_lookup_link_full (const NMPCache *cache,
if (strlen (ifname) >= IFNAMSIZ)
return NULL;
nmp_lookup_init_link_by_ifname (&lookup, ifname);
ifname = NULL;
} else
nmp_lookup_init_obj_type (&lookup, NMP_OBJECT_TYPE_LINK);
@ -1721,8 +1720,6 @@ nmp_cache_lookup_link_full (const NMPCache *cache,
continue;
if (link_type != NM_LINK_TYPE_NONE && obj->link.type != link_type)
continue;
if (ifname && strcmp (ifname, obj->link.name))
continue;
if (match_fn && !match_fn (obj, user_data))
continue;