ethtool: Don't check for NULL info in prepare_data callbacks
Subsystems (3)
Simon Horman
reviewerPATCH 1/1 ethtool: Don't check for NULL info in prepare_data callbacks
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.
--- net/ethtool/linkinfo.c | 2 +- net/ethtool/linkmodes.c | 2 +- net/ethtool/strset.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-)
net/ethtool/linkinfo.c +1 -1
@@ -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);
net/ethtool/linkmodes.c +1 -1
@@ -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; }
net/ethtool/strset.c +1 -2
@@ -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 ; } }
Quoted 6 lines · On Wed, 31 Jul 2024 10:15:28 +0100 Simon Horman wrote:
Since commit
f946270d05c2("ethtool: netlink: always passgenl_infoto .prepare_data") the info argument ofprepare_datacallbacks is never NULL. Remove checks present in callback implementations.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 31 Jul 2024 10:15:28 +0100 you wrote:
Since commit
f946270d05c2("ethtool: netlink: always passgenl_infoto .prepare_data") the info argument ofprepare_datacallbacks is never NULL. Remove checks present in callback implementations.Signed-off-by Simon Horman <[email protected]>[...]
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html