Wed, Aug 09, 2023 at 08:26:46PM CEST, kuba@kernel.org wrote:
[...]
quoted hunk ↗ jump to hunk
@@ -41,6 +41,7 @@ netdev_nl_dev_fill(struct net_device *netdev, struct sk_buff *rsp,
static void
netdev_genl_dev_notify(struct net_device *netdev, int cmd)
{
+ GENL_INFO_NTF(info, &netdev_nl_family, cmd);
These macros declaring and defining struct on stack always introduce
some level of obfuscation to the code. Again, as I suggested in the
reply to the previous patch, would it be nicer to have initializer
helper instead? Something like:
struct genl_info info;
genl_info_nft(&info, &netdev_nl_family, cmd);
quoted hunk ↗ jump to hunk
struct sk_buff *ntf;
if (!genl_has_listeners(&netdev_nl_family, dev_net(netdev),
@@ -51,7 +52,7 @@ netdev_genl_dev_notify(struct net_device *netdev, int cmd)
if (!ntf)
return;
- if (netdev_nl_dev_fill(netdev, ntf, 0, 0, 0, cmd)) {
+ if (netdev_nl_dev_fill(netdev, ntf, &info)) {
nlmsg_free(ntf);
return;
}
[...]