diff options
| author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2023-12-15 17:04:48 +0200 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2024-02-13 13:56:43 -0700 |
| commit | c90fba60f274b182f8b4df0f5a5dd23a2457f4a3 (patch) | |
| tree | 81e7dfe61cf36e303183bf4f6eb1c4f3ce16a7c1 /tools/testing/selftests/resctrl/cmt_test.c | |
| parent | cc8ff7f5c85c076297b18fb9f6d45ec5569d3d44 (diff) | |
selftests/resctrl: Return -1 instead of errno on error
A number of functions in the resctrl selftests return errno. It is
problematic because errno is positive which is often counterintuitive.
Also, every site returning errno prints the error message already with
ksft_perror() so there is not much added value in returning the precise
error code.
Simply convert all places returning errno to return -1 that is typical
userspace error code in case of failures.
While at it, improve resctrl_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>
Diffstat (limited to 'tools/testing/selftests/resctrl/cmt_test.c')
| -rw-r--r-- | tools/testing/selftests/resctrl/cmt_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c index 16fc0488e0a5..ffd302bd5c73 100644 --- a/tools/testing/selftests/resctrl/cmt_test.c +++ b/tools/testing/selftests/resctrl/cmt_test.c @@ -39,7 +39,7 @@ static int check_results(struct resctrl_val_param *param, size_t span, int no_of if (!fp) { ksft_perror("Error in opening file"); - return errno; + return -1; } while (fgets(temp, sizeof(temp), fp)) { |