diff mbox series

[net-next] ethtool: Don't check for NULL info in prepare_data callbacks

Message ID 20240731-prepare_data-null-check-v1-1-627f2320678f@kernel.org (mailing list archive)
State Accepted
Commit 743ff02152bc46bb4a2f2a49ec891c87eba6ab5b
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ethtool: Don't check for NULL info in prepare_data callbacks | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 42 this patch: 42
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: vladimir.oltean@nxp.com jiri@resnulli.us
netdev/build_clang success Errors and warnings before: 43 this patch: 43
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 43 this patch: 43
netdev/checkpatch warning WARNING: line length of 99 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 1 this patch: 1
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-31--12-00 (tests: 707)

Commit Message

Simon Horman July 31, 2024, 9:15 a.m. UTC
Since commit f946270d05c2 ("ethtool: netlink: always pass genl_info to
.prepare_data") the info argument of prepare_data callbacks is never
NULL. Remove checks present in callback implementations.

Link: https://lore.kernel.org/netdev/20240703121237.3f8b9125@kernel.org/
Signed-off-by: Simon Horman <horms@kernel.org>
---
 net/ethtool/linkinfo.c  | 2 +-
 net/ethtool/linkmodes.c | 2 +-
 net/ethtool/strset.c    | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

Comments

Jakub Kicinski Aug. 1, 2024, 1:20 a.m. UTC | #1
On Wed, 31 Jul 2024 10:15:28 +0100 Simon Horman wrote:
> Since commit f946270d05c2 ("ethtool: netlink: always pass genl_info to
> .prepare_data") the info argument of prepare_data callbacks is never
> NULL. Remove checks present in callback implementations.
> 
> Link: https://lore.kernel.org/netdev/20240703121237.3f8b9125@kernel.org/
> Signed-off-by: Simon Horman <horms@kernel.org>

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
patchwork-bot+netdevbpf@kernel.org Aug. 1, 2024, 4:10 p.m. UTC | #2
Hello:

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

On Wed, 31 Jul 2024 10:15:28 +0100 you wrote:
> Since commit f946270d05c2 ("ethtool: netlink: always pass genl_info to
> .prepare_data") the info argument of prepare_data callbacks is never
> NULL. Remove checks present in callback implementations.
> 
> Link: https://lore.kernel.org/netdev/20240703121237.3f8b9125@kernel.org/
> Signed-off-by: Simon Horman <horms@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net-next] ethtool: Don't check for NULL info in prepare_data callbacks
    https://git.kernel.org/netdev/net-next/c/743ff02152bc

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/ethtool/linkinfo.c b/net/ethtool/linkinfo.c
index 5c317d23787b..30b8ce275159 100644
--- a/net/ethtool/linkinfo.c
+++ b/net/ethtool/linkinfo.c
@@ -35,7 +35,7 @@  static int linkinfo_prepare_data(const struct ethnl_req_info *req_base,
 	if (ret < 0)
 		return ret;
 	ret = __ethtool_get_link_ksettings(dev, &data->ksettings);
-	if (ret < 0 && info)
+	if (ret < 0)
 		GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
 	ethnl_ops_complete(dev);
 
diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c
index b2591db49f7d..259cd9ef1f2a 100644
--- a/net/ethtool/linkmodes.c
+++ b/net/ethtool/linkmodes.c
@@ -40,7 +40,7 @@  static int linkmodes_prepare_data(const struct ethnl_req_info *req_base,
 		return ret;
 
 	ret = __ethtool_get_link_ksettings(dev, &data->ksettings);
-	if (ret < 0 && info) {
+	if (ret < 0) {
 		GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
 		goto out;
 	}
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index c678b484a079..56b99606f00b 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -289,8 +289,7 @@  static int strset_prepare_data(const struct ethnl_req_info *req_base,
 		for (i = 0; i < ETH_SS_COUNT; i++) {
 			if ((req_info->req_ids & (1U << i)) &&
 			    data->sets[i].per_dev) {
-				if (info)
-					GENL_SET_ERR_MSG(info, "requested per device strings without dev");
+				GENL_SET_ERR_MSG(info, "requested per device strings without dev");
 				return -EINVAL;
 			}
 		}