selftests/resctrl: Clean up resctrl features check
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user