Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

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>

authored by

Simon Horman and committed by
Jakub Kicinski
743ff021 f9c141fc

+3 -4
+1 -1
net/ethtool/linkinfo.c
··· 35 35 if (ret < 0) 36 36 return ret; 37 37 ret = __ethtool_get_link_ksettings(dev, &data->ksettings); 38 - if (ret < 0 && info) 38 + if (ret < 0) 39 39 GENL_SET_ERR_MSG(info, "failed to retrieve link settings"); 40 40 ethnl_ops_complete(dev); 41 41
+1 -1
net/ethtool/linkmodes.c
··· 40 40 return ret; 41 41 42 42 ret = __ethtool_get_link_ksettings(dev, &data->ksettings); 43 - if (ret < 0 && info) { 43 + if (ret < 0) { 44 44 GENL_SET_ERR_MSG(info, "failed to retrieve link settings"); 45 45 goto out; 46 46 }
+1 -2
net/ethtool/strset.c
··· 289 289 for (i = 0; i < ETH_SS_COUNT; i++) { 290 290 if ((req_info->req_ids & (1U << i)) && 291 291 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"); 294 293 return -EINVAL; 295 294 } 296 295 }