Skip to contentSkip to conversation

plca.c: fix obvious mistake in checking retval

PATCH Applied Piergiorgio Beruto 3 participants 3 messages Jan 13, 2023 – Jan 14, 2023

Subsystems (5)
lore
Share & tools
lore

Piergiorgio Beruto

author maintainer
#0 lore raw

PATCH v3 1/1 plca.c: fix obvious mistake in checking retval

Revert a wrong fix that was done during the review process. The intention was to substitute "if(ret < 0)" with "if(ret)". Unfortunately, the intended fix did not meet the code. Besides, after additional review, it was decided that "if(ret < 0)" was actually the right thing to do.

Fixes 8580e16c28f3 ("net/ethtool: add netlink interface for the PLCA RS")
---
 net/ethtool/plca.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
net/ethtool/plca.c +5 -5
index d9bb13ffc654..be7404dc9ef2 100644
@@ -61,7 +61,7 @@ static int plca_get_cfg_prepare_data(const struct ethnl_req_info *req_base,
 	}
 
 	ret = ethnl_ops_begin(dev);
-	if (!ret)
+	if (ret < 0)
 		goto out;
 
 	memset(&data->plca_cfg, 0xff,
@@ -151,7 +151,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
 					 tb[ETHTOOL_A_PLCA_HEADER],
 					 genl_info_net(info), info->extack,
 					 true);
-	if (!ret)
+	if (ret < 0)
 		return ret;
 
 	dev = req_info.dev;
@@ -171,7 +171,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
 	}
 
 	ret = ethnl_ops_begin(dev);
-	if (!ret)
+	if (ret < 0)
 		goto out_rtnl;
 
 	memset(&plca_cfg, 0xff, sizeof(plca_cfg));
@@ -189,7 +189,7 @@ int ethnl_set_plca_cfg(struct sk_buff *skb, struct genl_info *info)
 		goto out_ops;
 
 	ret = ops->set_plca_cfg(dev->phydev, &plca_cfg, info->extack);
-	if (!ret)
+	if (ret < 0)
 		goto out_ops;
 
 	ethtool_notify(dev, ETHTOOL_MSG_PLCA_NTF, NULL);
@@ -233,7 +233,7 @@ static int plca_get_status_prepare_data(const struct ethnl_req_info *req_base,
 	}
 
 	ret = ethnl_ops_begin(dev);
-	if (!ret)
+	if (ret < 0)
 		goto out;
 
 	memset(&data->plca_st, 0xff,
Signature · 1 line
2.37.4
Reviewed-by on v3 1/1
#1 lore raw
Quoted 10 lines · Piergiorgio Beruto

Revert a wrong fix that was done during the review process. The intention was to substitute "if(ret < 0)" with "if(ret)". Unfortunately, the intended fix did not meet the code. Besides, after additional review, it was decided that "if(ret < 0)" was actually the right thing to do.

Fixes 8580e16c28f3 ("net/ethtool: add netlink interface for the PLCA RS")
#2 lore raw
In reply to Piergiorgio Beruto
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Fri, 13 Jan 2023 14:26:35 +0100 you wrote:

Revert a wrong fix that was done during the review process. The intention was to substitute "if(ret < 0)" with "if(ret)". Unfortunately, the intended fix did not meet the code. Besides, after additional review, it was decided that "if(ret < 0)" was actually the right thing to do.

Fixes 8580e16c28f3 ("net/ethtool: add netlink interface for the PLCA RS")

[...]

Here is the summary with links:
- [v3,net-next,1/1] plca.c: fix obvious mistake in checking retval

    https://git.kernel.org/netdev/net-next/c/28dbf774bc87

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html