Re: [PATCH 5/5] fs/resctrl: Drop unnecessary parameter from resctrl_io_alloc_parse_line()
From: Ben Horgan
Date: Mon Sep 07 2026 - 05:25:28 EST
Hi Reinette,
On 03/09/2026 17:57, Reinette Chatre wrote:
> resctrl_io_alloc_parse_line() only has one caller that determines the
> resource via resctrl_schema::res and then passes a pointer to the resource
> as well as struct resctrl_schema.
>
> Only pass pointer to struct resctrl_schema. resctrl_io_alloc_parse_line()
> can determine the resource itself.
Nit: Without taking into account that a resource is going to support multiple controls in the future
this change feels a little under justified. Perhaps any extra line in the commit message is warranted.
Regardless, this looks good to me.
Reviewed-by: Ben Horgan <ben.horgan@xxxxxxx>
Thanks,
Ben
>
> Signed-off-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
> ---
> Changes since RFC v2:
> - Rework changelog.
> ---
> fs/resctrl/ctrlmondata.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c
> index 4562072b8ba6..69123b2a3274 100644
> --- a/fs/resctrl/ctrlmondata.c
> +++ b/fs/resctrl/ctrlmondata.c
> @@ -955,11 +955,12 @@ int resctrl_io_alloc_cbm_show(struct kernfs_open_file *of, struct seq_file *seq,
> return ret;
> }
>
> -static int resctrl_io_alloc_parse_line(char *line, struct rdt_resource *r,
> - struct resctrl_schema *s, u32 closid)
> +static int resctrl_io_alloc_parse_line(char *line, struct resctrl_schema *s,
> + u32 closid)
> {
> enum resctrl_conf_type peer_type;
> unsigned long dom_id = ULONG_MAX;
> + struct rdt_resource *r = s->res;
> struct rdt_parse_data data;
> struct rdt_ctrl_domain *d;
> bool update_all = false;
> @@ -1052,7 +1053,7 @@ ssize_t resctrl_io_alloc_cbm_write(struct kernfs_open_file *of, char *buf,
> io_alloc_closid = resctrl_io_alloc_closid(r);
>
> rdt_staged_configs_clear();
> - ret = resctrl_io_alloc_parse_line(buf, r, s, io_alloc_closid);
> + ret = resctrl_io_alloc_parse_line(buf, s, io_alloc_closid);
> if (ret)
> goto out_clear_configs;
>