summaryrefslogtreecommitdiff
path: root/lib/lldp
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2021-03-26 11:30:22 -0700
committerBen Pfaff <blp@ovn.org>2021-04-07 09:34:24 -0700
commit4cb38cd22230b156216bce9c0bc3a777a4d9ccbc (patch)
tree1e3768d75b717cb7bfaa4fa3551c84fa733cb8c2 /lib/lldp
parentf8be30acf2eb60d567bb7386b98f5cb58ddb9119 (diff)
downloadopenvswitch-4cb38cd22230b156216bce9c0bc3a777a4d9ccbc.tar.gz
ovs-lldp: Get rid of pointless null pointer check.
lldpd_alloc_hardware() always returns nonnull. At the same time, there's no reason that lldpd_alloc_hardware() doesn't take a const char *, so change that. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib/lldp')
-rw-r--r--lib/lldp/lldpd.c2
-rw-r--r--lib/lldp/lldpd.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c
index 34738535d..a024dc5e5 100644
--- a/lib/lldp/lldpd.c
+++ b/lib/lldp/lldpd.c
@@ -77,7 +77,7 @@ lldpd_get_hardware(struct lldpd *cfg, char *name, int index,
}
struct lldpd_hardware *
-lldpd_alloc_hardware(struct lldpd *cfg, char *name, int index)
+lldpd_alloc_hardware(struct lldpd *cfg, const char *name, int index)
{
struct lldpd_hardware *hw;
diff --git a/lib/lldp/lldpd.h b/lib/lldp/lldpd.h
index 5267c112a..3f5be84a2 100644
--- a/lib/lldp/lldpd.h
+++ b/lib/lldp/lldpd.h
@@ -76,7 +76,7 @@ lldpd_first_hardware(struct lldpd *lldpd)
/* lldpd.c */
struct lldpd_hardware *lldpd_get_hardware(struct lldpd *,
char *, int, struct lldpd_ops *);
-struct lldpd_hardware *lldpd_alloc_hardware(struct lldpd *, char *, int);
+struct lldpd_hardware *lldpd_alloc_hardware(struct lldpd *, const char *, int);
void lldpd_hardware_cleanup(struct lldpd*, struct lldpd_hardware *);
struct lldpd_mgmt *lldpd_alloc_mgmt(int family, void *addr, size_t addrsize,
u_int32_t iface);