From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5ACDD233933 for ; Tue, 30 Jun 2026 21:33:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782855233; cv=none; b=Xd0F5+h5IDLVAF2VRUWzD1TSfPSahMqQXiCFtCDJi5aro0h0Tg3nnALrRDBu/Ol667p3anWDZ8J7wPA9JTQHGxR8sQ9OoQ5tH1Ceuq2mEXA+wfl3m+QTWZBhikfQFq63ifU5/PsRFr26Os993Dn1IVGG9Vmlt+JzGW+5GN9Lrlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782855233; c=relaxed/simple; bh=7P5AGdyX9U2FgOtXbK8aoEINUpNsnYeYDub1cigFpDU=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=BreDh0yFMHZQimMFPD7S7MKq0kxvRuCBb3CGw+hy+PhZmf+Nz9n206WFr6m5F2m+hWLYQilR8//0lCMWJX1zGAuD9rGUaVKKNPLMptn+0E8J1fHkncAkJAdv9nZvUQStjEs3oBb5BV6O9p9XLEQtmV5Fg0AXMv8YtcGUxv2ZH54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=IyQXUV6E; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--dmatlack.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IyQXUV6E" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c88da04b71dso2598791a12.3 for ; Tue, 30 Jun 2026 14:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782855232; x=1783460032; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=z7X3kTpmZ4bguf8y7uJQ1FnujZXkLnCFBhY8iEZTYJQ=; b=IyQXUV6EY0P8lRjGXEyiLAd745IsGJ5DePrcN7PY0Ezhqf/S6+MbjAtQulldLdUbQF 4x8KVGcvUzn7r4mXekHjbTm+EUU9r30VB2/Zzwsu7RO7y3Sftu1SFo7V6ywPJRDRjJ0H +YCxUnt7muvn8N7qSBhPZPBobaBJf5AAMsGc3oNQGYVkROukkWWXhBYYZYVRukLotZKd v5SP60a00uz+dSYp7V5maf0VS7A+rmWMrLPHJm2iW5TcSTaB2raihqtbb1DiQwfdLwQL MM7BaHD04z4D6uNBUwCMynk2zxgoILaGXNxwUXRetXPzH450hNnTF7hcQOPDJGbc9f7V 198Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782855232; x=1783460032; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=z7X3kTpmZ4bguf8y7uJQ1FnujZXkLnCFBhY8iEZTYJQ=; b=VpebnvtPmvfuE30fcKjDGjCV9IcSlEuGy7xaAFh8PI3zNLvzX59D6ddeepr8UiCi0F ZtoYV/QXRdOzkfCeQEijUC5cKVx0kSh5iGZvMdIMHLECQTEdPRSk7cin4pFa3Cq3sKlr 3Rlk9xg0Kdie16+n7poXrImk2Ohy2kN5+r19ae9tgp4Yo1uQWHILAC8jmAEoLNtIi6KZ UFl1IbsUQscVcB2UtndMHxeAI5cKLhnIV1RxUVPnVZlkNyAtLnAAuWvgiXGOT0eyVGzF FE5jKIW4BYktNixRZRggat3mVD3/pQijTN8hyg4t/2Q3nQjd8ksXUdNl5uX+gHHNapv1 8/vQ== X-Gm-Message-State: AOJu0YwaQZ+OTe2n6fhr47enLuqReKMxCVy3bECffC1w3bD/DHG6QL5g VwuhQUJUkZ1Wn7RqhxJtxQxTc+IZRDcdR2vDKu6N36Y8FqqbWRPQKwD5SiqpryTTv74kPM/+IXB 8IvokjIX9PuwiYE30SO1iOZ0DviPhc1F5IuMw1eEUO+PjERpQCQuPjRiSJrtwSNxHHF7rAK7vTQ yKJJE9r+BjvqlDzRKvqbF+tIXaSL7JIpCFdCD++ZFwGfAGGeZfOPctnD4= X-Received: from pgq38.prod.google.com ([2002:a63:1066:0:b0:c86:5f41:8c94]) (user=dmatlack job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:62c4:b0:3bf:49c8:f73 with SMTP id adf61e73a8af0-3bfc52b1d7emr4595479637.35.1782855231357; Tue, 30 Jun 2026 14:33:51 -0700 (PDT) Date: Tue, 30 Jun 2026 21:33:41 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog Message-ID: <20260630213341.1664345-1-dmatlack@google.com> Subject: [PATCH] selftests: harness: Mark test fixture objects __maybe_unused From: David Matlack To: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev Cc: Alex Williamson , Andy Lutomirski , Bill Wendling , David Matlack , Justin Stitt , Kees Cook , Nathan Chancellor , Nick Desaulniers , Raghavendra Rao Ananta , Shuah Khan , Vipin Sharma , Will Drewry , Aaron Lewis Content-Type: text/plain; charset="UTF-8" Mark test fixture objects __maybe_unused since they will not be used when there are fixture variants (the variants will be used instead). This fixes the VFIO selftest build with clang and -Werror: vfio_dma_mapping_mmio_test.c:106:1: error: variable '_vfio_dma_mapping_mmio_test_map_full_bar_object' set but not used [-Werror,-Wunused-but-set-global] 106 | TEST_F(vfio_dma_mapping_mmio_test, map_full_bar) | ^ ./../kselftest_harness.h:398:2: note: expanded from macro 'TEST_F' 398 | __TEST_F_IMPL(fixture_name, test_name, -1, TEST_TIMEOUT_DEFAULT) | ^ ./../kselftest_harness.h:470:33: note: expanded from macro '__TEST_F_IMPL' 470 | static struct __test_metadata *_##fixture_name##_##test_name##_object; \ | Fixes: ff556bd98348 ("vfio: selftests: Add -Wall and -Werror to the Makefile") Reported-by: Aaron Lewis Signed-off-by: David Matlack --- tools/testing/selftests/kselftest_harness.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 261e4df94d9d..29a19bc87084 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -467,7 +467,7 @@ static inline void __kselftest_memset_safe(void *s, int c, size_t n) !__atomic_test_and_set(_metadata->no_teardown, __ATOMIC_RELAXED)) \ fixture_name##_teardown(_metadata, self, variant); \ } \ - static struct __test_metadata *_##fixture_name##_##test_name##_object; \ + static struct __test_metadata *_##fixture_name##_##test_name##_object __maybe_unused; \ static void __attribute__((constructor(KSELFTEST_PRIO_TEST))) \ _register_##fixture_name##_##test_name(void) \ { \ base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482 -- 2.55.0.rc0.799.gd6f94ed593-goog