Commit 3d67576d authored by Zhu Yanjun's avatar Zhu Yanjun Committed by David S. Miller

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: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38ab52e8
...@@ -1993,11 +1993,10 @@ static int bond_release_and_destroy(struct net_device *bond_dev, ...@@ -1993,11 +1993,10 @@ static int bond_release_and_destroy(struct net_device *bond_dev,
return ret; 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); struct bonding *bond = netdev_priv(bond_dev);
bond_fill_ifbond(bond, info); bond_fill_ifbond(bond, info);
return 0;
} }
static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *info) 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 ...@@ -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))) if (copy_from_user(&k_binfo, u_binfo, sizeof(ifbond)))
return -EFAULT; return -EFAULT;
res = bond_info_query(bond_dev, &k_binfo); bond_info_query(bond_dev, &k_binfo);
if (res == 0 && if (copy_to_user(u_binfo, &k_binfo, sizeof(ifbond)))
copy_to_user(u_binfo, &k_binfo, sizeof(ifbond)))
return -EFAULT; return -EFAULT;
return res; return 0;
case BOND_SLAVE_INFO_QUERY_OLD: case BOND_SLAVE_INFO_QUERY_OLD:
case SIOCBONDSLAVEINFOQUERY: case SIOCBONDSLAVEINFOQUERY:
u_sinfo = (struct ifslave __user *)ifr->ifr_data; u_sinfo = (struct ifslave __user *)ifr->ifr_data;
......
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