diff options
| author | Cosmin Ratiu <cratiu@nvidia.com> | 2026-07-01 10:32:43 +0300 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-07-07 11:31:26 +0200 |
| commit | e48abacd6e831450f6a45dde00809ae01cf1fc85 (patch) | |
| tree | 33d1baa514e25adf1bc5d4aa20e6912ae855b40b /net/devlink/netlink.c | |
| parent | 9f2d908cc34e5aa118aa341480faca2314b49438 (diff) | |
devlink: Migrate from info->user_ptr to info->ctx
Replace deprecated info->user_ptr[0]/[1] with a typed
devlink_nl_ctx struct stored in info->ctx. The struct aliases
the same union memory, so the migration is safe.
There are no functionality changes here.
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260701073254.754518-4-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/devlink/netlink.c')
| -rw-r--r-- | net/devlink/netlink.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/devlink/netlink.c b/net/devlink/netlink.c index ae4afc739678..f0a857e286bc 100644 --- a/net/devlink/netlink.c +++ b/net/devlink/netlink.c @@ -252,18 +252,18 @@ static int __devlink_nl_pre_doit(struct sk_buff *skb, struct genl_info *info, if (IS_ERR(devlink)) return PTR_ERR(devlink); - info->user_ptr[0] = devlink; + devlink_nl_ctx(info)->devlink = devlink; if (flags & DEVLINK_NL_FLAG_NEED_PORT) { devlink_port = devlink_port_get_from_info(devlink, info); if (IS_ERR(devlink_port)) { err = PTR_ERR(devlink_port); goto unlock; } - info->user_ptr[1] = devlink_port; + devlink_nl_ctx(info)->devlink_port = devlink_port; } else if (flags & DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT) { devlink_port = devlink_port_get_from_info(devlink, info); if (!IS_ERR(devlink_port)) - info->user_ptr[1] = devlink_port; + devlink_nl_ctx(info)->devlink_port = devlink_port; } return 0; @@ -304,7 +304,7 @@ static void __devlink_nl_post_doit(struct sk_buff *skb, struct genl_info *info, bool dev_lock = flags & DEVLINK_NL_FLAG_NEED_DEV_LOCK; struct devlink *devlink; - devlink = info->user_ptr[0]; + devlink = devlink_nl_ctx(info)->devlink; devl_dev_unlock(devlink, dev_lock); devlink_put(devlink); } |
