All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] bonding: Remove unnecessary returned value check
@ 2017-02-03  4:46 Zhu Yanjun
  2017-02-03 21:25 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhu Yanjun @ 2017-02-03  4:46 UTC (permalink / raw)
  To: j.vosburgh, vfalico, andy, netdev

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>
---
 drivers/net/bonding/bond_main.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8029dd4..6732225 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)
@@ -3411,12 +3410,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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] bonding: Remove unnecessary returned value check
  2017-02-03  4:46 [PATCH 1/1] bonding: Remove unnecessary returned value check Zhu Yanjun
@ 2017-02-03 21:25 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-02-03 21:25 UTC (permalink / raw)
  To: yanjun.zhu; +Cc: j.vosburgh, vfalico, andy, netdev

From: Zhu Yanjun <yanjun.zhu@oracle.com>
Date: Thu,  2 Feb 2017 23:46:21 -0500

> 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>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-03 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-03  4:46 [PATCH 1/1] bonding: Remove unnecessary returned value check Zhu Yanjun
2017-02-03 21:25 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.