summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2023-12-15 17:04:50 +0200
committerShuah Khan <skhan@linuxfoundation.org>2024-02-13 13:56:43 -0700
commit348139384ba30eccd4ce4f01fcf575b08ce81b83 (patch)
treef27ad47e0946ea0f80f2a2a65e3ca6a715909423
parentbcd8a929a5387178d917da785896e53b0845ab37 (diff)
downloadlinux-stable-348139384ba30eccd4ce4f01fcf575b08ce81b83.tar.gz
linux-stable-348139384ba30eccd4ce4f01fcf575b08ce81b83.tar.bz2
linux-stable-348139384ba30eccd4ce4f01fcf575b08ce81b83.zip
selftests/resctrl: Change function comments to say < 0 on error
A number function comments state the function return non-zero on failure but in reality they can only return 0 on success and < 0 on error. Update the comments to say < 0 on error to match the behavior. While at it, improve cat_val() comment to state that 0 means the test was run (either pass or fail). Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rw-r--r--tools/testing/selftests/resctrl/cache.c2
-rw-r--r--tools/testing/selftests/resctrl/resctrlfs.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c
index 6d60a2f1b3aa..a9a0394b3d08 100644
--- a/tools/testing/selftests/resctrl/cache.c
+++ b/tools/testing/selftests/resctrl/cache.c
@@ -206,7 +206,7 @@ int measure_cache_vals(struct resctrl_val_param *param, int bm_pid)
* @param: parameters passed to cache_val()
* @span: buffer size for the benchmark
*
- * Return: 0 on success. non-zero on failure.
+ * Return: 0 when the test was run, < 0 on error.
*/
int cat_val(struct resctrl_val_param *param, size_t span)
{
diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
index 5fb595ed8843..81d1e043e17a 100644
--- a/tools/testing/selftests/resctrl/resctrlfs.c
+++ b/tools/testing/selftests/resctrl/resctrlfs.c
@@ -56,7 +56,7 @@ static int find_resctrl_mount(char *buffer)
* Mounts resctrl FS. Fails if resctrl FS is already mounted to avoid
* pre-existing settings interfering with the test results.
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, < 0 on error.
*/
int mount_resctrlfs(void)
{
@@ -276,7 +276,7 @@ int get_core_sibling(int cpu_no)
* @bm_pid: PID that should be binded
* @cpu_no: CPU number at which the PID would be binded
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, < 0 on error.
*/
int taskset_benchmark(pid_t bm_pid, int cpu_no)
{
@@ -300,7 +300,7 @@ int taskset_benchmark(pid_t bm_pid, int cpu_no)
* @grp: Full path and name of the group
* @parent_grp: Full path and name of the parent group
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, < 0 on error.
*/
static int create_grp(const char *grp_name, char *grp, const char *parent_grp)
{
@@ -376,7 +376,7 @@ static int write_pid_to_tasks(char *tasks, pid_t pid)
* pid is not written, this means that pid is in con_mon grp and hence
* should consult con_mon grp's mon_data directory for results.
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, < 0 on error.
*/
int write_bm_pid_to_resctrl(pid_t bm_pid, char *ctrlgrp, char *mongrp,
char *resctrl_val)
@@ -435,7 +435,7 @@ out:
* Update schemata of a con_mon grp *only* if requested resctrl feature is
* allocation type
*
- * Return: 0 on success, non-zero on failure
+ * Return: 0 on success, < 0 on error.
*/
int write_schemata(char *ctrlgrp, char *schemata, int cpu_no, char *resctrl_val)
{