Skip to content

Commit 743dea7

Browse files
committed
net: ethtool: store netdev in a temp variable in ethnl_default_set_doit()
For ease of review of the next patch store the dev pointer on the stack, instead of referring to req_info.dev every time. No functional changes. Reviewed-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3c83645 commit 743dea7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

net/ethtool/netlink.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ static int ethnl_default_set_doit(struct sk_buff *skb, struct genl_info *info)
667667
const struct ethnl_request_ops *ops;
668668
struct ethnl_req_info req_info = {};
669669
const u8 cmd = info->genlhdr->cmd;
670+
struct net_device *dev;
670671
int ret;
671672

672673
ops = ethnl_default_requests[cmd];
@@ -688,19 +689,21 @@ static int ethnl_default_set_doit(struct sk_buff *skb, struct genl_info *info)
688689
goto out_dev;
689690
}
690691

692+
dev = req_info.dev;
693+
691694
rtnl_lock();
692-
ret = ethnl_ops_begin(req_info.dev);
695+
ret = ethnl_ops_begin(dev);
693696
if (ret < 0)
694697
goto out_rtnl;
695698

696699
ret = ops->set(&req_info, info);
697700
if (ret <= 0)
698701
goto out_ops;
699-
ethtool_notify(req_info.dev, ops->set_ntf_cmd, NULL);
702+
ethtool_notify(dev, ops->set_ntf_cmd, NULL);
700703

701704
ret = 0;
702705
out_ops:
703-
ethnl_ops_complete(req_info.dev);
706+
ethnl_ops_complete(dev);
704707
out_rtnl:
705708
rtnl_unlock();
706709
out_dev:

0 commit comments

Comments
 (0)