[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251027133926.218500-1-dmantipov@yandex.ru>
Date: Mon, 27 Oct 2025 16:39:26 +0300
From: Dmitry Antipov <dmantipov@...dex.ru>
To: James Morse <james.morse@....com>
Cc: Tony Luck <tony.luck@...el.com>,
Reinette Chatre <reinette.chatre@...el.com>,
linux-kernel@...r.kernel.org,
Dmitry Antipov <dmantipov@...dex.ru>
Subject: [PATCH] fs/resctrl: avoid redundant call to strlen() in schemata_list_add()
Since 'snprintf()' returns the number of characters emitted and an
overflow case is handled explicitly, an extra call to 'strlen()' in
'schemata_list_add()' may be dropped. Compile tested only.
Signed-off-by: Dmitry Antipov <dmantipov@...dex.ru>
---
fs/resctrl/rdtgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 0320360cd7a6..6f6ef6c4cac3 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2646,7 +2646,7 @@ static int schemata_list_add(struct rdt_resource *r, enum resctrl_conf_type type
return -EINVAL;
}
- cl = strlen(s->name);
+ cl = ret;
/*
* If CDP is supported by this resource, but not enabled,
--
2.51.0
Powered by blists - more mailing lists