selftests/resctrl: Move ->setup() call outside of test specific branches
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 15 Feb 2023 13:05:58 +0000 (15:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:06 +0000 (23:03 +0900)
commit7a570dda1d5a8740fe607a18ae6670f08f03392c
tree366197dab9549c4592803c737463d0b0b087a3c2
parent0bf90aac4341a0e2e0ecdc130b0116e2d448fa9f
selftests/resctrl: Move ->setup() call outside of test specific branches

[ Upstream commit c90b3b588e369c20087699316259fa5ebbb16f2d ]

resctrl_val() function is called only by MBM, MBA, and CMT tests which
means the else branch is never used.

Both test branches call param->setup().

Remove the unused else branch and place the ->setup() call outside of
the test specific branches reducing code duplication.

Co-developed-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
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>
Stable-dep-of: fa10366cc6f4 ("selftests/resctrl: Allow ->setup() to return errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/resctrl/resctrl_val.c