195 lines
6.8 KiB
Diff
195 lines
6.8 KiB
Diff
From 52d9fd16cb76cddd429f81a032098ae966fc4c4e Mon Sep 17 00:00:00 2001
|
|
From: Jens Osterkamp <jens@linux.vnet.ibm.com>
|
|
Date: Sun, 6 Mar 2011 21:38:30 -0800
|
|
Subject: [PATCH 18/51] generic: renamed find_module_user_data_by_if
|
|
|
|
ifname was handed to find_module_user_data_by_if as parameter but never used
|
|
there. Therefore remove the parameter and rename the function to
|
|
find_module_user_data_by_id and change all the callers too.
|
|
|
|
Signed-off-by: Jens Osterkamp <jens@linux.vnet.ibm.com>
|
|
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
|
|
Signed-off-by: Petr Sabata <psabata@redhat.com>
|
|
---
|
|
include/lldp_mod.h | 3 +--
|
|
lldp_8023.c | 4 ++--
|
|
lldp_basman.c | 4 ++--
|
|
lldp_dcbx.c | 4 ++--
|
|
lldp_evb.c | 4 ++--
|
|
lldp_mand.c | 4 ++--
|
|
lldp_med.c | 4 ++--
|
|
lldp_vdp.c | 4 ++--
|
|
8 files changed, 15 insertions(+), 16 deletions(-)
|
|
|
|
diff --git a/include/lldp_mod.h b/include/lldp_mod.h
|
|
index 154fc99..c394fb9 100644
|
|
--- a/include/lldp_mod.h
|
|
+++ b/include/lldp_mod.h
|
|
@@ -108,8 +108,7 @@ static inline struct lldp_module *find_module_by_id(struct lldp_head *head, int
|
|
return NULL;
|
|
}
|
|
|
|
-static inline void *find_module_user_data_by_if(const char *ifname,
|
|
- struct lldp_head *head, int id)
|
|
+static inline void *find_module_user_data_by_id(struct lldp_head *head, int id)
|
|
{
|
|
struct lldp_module *mod;
|
|
|
|
diff --git a/lldp_8023.c b/lldp_8023.c
|
|
index 1e98aab..3a0bd4b 100644
|
|
--- a/lldp_8023.c
|
|
+++ b/lldp_8023.c
|
|
@@ -85,7 +85,7 @@ static struct ieee8023_data *ieee8023_data(const char *ifname)
|
|
struct ieee8023_user_data *ud;
|
|
struct ieee8023_data *bd = NULL;
|
|
|
|
- ud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_8023);
|
|
+ ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8023);
|
|
if (ud) {
|
|
LIST_FOREACH(bd, &ud->head, entry) {
|
|
if (!strncmp(ifname, bd->ifname, IFNAMSIZ))
|
|
@@ -447,7 +447,7 @@ void ieee8023_ifup(char *ifname)
|
|
goto out_err;
|
|
}
|
|
|
|
- ud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_8023);
|
|
+ ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_8023);
|
|
LIST_INSERT_HEAD(&ud->head, bd, entry);
|
|
LLDPAD_INFO("%s:port %s added\n", __func__, ifname);
|
|
return;
|
|
diff --git a/lldp_basman.c b/lldp_basman.c
|
|
index 0011c8f..3129277 100644
|
|
--- a/lldp_basman.c
|
|
+++ b/lldp_basman.c
|
|
@@ -92,7 +92,7 @@ static struct basman_data *basman_data(const char *ifname)
|
|
struct basman_user_data *bud;
|
|
struct basman_data *bd = NULL;
|
|
|
|
- bud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_BASIC);
|
|
+ bud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_BASIC);
|
|
if (bud) {
|
|
LIST_FOREACH(bd, &bud->head, entry) {
|
|
if (!strncmp(ifname, bd->ifname, IFNAMSIZ))
|
|
@@ -676,7 +676,7 @@ void basman_ifup(char *ifname)
|
|
goto out_err;
|
|
}
|
|
|
|
- bud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_BASIC);
|
|
+ bud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_BASIC);
|
|
LIST_INSERT_HEAD(&bud->head, bd, entry);
|
|
LLDPAD_DBG("%s:port %s added\n", __func__, ifname);
|
|
return;
|
|
diff --git a/lldp_dcbx.c b/lldp_dcbx.c
|
|
index 8649df9..480c439 100644
|
|
--- a/lldp_dcbx.c
|
|
+++ b/lldp_dcbx.c
|
|
@@ -116,7 +116,7 @@ struct dcbx_tlvs *dcbx_data(const char *ifname)
|
|
struct dcbd_user_data *dud;
|
|
struct dcbx_tlvs *tlv = NULL;
|
|
|
|
- dud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_DCBX);
|
|
+ dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX);
|
|
if (dud) {
|
|
LIST_FOREACH(tlv, &dud->head, entry) {
|
|
if (!strncmp(tlv->ifname, ifname, IFNAMSIZ))
|
|
@@ -443,7 +443,7 @@ void dcbx_ifup(char *ifname)
|
|
port = port->next;
|
|
}
|
|
|
|
- dud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_DCBX);
|
|
+ dud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_DCBX);
|
|
tlvs = dcbx_data(ifname);
|
|
|
|
if (!port || !check_port_dcb_mode(ifname))
|
|
diff --git a/lldp_evb.c b/lldp_evb.c
|
|
index 8533b31..a43f3e8 100644
|
|
--- a/lldp_evb.c
|
|
+++ b/lldp_evb.c
|
|
@@ -48,7 +48,7 @@ struct evb_data *evb_data(char *ifname)
|
|
struct evb_user_data *ud;
|
|
struct evb_data *ed = NULL;
|
|
|
|
- ud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_EVB);
|
|
+ ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_EVB);
|
|
if (ud) {
|
|
LIST_FOREACH(ed, &ud->head, entry) {
|
|
if (!strncmp(ifname, ed->ifname, IFNAMSIZ))
|
|
@@ -597,7 +597,7 @@ void evb_ifup(char *ifname)
|
|
ed->state = EVB_OFFER_CAPABILITIES;
|
|
evb_bld_tlv(ed);
|
|
|
|
- ud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_EVB);
|
|
+ ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_EVB);
|
|
LIST_INSERT_HEAD(&ud->head, ed, entry);
|
|
LLDPAD_DBG("%s:port %s added\n", __func__, ifname);
|
|
return;
|
|
diff --git a/lldp_mand.c b/lldp_mand.c
|
|
index 88efcd4..c755dfa 100644
|
|
--- a/lldp_mand.c
|
|
+++ b/lldp_mand.c
|
|
@@ -97,7 +97,7 @@ static struct mand_data *mand_data(const char *ifname)
|
|
struct mand_user_data *mud;
|
|
struct mand_data *md = NULL;
|
|
|
|
- mud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_MAND);
|
|
+ mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MAND);
|
|
if (mud) {
|
|
LIST_FOREACH(md, &mud->head, entry) {
|
|
if (!strncmp(ifname, md->ifname, IFNAMSIZ))
|
|
@@ -606,7 +606,7 @@ void mand_ifup(char *ifname)
|
|
md->rebuild_chassis = 1;
|
|
/* portid is built once and remains constant */
|
|
md->rebuild_portid = 1;
|
|
- mud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_MAND);
|
|
+ mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MAND);
|
|
LIST_INSERT_HEAD(&mud->head, md, entry);
|
|
LLDPAD_INFO("%s:port %s added\n", __func__, ifname);
|
|
return;
|
|
diff --git a/lldp_med.c b/lldp_med.c
|
|
index ce69536..7516f6d 100644
|
|
--- a/lldp_med.c
|
|
+++ b/lldp_med.c
|
|
@@ -96,7 +96,7 @@ static struct med_data *med_data(const char *ifname)
|
|
struct med_user_data *mud;
|
|
struct med_data *md = NULL;
|
|
|
|
- mud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_MED);
|
|
+ mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MED);
|
|
if (mud) {
|
|
LIST_FOREACH(md, &mud->head, entry) {
|
|
if (!strncmp(ifname, md->ifname, IFNAMSIZ))
|
|
@@ -902,7 +902,7 @@ void med_ifup(char *ifname)
|
|
free(md);
|
|
goto out_err;
|
|
}
|
|
- mud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_MED);
|
|
+ mud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_MED);
|
|
LIST_INSERT_HEAD(&mud->head, md, entry);
|
|
LLDPAD_INFO("%s:port %s added\n", __func__, ifname);
|
|
return;
|
|
diff --git a/lldp_vdp.c b/lldp_vdp.c
|
|
index b7c8f82..efe9f64 100644
|
|
--- a/lldp_vdp.c
|
|
+++ b/lldp_vdp.c
|
|
@@ -55,7 +55,7 @@ struct vdp_data *vdp_data(char *ifname)
|
|
struct vdp_user_data *ud;
|
|
struct vdp_data *vd = NULL;
|
|
|
|
- ud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_VDP);
|
|
+ ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP);
|
|
if (ud) {
|
|
LIST_FOREACH(vd, &ud->head, entry) {
|
|
if (!strncmp(ifname, vd->ifname, IFNAMSIZ))
|
|
@@ -1268,7 +1268,7 @@ void vdp_ifup(char *ifname)
|
|
|
|
LIST_INIT(&vd->profile_head);
|
|
|
|
- ud = find_module_user_data_by_if(ifname, &lldp_head, LLDP_MOD_VDP);
|
|
+ ud = find_module_user_data_by_id(&lldp_head, LLDP_MOD_VDP);
|
|
LIST_INSERT_HEAD(&ud->head, vd, entry);
|
|
|
|
port = port_find_by_name(ifname);
|
|
--
|
|
1.7.4.4
|
|
|