Skip to content

Commit 743ff02

Browse files
hormskuba-moo
authored andcommitted
ethtool: Don't check for NULL info in prepare_data callbacks
Since commit f946270 ("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/[email protected]/ Signed-off-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f9c141f commit 743ff02

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

net/ethtool/linkinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static int linkinfo_prepare_data(const struct ethnl_req_info *req_base,
3535
if (ret < 0)
3636
return ret;
3737
ret = __ethtool_get_link_ksettings(dev, &data->ksettings);
38-
if (ret < 0 && info)
38+
if (ret < 0)
3939
GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
4040
ethnl_ops_complete(dev);
4141

net/ethtool/linkmodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static int linkmodes_prepare_data(const struct ethnl_req_info *req_base,
4040
return ret;
4141

4242
ret = __ethtool_get_link_ksettings(dev, &data->ksettings);
43-
if (ret < 0 && info) {
43+
if (ret < 0) {
4444
GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
4545
goto out;
4646
}

net/ethtool/strset.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ static int strset_prepare_data(const struct ethnl_req_info *req_base,
289289
for (i = 0; i < ETH_SS_COUNT; i++) {
290290
if ((req_info->req_ids & (1U << i)) &&
291291
data->sets[i].per_dev) {
292-
if (info)
293-
GENL_SET_ERR_MSG(info, "requested per device strings without dev");
292+
GENL_SET_ERR_MSG(info, "requested per device strings without dev");
294293
return -EINVAL;
295294
}
296295
}

0 commit comments

Comments
 (0)