Re: [PATCH net-next v1] devlink: Simplify devlink resources unregister call
From: Jakub Kicinski
Date: Mon Nov 29 2021 - 23:14:08 EST
On Sun, 28 Nov 2021 14:42:44 +0200 Leon Romanovsky wrote:
> The devlink_resources_unregister() used second parameter as an
> entry point for the recursive removal of devlink resources. None
> of external to devlink users needed to use this field, so lat's
None of the callers outside of devlink core...
s/lat/let/
> remove it.
> diff --git a/include/net/devlink.h b/include/net/devlink.h
> index e3c88fabd700..043fcec8b0aa 100644
> --- a/include/net/devlink.h
> +++ b/include/net/devlink.h
> @@ -361,33 +361,6 @@ devlink_resource_size_params_init(struct devlink_resource_size_params *size_para
>
> typedef u64 devlink_resource_occ_get_t(void *priv);
>
> -/**
> - * struct devlink_resource - devlink resource
> - * @name: name of the resource
> - * @id: id, per devlink instance
> - * @size: size of the resource
> - * @size_new: updated size of the resource, reload is needed
> - * @size_valid: valid in case the total size of the resource is valid
> - * including its children
> - * @parent: parent resource
> - * @size_params: size parameters
> - * @list: parent list
> - * @resource_list: list of child resources
> - */
> -struct devlink_resource {
> - const char *name;
> - u64 id;
> - u64 size;
> - u64 size_new;
> - bool size_valid;
> - struct devlink_resource *parent;
> - struct devlink_resource_size_params size_params;
> - struct list_head list;
> - struct list_head resource_list;
> - devlink_resource_occ_get_t *occ_get;
> - void *occ_get_priv;
> -};
> diff --git a/net/core/devlink.c b/net/core/devlink.c
> index fd21022145a3..db3b52110cf2 100644
> --- a/net/core/devlink.c
> +++ b/net/core/devlink.c
> @@ -69,6 +69,35 @@ struct devlink {
> char priv[] __aligned(NETDEV_ALIGN);
> };
>
> +/**
> + * struct devlink_resource - devlink resource
> + * @name: name of the resource
> + * @id: id, per devlink instance
> + * @size: size of the resource
> + * @size_new: updated size of the resource, reload is needed
> + * @size_valid: valid in case the total size of the resource is valid
> + * including its children
> + * @parent: parent resource
> + * @size_params: size parameters
> + * @list: parent list
> + * @resource_list: list of child resources
> + * @occ_get: occupancy getter callback
> + * @occ_get_priv: occupancy getter callback priv
> + */
> +struct devlink_resource {
> + const char *name;
> + u64 id;
> + u64 size;
> + u64 size_new;
> + bool size_valid;
> + struct devlink_resource *parent;
> + struct devlink_resource_size_params size_params;
> + struct list_head list;
> + struct list_head resource_list;
> + devlink_resource_occ_get_t *occ_get;
> + void *occ_get_priv;
> +};
Hiding struct devlink_resource is not mentioned in the commit message
and entirely unrelated to removal of the unused argument.