From 0a4d85c2ed9baa948673bdf6aeb32fda934ebe44 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Mon, 10 Feb 2020 21:15:42 -0800 Subject: [PATCH] interface: Remove obsolete method. Now that all call sites have been converted to interface_create(), there is no longer any needed for a way to set the interface's name. This patch removes the useless method. Signed-off-by: Richard Cochran --- interface.c | 7 +------ interface.h | 7 ------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/interface.c b/interface.c index 2cf3b1e..65bdff0 100644 --- a/interface.c +++ b/interface.c @@ -22,7 +22,7 @@ struct interface *interface_create(const char *name) if (!iface) { return NULL; } - interface_set_name(iface, name); + strncpy(iface->name, name, MAX_IFNAME_SIZE); return iface; } @@ -64,11 +64,6 @@ void interface_set_label(struct interface *iface, const char *label) strncpy(iface->ts_label, label, MAX_IFNAME_SIZE); } -void interface_set_name(struct interface *iface, const char *name) -{ - strncpy(iface->name, name, MAX_IFNAME_SIZE); -} - bool interface_tsinfo_valid(struct interface *iface) { return iface->ts_info.valid ? true : false; diff --git a/interface.h b/interface.h index 6cc50ac..8bf2727 100644 --- a/interface.h +++ b/interface.h @@ -76,13 +76,6 @@ int interface_phc_index(struct interface *iface); */ void interface_set_label(struct interface *iface, const char *label); -/** - * Set the name of a given interface. - * @param iface The interface of interest. - * @param name The desired name for the interface. - */ -void interface_set_name(struct interface *iface, const char *name); - /** * Tests whether an interface's time stamping information is valid or not. * @param iface The interface of interest.