rtnetlink & bonding: change args got get_tx_queues
authorstephen hemminger <shemminger@vyatta.com>
Tue, 10 Apr 2012 18:34:43 +0000 (18:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Apr 2012 17:31:00 +0000 (13:31 -0400)
Change get_tx_queues, drop unsused arg/return value real_tx_queues,
and use return by value (with error) rather than call by reference.

Probably bonding should just change to LLTX and the whole get_tx_queues
API could disappear!

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c
include/net/rtnetlink.h
net/core/rtnetlink.c

index 62d2409bb293c54de4173e8ef9452e35b6f172e2..53ee6a0a36815debef8a8ccd67a22bdcfdefb427 100644 (file)
@@ -4820,12 +4820,9 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
        return 0;
 }
 
-static int bond_get_tx_queues(struct net *net, struct nlattr *tb[],
-                             unsigned int *num_queues,
-                             unsigned int *real_num_queues)
+static int bond_get_tx_queues(struct net *net, const struct nlattr *tb[])
 {
-       *num_queues = tx_queues;
-       return 0;
+       return tx_queues;
 }
 
 static struct rtnl_link_ops bond_link_ops __read_mostly = {
index 370293901971846b70bd805bd9b7b1322e6d8338..58243739212c73d858cf1e1900710185413f11e9 100644 (file)
@@ -75,9 +75,8 @@ struct rtnl_link_ops {
        size_t                  (*get_xstats_size)(const struct net_device *dev);
        int                     (*fill_xstats)(struct sk_buff *skb,
                                               const struct net_device *dev);
-       int                     (*get_tx_queues)(struct net *net, struct nlattr *tb[],
-                                                unsigned int *tx_queues,
-                                                unsigned int *real_tx_queues);
+       int                     (*get_tx_queues)(struct net *net,
+                                                const struct nlattr *tb[]);
 };
 
 extern int     __rtnl_link_register(struct rtnl_link_ops *ops);
index 545a969672ab778fdcced03da911b31a95ed6d2d..4a0d8cfff2a020e2892475860ce3a3f3f97a902f 100644 (file)
@@ -1640,14 +1640,14 @@ struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
        int err;
        struct net_device *dev;
        unsigned int num_queues = 1;
-       unsigned int real_num_queues = 1;
 
        if (ops->get_tx_queues) {
-               err = ops->get_tx_queues(src_net, tb, &num_queues,
-                                        &real_num_queues);
-               if (err)
+               err = ops->get_tx_queues(src_net, tb);
+               if (err < 0)
                        goto err;
+               num_queues = err;
        }
+
        err = -ENOMEM;
        dev = alloc_netdev_mq(ops->priv_size, ifname, ops->setup, num_queues);
        if (!dev)