public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Reinette Chatre <reinette.chatre@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 1/4] selftests/resctrl: Change initialize_llc_perf() return type to void
Date: Wed,  8 Feb 2023 11:40:23 +0200	[thread overview]
Message-ID: <20230208094026.22529-2-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20230208094026.22529-1-ilpo.jarvinen@linux.intel.com>

initialize_llc_perf() unconditionally does return 0 so no point in
having it's return type as int. Hence, change it's return type from int
to void.

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>
---
 tools/testing/selftests/resctrl/cache.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c
index 68ff856d36f0..4b8ee81aedae 100644
--- a/tools/testing/selftests/resctrl/cache.c
+++ b/tools/testing/selftests/resctrl/cache.c
@@ -48,7 +48,7 @@ static int perf_event_open_llc_miss(pid_t pid, int cpu_no)
 	return 0;
 }
 
-static int initialize_llc_perf(void)
+static void initialize_llc_perf(void)
 {
 	memset(&pea_llc_miss, 0, sizeof(struct perf_event_attr));
 	memset(&rf_cqm, 0, sizeof(struct read_format));
@@ -59,8 +59,6 @@ static int initialize_llc_perf(void)
 	pea_llc_miss.config = PERF_COUNT_HW_CACHE_MISSES;
 
 	rf_cqm.nr = 1;
-
-	return 0;
 }
 
 static int reset_enable_llc_perf(pid_t pid, int cpu_no)
@@ -234,11 +232,8 @@ int cat_val(struct resctrl_val_param *param)
 	if (ret)
 		return ret;
 
-	if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR))) {
-		ret = initialize_llc_perf();
-		if (ret)
-			return ret;
-	}
+	if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR)))
+		initialize_llc_perf();
 
 	/* Test runs until the callback setup() tells the test to stop. */
 	while (1) {
-- 
2.30.2


  reply	other threads:[~2023-02-08  9:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08  9:40 [PATCH 0/4] selftests/resctrl: Small cleanups Ilpo Järvinen
2023-02-08  9:40 ` Ilpo Järvinen [this message]
2023-02-14  0:59   ` [PATCH 1/4] selftests/resctrl: Change initialize_llc_perf() return type to void Reinette Chatre
2023-02-08  9:40 ` [PATCH 2/4] selftests/resctrl: Don't hard code divisor in MBM results Ilpo Järvinen
2023-02-14  0:59   ` Reinette Chatre
2023-02-14 10:00     ` Ilpo Järvinen
2023-02-14 17:01       ` Reinette Chatre
2023-02-08  9:40 ` [PATCH 3/4] selftests/resctrl: Change name from CBM_MASK_PATH to INFO_PATH Ilpo Järvinen
2023-02-08 14:04   ` Ilpo Järvinen
2023-02-14  0:59     ` Reinette Chatre
2023-02-08  9:40 ` [PATCH 4/4] selftests/resctrl: Use remount_resctrlfs() consistently with boolean Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230208094026.22529-2-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox