diff mbox series

[v3,net-next,1/1] plca.c: fix obvious mistake in checking retval

Message ID f2277af8951a51cfee2fb905af8d7a812b7beaf4.1673616357.git.piergiorgio.beruto@gmail.com (mailing list archive)
State Accepted
Commit 28dbf774bc879c1841d58cb711aaea6198955b95
Delegated to: Netdev Maintainers
Headers show
Series [v3,net-next,1/1] plca.c: fix obvious mistake in checking retval | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1 this patch: 1
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 40 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Piergiorgio Beruto Jan. 13, 2023, 1:26 p.m. UTC
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")
Signed-off-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 net/ethtool/plca.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Eric Dumazet Jan. 13, 2023, 1:32 p.m. UTC | #1
On Fri, Jan 13, 2023 at 2:26 PM Piergiorgio Beruto
<piergiorgio.beruto@gmail.com> 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")
> Signed-off-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Eric Dumazet <edumazet@google.com>
patchwork-bot+netdevbpf@kernel.org Jan. 14, 2023, 5:50 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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")
> Signed-off-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> 
> [...]

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!
diff mbox series

Patch

diff --git a/net/ethtool/plca.c b/net/ethtool/plca.c
index d9bb13ffc654..be7404dc9ef2 100644
--- a/net/ethtool/plca.c
+++ b/net/ethtool/plca.c
@@ -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,