From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796148545; b=ENw3w0KdmqoFeR2OWMFGcjX/YCbIWJIN9yG+EubmDzzAIfvBLsMP/joAy5Y3Y3SQ8JnT XNmmeJpAIG+adCP9iSGL1GUlVdVp3kIhW3bMzopzTn4CahooK6BKPVNriDJbu8p1APPdS 4iT2sslFzKi+0jPu6I+CDXc8botKB+imCdCEnTN039yZ9jGecM44dOuTZUvSAThY+lEYs 4IqzTT5RO7fZW5hY+mO0xxQy6QrHS4T81ybVFNVHOfAupuDVQsblDNebvOP41VuTisJd+ 9Ze7zpHmtXkhrYaSoE/dv1TuPgB7WOHkQebCAcozCVgKhvk1vtviu/UKZ2hXSbBhJHQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796148545; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=x1L6ulyYnqfKb91SSK+XYH/31bMPBDJsY3RPLd52JS4=; b=x9iNzVbILE9yhERgXEvmModtOVWunspMHJXWu9OHXUBjuxNoOw5JJyYvu2e8ewzQFb4x HG1Xv1e2IAYMYShWsH4QmGusCLk9FKjGVtxBSiWyeGeWbRJ1N3Ya4cW2EnNx684x2S0TS FIhrJbgJ6SwAjmZrg6xpeEq45OnAkOn5uZY4EMTUUP3LSgR88NFf31qWAlSZg8LQ8snYQ 20lwMv3iqfghRpk6Fe2LnvF50k4BHob1qCWcrDhY4sgL+edSsjAc/htGNRk+TGCP+WQzz xXakFMCHEDM743hhxDakPdVuLy7orOKIZJsemBf12O8WTSsRm4TAFN++lNVflPzIN2g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WoEa1Tbt; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7DD5606A329; Tue, 1 Dec 2026 18:09:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WoEa1Tbt Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2ABC1F00893; Tue, 1 Dec 2026 18:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796148545; bh=x1L6ulyYnqfKb91SSK+XYH/31bMPBDJsY3RPLd52JS4=; h=From:To:Cc:Subject:Date; b=WoEa1TbtT7Qi573PdCDUAQqcm4m1b2NmH0nis+/EoEjyt8fSi2ctU6SX8sVC+WIFY tedfSFCL/ql5uB5dBZwB0uv5yJPWPYzcw3fpLnA/TpO66kvCQVEVhxeoJBiG+/O8Fn AFvesXwTYzrlb8xmAvFFQ/17yWx/4QhUppScN8OXGU0ZqZWq/gz8BqPZqWzgg+1lSZ VYrY2AD/1o+/m4cJz0giVT0TwjKW3tC+KZac4bYOg9mIE0SKyVfKb0VlO5RU3Ba+hg KINT5pa3nqo1AckBZsqga76Jnyvv5gug/iyJwIWa/La9zjxzdPJoPSteaIfZ4ZkZ1z 67o8x5Md9UMpw== From: Sasha Levin To: Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng Cc: Sasha Levin , Thomas Gleixner , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , llvm@lists.linux.dev Subject: [PATCH] selftests/rseq: Mark variables only some builds read as unused Date: Tue, 1 Dec 2026 13:08:53 -0500 Message-ID: <20261201180855.740952-5-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 X-Mailing-List: llvm@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit loop_cnt_1 to loop_cnt_6 are only read by the x86 delay injection assembly, and verbose, opt_signal and signals_delivered only when BENCHMARK is not defined. clang 23 warns about them in the other builds: param_test.c:29:12: warning: variable 'loop_cnt_1' set but not used [-Wunused-but-set-global] param_test.c:36:24: warning: variable 'verbose' set but not used [-Wunused-but-set-global] It warns about loop_cnt_1 to loop_cnt_6 on x86 too, as it does not see the assembly reading them. Mark them unused, like yield_mod_cnt and nr_abort. Signed-off-by: Sasha Levin --- tools/testing/selftests/rseq/param_test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/selftests/rseq/param_test.c index e1e98dbabe4bc..d40f60f62c9e9 100644 --- a/tools/testing/selftests/rseq/param_test.c +++ b/tools/testing/selftests/rseq/param_test.c @@ -26,22 +26,22 @@ static inline pid_t rseq_gettid(void) #define NR_INJECT 9 static int loop_cnt[NR_INJECT + 1]; -static int loop_cnt_1 asm("asm_loop_cnt_1") __attribute__((used)); -static int loop_cnt_2 asm("asm_loop_cnt_2") __attribute__((used)); -static int loop_cnt_3 asm("asm_loop_cnt_3") __attribute__((used)); -static int loop_cnt_4 asm("asm_loop_cnt_4") __attribute__((used)); -static int loop_cnt_5 asm("asm_loop_cnt_5") __attribute__((used)); -static int loop_cnt_6 asm("asm_loop_cnt_6") __attribute__((used)); +static int loop_cnt_1 asm("asm_loop_cnt_1") __attribute__((used, unused)); +static int loop_cnt_2 asm("asm_loop_cnt_2") __attribute__((used, unused)); +static int loop_cnt_3 asm("asm_loop_cnt_3") __attribute__((used, unused)); +static int loop_cnt_4 asm("asm_loop_cnt_4") __attribute__((used, unused)); +static int loop_cnt_5 asm("asm_loop_cnt_5") __attribute__((used, unused)); +static int loop_cnt_6 asm("asm_loop_cnt_6") __attribute__((used, unused)); -static int opt_modulo, verbose; +static int opt_modulo, verbose __attribute__((unused)); -static int opt_yield, opt_signal, opt_sleep, +static int opt_yield, opt_signal __attribute__((unused)), opt_sleep, opt_disable_rseq, opt_threads = 200, opt_disable_mod = 0, opt_test = 's'; static bool opt_rseq_legacy; static long long opt_reps = 5000; -static __thread __attribute__((tls_model("initial-exec"))) +static __thread __attribute__((tls_model("initial-exec"), unused)) unsigned int signals_delivered; #ifndef BENCHMARK -- 2.53.0