public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: coco: mark cc_mask as __maybe_unused
@ 2025-03-04 14:33 Arnd Bergmann
  2025-03-04 19:55 ` Sathyanarayanan Kuppuswamy
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Arnd Bergmann @ 2025-03-04 14:33 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	Kuppuswamy Sathyanarayanan, Rick Edgecombe, Kirill A. Shutemov,
	Tom Lendacky
  Cc: Arnd Bergmann, H. Peter Anvin, Jason A. Donenfeld, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

When extra warnings are enabled, the cc_mask definition in asm/coco.h
causes a build failure with gcc:

arch/x86/include/asm/coco.h:28:18: error: 'cc_mask' defined but not used [-Werror=unused-const-variable=]
   28 | static const u64 cc_mask = 0;

Mark this one as __maybe_unused.

Fixes: a0a8d15a798b ("x86/tdx: Preserve shared bit on mprotect()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/include/asm/coco.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/coco.h b/arch/x86/include/asm/coco.h
index aa6c8f8ca958..9e9204cfca6f 100644
--- a/arch/x86/include/asm/coco.h
+++ b/arch/x86/include/asm/coco.h
@@ -25,7 +25,7 @@ u64 cc_mkdec(u64 val);
 void cc_random_init(void);
 #else
 #define cc_vendor (CC_VENDOR_NONE)
-static const u64 cc_mask = 0;
+static const __maybe_unused u64 cc_mask = 0;
 
 static inline u64 cc_mkenc(u64 val)
 {
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-03-10 13:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04 14:33 [PATCH] x86: coco: mark cc_mask as __maybe_unused Arnd Bergmann
2025-03-04 19:55 ` Sathyanarayanan Kuppuswamy
2025-03-05  9:02 ` Kirill A. Shutemov
2025-03-05 10:44 ` Ingo Molnar
2025-03-05 22:17   ` Borislav Petkov
2025-03-05 22:20     ` Borislav Petkov
2025-03-05 22:45       ` Arnd Bergmann
2025-03-05 22:50         ` Borislav Petkov
2025-03-06  5:38           ` Huang, Kai
2025-03-10 13:10           ` Arnd Bergmann
2025-03-10 13:50   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox