diff options
author | Zhu Yanjun <yanjun.zhu@oracle.com> | 2017-02-02 23:46:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-03 16:25:17 -0500 |
commit | 3d67576da15167b2669e4765ca9e383f6bcb4171 (patch) | |
tree | 75633013cb15f6d18562d68bee6668a2c78f3ef7 /drivers | |
parent | 38ab52e8e1e2dd65f2d349f82553335813b638d2 (diff) |
bonding: Remove unnecessary returned value check
The function bond_info_query alwarys returns 0. As such, in the function
bond_do_ioctl, it is not necessary to check the returned value. So the
interface type of the function bond_info_query is changed to void. The
redundant check is removed.
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 36919221b3f0..e6af04716cf7 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1993,11 +1993,10 @@ static int bond_release_and_destroy(struct net_device *bond_dev, return ret; } -static int bond_info_query(struct net_device *bond_dev, struct ifbond *info) +static void bond_info_query(struct net_device *bond_dev, struct ifbond *info) { struct bonding *bond = netdev_priv(bond_dev); bond_fill_ifbond(bond, info); - return 0; } static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info) @@ -3409,12 +3408,11 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond))) return -EFAULT; - res = bond_info_query(bond_dev, &k_binfo); - if (res == 0 && - copy_to_user(u_binfo, &k_binfo, sizeof(ifbond))) + bond_info_query(bond_dev, &k_binfo); + if (copy_to_user(u_binfo, &k_binfo, sizeof(ifbond))) return -EFAULT; - return res; + return 0; case BOND_SLAVE_INFO_QUERY_OLD: case SIOCBONDSLAVEINFOQUERY: u_sinfo = (struct ifslave __user *)ifr->ifr_data; |