mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ethtool: Don't check for NULL info in prepare_data callbacks
Since commit f946270d05
("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>
Link: https://patch.msgid.link/20240731-prepare_data-null-check-v1-1-627f2320678f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
f9c141fc33
commit
743ff02152
3 changed files with 3 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue