Commit 34b7074d authored by Daniel Machon's avatar Daniel Machon Committed by David S. Miller

net: dcb: modify dcb_app_add to take list_head ptr as parameter

In preparation to DCB rewrite. Modify dcb_app_add to take new struct
list_head * as parameter, to make the used list configurable. This is
done to allow reusing the function for adding rewrite entries to the
rewrite table, which is introduced in a later patch.
Signed-off-by: default avatarDaniel Machon <daniel.machon@microchip.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 147c50ac
...@@ -1955,7 +1955,8 @@ static struct dcb_app_type *dcb_app_lookup(const struct dcb_app *app, ...@@ -1955,7 +1955,8 @@ static struct dcb_app_type *dcb_app_lookup(const struct dcb_app *app,
return NULL; return NULL;
} }
static int dcb_app_add(const struct dcb_app *app, int ifindex) static int dcb_app_add(struct list_head *list, const struct dcb_app *app,
int ifindex)
{ {
struct dcb_app_type *entry; struct dcb_app_type *entry;
...@@ -1965,7 +1966,7 @@ static int dcb_app_add(const struct dcb_app *app, int ifindex) ...@@ -1965,7 +1966,7 @@ static int dcb_app_add(const struct dcb_app *app, int ifindex)
memcpy(&entry->app, app, sizeof(*app)); memcpy(&entry->app, app, sizeof(*app));
entry->ifindex = ifindex; entry->ifindex = ifindex;
list_add(&entry->list, &dcb_app_list); list_add(&entry->list, list);
return 0; return 0;
} }
...@@ -2028,7 +2029,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new) ...@@ -2028,7 +2029,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new)
} }
/* App type does not exist add new application type */ /* App type does not exist add new application type */
if (new->priority) if (new->priority)
err = dcb_app_add(new, dev->ifindex); err = dcb_app_add(&dcb_app_list, new, dev->ifindex);
out: out:
spin_unlock_bh(&dcb_lock); spin_unlock_bh(&dcb_lock);
if (!err) if (!err)
...@@ -2088,7 +2089,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) ...@@ -2088,7 +2089,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new)
goto out; goto out;
} }
err = dcb_app_add(new, dev->ifindex); err = dcb_app_add(&dcb_app_list, new, dev->ifindex);
out: out:
spin_unlock_bh(&dcb_lock); spin_unlock_bh(&dcb_lock);
if (!err) if (!err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment