diff options
| author | Fenghua Yu <fenghua.yu@intel.com> | 2021-03-17 05:22:38 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-11 15:47:27 +0300 |
| commit | cd29eef12771fa48c271df13ce88745ff97366d2 (patch) | |
| tree | dadc6a8aec24017d91a4f3c805dea3a9fa6c8dba /tools/testing/selftests/resctrl/resctrl.h | |
| parent | 6ef95f0b80ecbaa05d1c0978b88a7460a721ec3a (diff) | |
| download | linux-cd29eef12771fa48c271df13ce88745ff97366d2.tar.xz | |
selftests/resctrl: Clean up resctrl features check
[ Upstream commit 2428673638ea28fa93d2a38b1c3e8d70122b00ee ]
Checking resctrl features call strcmp() to compare feature strings
(e.g. "mba", "cat" etc). The checkings are error prone and don't have
good coding style. Define the constant strings in macros and call
strncmp() to solve the potential issues.
Suggested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl.h')
| -rw-r--r-- | tools/testing/selftests/resctrl/resctrl.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 12b77182cb44..36da6136af96 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -62,6 +62,11 @@ struct resctrl_val_param { int (*setup)(int num, ...); }; +#define MBM_STR "mbm" +#define MBA_STR "mba" +#define CQM_STR "cqm" +#define CAT_STR "cat" + extern pid_t bm_pid, ppid; extern int tests_run; |
