[tip: x86/cache] fs/resctrl: Drop unnecessary parameter from resctrl_io_alloc_parse_line()

From: tip-bot2 for Reinette Chatre

Date: Mon Nov 09 2026 - 16:31:17 EST


The following commit has been merged into the x86/cache branch of tip:

Commit-ID: 2a93af75384b7e95d62c5a9a39e13573e2170ec5
Gitweb: https://git.kernel.org/tip/2a93af75384b7e95d62c5a9a39e13573e2170ec5
Author: Reinette Chatre <reinette.chatre@xxxxxxxxx>
AuthorDate: Wed, 04 Nov 2026 16:13:33 -08:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Sun, 08 Nov 2026 19:10:41 -08:00

fs/resctrl: Drop unnecessary parameter from resctrl_io_alloc_parse_line()

resctrl_io_alloc_parse_line() parses a line written to the io_alloc_cbm file.
It receives both a schema and a pointer to the schema's resource. Its only
caller looks up the resource from the schema just to pass both.

Passing the resource separately is redundant and allows a caller to pass a
resource that does not belong to the schema. parse_line(), which parses lines
written to the schemata file, already receives only the schema and determines
the resource from it.

Pass only the schema to resctrl_io_alloc_parse_line() and have it determine
the resource itself, matching parse_line() and in preparation for passing
additional information when supporting multiple controls.

No functional change.

Signed-off-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Reviewed-by: Ben Horgan <ben.horgan@xxxxxxx>
Reviewed-by: Chen Yu <yu.c.chen@xxxxxxxxx>
Reviewed-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
Link: https://patch.msgid.link/a1cbad5a426689842502793f21ddb1e9b3b6408d.1793834224.git.reinette.chatre@xxxxxxxxx
---
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 4562072..69123b2 100644
--- a/fs/resctrl/ctrlmondata.c
+++ b/fs/resctrl/ctrlmondata.c
@@ -955,11 +955,12 @@ out_unlock:
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;