IB/ipoib: Remove unnecessary returned value check
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 1483522018-4669-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Hi, Yuval Shaia && Leon Romanovsky && Maintainers
Follow your advice, a new patch is made. Please check it.
Thanks a lot.
Zhu Yanjun
Quoted 67 lines · Zhu Yanjun
In the function
ipoib_set_dev_features, the returned value is always 0. As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.Reviewed-by Guanglei Li <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>---
Change from v1 to v2:
make change to__ipoib_vlan_add.
change the commit header.drivers/infiniband/ulp/ipoib/ipoib.h | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++------ drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-)drivers/infiniband/ulp/ipoib/ipoib.h +1
-1@@ -593,7 +593,7 @@ void ipoib_pkey_open(struct ipoib_dev_priv *priv);void ipoib_drain_cq (struct net_device *dev);void ipoib_set_ethtool_ops (struct net_device *dev); -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca); +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca);#define IPOIB_FLAGS_RC 0x80#define IPOIB_FLAGS_UC 0x40drivers/infiniband/ulp/ipoib/ipoib_main.c +2
-6@@ -1984,7 +1984,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)return device_create_file (&dev->dev, &dev_attr_pkey); } -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) { priv->hca_caps = hca->attrs.device_cap_flags;@@ -1996,8 +1996,6 @@ int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) priv->dev->features |= priv->dev->hw_features; } - -return 0 ; } static struct net_device *ipoib_add_port(const char *format,@@ -2037,9 +2035,7 @@ static struct net_device *ipoib_add_port(const char *format, goto device_init_failed; } - result =ipoib_set_dev_features (priv, hca); -if (result) - goto device_init_failed; +ipoib_set_dev_features (priv, hca);/* * Set the full membership bit, so that we join the right drivers/infiniband/ulp/ipoib/ipoib_vlan.c +0
-0
drivers/infiniband/ulp/ipoib/ipoib_vlan.c int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, · line 67
Quoted 10 lines
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +1
-3@@ -61,9 +61,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, priv->parent = ppriv->dev;set_bit (IPOIB_FLAG_SUBINTERFACE , &priv->flags); - result =ipoib_set_dev_features (priv, ppriv->ca); -if (result) - goto err; +ipoib_set_dev_features (priv, ppriv->ca); priv->pkey = pkey;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Zhu Yanjun,
Patch looks fine.
However, the way it is posted makes it hard (maybe impossible) to apply. Suggesting to repost using git send-email.
Yuval
Quoted 71 lines · Yanjun Zhu
Hi, Yuval Shaia && Leon Romanovsky && Maintainers
Follow your advice, a new patch is made. Please check it.
Thanks a lot.
Zhu YanjunQuoted 63 lines · Zhu Yanjun
In the function
ipoib_set_dev_features, the returned value is always 0. As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.Reviewed-by Guanglei Li <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>---
Change from v1 to v2:
make change to__ipoib_vlan_add.
change the commit header.drivers/infiniband/ulp/ipoib/ipoib.h | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++------ drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-)drivers/infiniband/ulp/ipoib/ipoib.h +1
-1@@ -593,7 +593,7 @@ void ipoib_pkey_open(struct ipoib_dev_priv *priv);void ipoib_drain_cq (struct net_device *dev);void ipoib_set_ethtool_ops (struct net_device *dev); -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca); +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca);#define IPOIB_FLAGS_RC 0x80#define IPOIB_FLAGS_UC 0x40drivers/infiniband/ulp/ipoib/ipoib_main.c +2
-6@@ -1984,7 +1984,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)return device_create_file (&dev->dev, &dev_attr_pkey); } -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) { priv->hca_caps = hca->attrs.device_cap_flags;@@ -1996,8 +1996,6 @@ int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) priv->dev->features |= priv->dev->hw_features; } - -return 0 ; } static struct net_device *ipoib_add_port(const char *format,@@ -2037,9 +2035,7 @@ static struct net_device *ipoib_add_port(const char *format, goto device_init_failed; } - result =ipoib_set_dev_features (priv, hca); -if (result) - goto device_init_failed; +ipoib_set_dev_features (priv, hca);/* * Set the full membership bit, so that we join the right drivers/infiniband/ulp/ipoib/ipoib_vlan.c +0
-2@@ -61,9 +61,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, priv->parent = ppriv->dev;set_bit (IPOIB_FLAG_SUBINTERFACE , &priv->flags); - result =ipoib_set_dev_features (priv, ppriv->ca); -if (result)
Quoted 8 lines
drivers/infiniband/ulp/ipoib/ipoib_vlan.c int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, · line 64
Quoted 3 lines
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +1
-1- goto err; +ipoib_set_dev_features (priv, ppriv->ca); priv->pkey = pkey;--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Sorry. My bad. I resend it now.
Zhu Yanjun
Quoted 87 lines · Yuval Shaia
Hi Zhu Yanjun,
Patch looks fine.However, the way it is posted makes it hard (maybe impossible) to apply. Suggesting to repost using git send-email.
Yuval
Quoted 70 lines · Yanjun Zhu
Hi, Yuval Shaia && Leon Romanovsky && Maintainers
Follow your advice, a new patch is made. Please check it.
Thanks a lot.
Zhu YanjunQuoted 62 lines · Zhu Yanjun
In the function
ipoib_set_dev_features, the returned value is always 0. As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.Reviewed-by Guanglei Li <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>---
Change from v1 to v2:
make change to__ipoib_vlan_add.
change the commit header.drivers/infiniband/ulp/ipoib/ipoib.h | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++------ drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-)drivers/infiniband/ulp/ipoib/ipoib.h +1
-1@@ -593,7 +593,7 @@ void ipoib_pkey_open(struct ipoib_dev_priv *priv);void ipoib_drain_cq (struct net_device *dev);void ipoib_set_ethtool_ops (struct net_device *dev); -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca); +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca);#define IPOIB_FLAGS_RC 0x80#define IPOIB_FLAGS_UC 0x40drivers/infiniband/ulp/ipoib/ipoib_main.c +2
-6@@ -1984,7 +1984,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)return device_create_file (&dev->dev, &dev_attr_pkey); } -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) { priv->hca_caps = hca->attrs.device_cap_flags;@@ -1996,8 +1996,6 @@ int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) priv->dev->features |= priv->dev->hw_features; } - -return 0 ; } static struct net_device *ipoib_add_port(const char *format,@@ -2037,9 +2035,7 @@ static struct net_device *ipoib_add_port(const char *format, goto device_init_failed; } - result =ipoib_set_dev_features (priv, hca); -if (result) - goto device_init_failed; +ipoib_set_dev_features (priv, hca);/* * Set the full membership bit, so that we join the right drivers/infiniband/ulp/ipoib/ipoib_vlan.c +0
-1@@ -61,9 +61,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, priv->parent = ppriv->dev;set_bit (IPOIB_FLAG_SUBINTERFACE , &priv->flags); - result =ipoib_set_dev_features (priv, ppriv->ca);Quoted 8 lines
drivers/infiniband/ulp/ipoib/ipoib_vlan.c int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, · line 64
Quoted 4 lines
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +1
-2-if (result) - goto err; +ipoib_set_dev_features (priv, ppriv->ca); priv->pkey = pkey;--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Yanjun Zhu
Hi, Yuval Shaia && Leon Romanovsky && Maintainers
Follow your advice, a new patch is made. Please check it.
How are you sending it? I missed this patch and first version too. Are you sending it with git send-email?
Was your patch catched in patchworks [1]? and linux-rdma mailing list?
Please post it properly, so we will be able to review it and Doug will be able to apply it.
[1] https://patchwork.kernel.org/project/linux-rdma/list/
Thanks
Quoted 72 lines
Thanks a lot.
Zhu YanjunQuoted 66 lines · Zhu Yanjun
In the function
ipoib_set_dev_features, the returned value is always 0. As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.Reviewed-by Guanglei Li <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>---
Change from v1 to v2:
make change to__ipoib_vlan_add.
change the commit header.drivers/infiniband/ulp/ipoib/ipoib.h | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++------ drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-)drivers/infiniband/ulp/ipoib/ipoib.h +1
-1@@ -593,7 +593,7 @@ void ipoib_pkey_open(struct ipoib_dev_priv *priv);void ipoib_drain_cq (struct net_device *dev);void ipoib_set_ethtool_ops (struct net_device *dev); -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca); +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca);#define IPOIB_FLAGS_RC 0x80#define IPOIB_FLAGS_UC 0x40drivers/infiniband/ulp/ipoib/ipoib_main.c +2
-6@@ -1984,7 +1984,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)return device_create_file (&dev->dev, &dev_attr_pkey); } -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) { priv->hca_caps = hca->attrs.device_cap_flags;@@ -1996,8 +1996,6 @@ int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) priv->dev->features |= priv->dev->hw_features; } - -return 0 ; } static struct net_device *ipoib_add_port(const char *format,@@ -2037,9 +2035,7 @@ static struct net_device *ipoib_add_port(const char *format, goto device_init_failed; } - result =ipoib_set_dev_features (priv, hca); -if (result) - goto device_init_failed; +ipoib_set_dev_features (priv, hca);/* * Set the full membership bit, so that we join the right drivers/infiniband/ulp/ipoib/ipoib_vlan.c +1
-3@@ -61,9 +61,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, priv->parent = ppriv->dev;set_bit (IPOIB_FLAG_SUBINTERFACE , &priv->flags); - result =ipoib_set_dev_features (priv, ppriv->ca); -if (result) - goto err; +ipoib_set_dev_features (priv, ppriv->ca); priv->pkey = pkey;
A message that is not in the archive (sent off-list or not yet received): 20170105061236.GV12077-U/[email protected]
PATCH v2 1/1 IB/ipoib: Remove unnecessary returned value check
In the function ipoib_set_dev_features, the returned value is always 0. As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.
---
Change from v1 to v2:
make change to __ipoib_vlan_add.
change the commit header.
drivers/infiniband/ulp/ipoib/ipoib.h | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++------ drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib.h +1 -1
@@ -593,7 +593,7 @@ void ipoib_pkey_open(struct ipoib_dev_priv *priv);void ipoib_drain_cq (struct net_device *dev);void ipoib_set_ethtool_ops (struct net_device *dev); -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca); +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca);#define IPOIB_FLAGS_RC 0x80#define IPOIB_FLAGS_UC 0x40
drivers/infiniband/ulp/ipoib/ipoib_main.c +2 -6
@@ -1984,7 +1984,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)return device_create_file (&dev->dev, &dev_attr_pkey); } -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) { priv->hca_caps = hca->attrs.device_cap_flags;
@@ -1996,8 +1996,6 @@ int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) priv->dev->features |= priv->dev->hw_features; } - -return 0 ; } static struct net_device *ipoib_add_port(const char *format,
@@ -2037,9 +2035,7 @@ static struct net_device *ipoib_add_port(const char *format, goto device_init_failed; } - result =ipoib_set_dev_features (priv, hca); -if (result) - goto device_init_failed; +ipoib_set_dev_features (priv, hca);/* * Set the full membership bit, so that we join the right
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +1 -3
@@ -61,9 +61,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, priv->parent = ppriv->dev;set_bit (IPOIB_FLAG_SUBINTERFACE , &priv->flags); - result =ipoib_set_dev_features (priv, ppriv->ca); -if (result) - goto err; +ipoib_set_dev_features (priv, ppriv->ca); priv->pkey = pkey;
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1483606568-17232-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Yuval Shaia
Reviewed-byQuoted 67 lines · Zhu Yanjun
In the function
ipoib_set_dev_features, the returned value is always 0. As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.Reviewed-by Guanglei Li <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>---
Change from v1 to v2:
make change to__ipoib_vlan_add.
change the commit header.drivers/infiniband/ulp/ipoib/ipoib.h | 2 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++------ drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 4 +--- 3 files changed, 4 insertions(+), 10 deletions(-)drivers/infiniband/ulp/ipoib/ipoib.h +1
-1@@ -593,7 +593,7 @@ void ipoib_pkey_open(struct ipoib_dev_priv *priv);void ipoib_drain_cq (struct net_device *dev);void ipoib_set_ethtool_ops (struct net_device *dev); -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca); +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca);#define IPOIB_FLAGS_RC 0x80#define IPOIB_FLAGS_UC 0x40drivers/infiniband/ulp/ipoib/ipoib_main.c +2
-6@@ -1984,7 +1984,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)return device_create_file (&dev->dev, &dev_attr_pkey); } -int ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) +void ipoib_set_dev_features (struct ipoib_dev_priv *priv,struct ib_device *hca) { priv->hca_caps = hca->attrs.device_cap_flags;@@ -1996,8 +1996,6 @@ int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) priv->dev->features |= priv->dev->hw_features; } - -return 0 ; } static struct net_device *ipoib_add_port(const char *format,@@ -2037,9 +2035,7 @@ static struct net_device *ipoib_add_port(const char *format, goto device_init_failed; } - result =ipoib_set_dev_features (priv, hca); -if (result) - goto device_init_failed; +ipoib_set_dev_features (priv, hca);/* * Set the full membership bit, so that we join the right drivers/infiniband/ulp/ipoib/ipoib_vlan.c +0
-0
drivers/infiniband/ulp/ipoib/ipoib_vlan.c int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, · line 66
Quoted 9 lines
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +1
-3@@ -61,9 +61,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, priv->parent = ppriv->dev;set_bit (IPOIB_FLAG_SUBINTERFACE , &priv->flags); - result =ipoib_set_dev_features (priv, ppriv->ca); -if (result) - goto err; +ipoib_set_dev_features (priv, ppriv->ca); priv->pkey = pkey;
Quoted 8 lines
Signature · 7 lines
-- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Leon Romanovsky
Reviewed-byQuoted 7 lines · Zhu Yanjun
In the function
ipoib_set_dev_features, the returned value is always 0. As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.Reviewed-by Guanglei Li <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>---
Thanks,
A message that is not in the archive (sent off-list or not yet received): 20170105125022.GA15685-U/[email protected]
Doug Ledford
AppliedQuoted 7 lines · Leon Romanovsky
Quoted 6 lines · Zhu Yanjun
In the function
ipoib_set_dev_features, the returned value is always 0.
As such, it is not necessary to check the returned value. This is not a bug. It is a trivial problem.
Quoted 6 lines
Quoted 3 lines
Reviewed-by Guanglei Li <[email protected]>Signed-off-by Zhu Yanjun <[email protected]>---
Thanks,
Thanks, applied to -next area.
Signature · 4 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD