Re: [PATCH v1 01/10] compiler-context-analysis: Avoid unused parameter warning in _context_unsafe_alias()
From: Bart Van Assche
Date: Tue Oct 13 2026 - 18:15:08 EST
On 10/13/26 3:10 PM, Ian Rogers wrote:
On Tue, Oct 13, 2026 at 12:44 PM Bart Van Assche <bvanassche@xxxxxxx> wrote:
On 10/13/26 11:24 AM, Ian Rogers wrote:
diff --git a/include/linux/compiler-context-analysis.h b/include/linux/compiler-context-analysis.h
index 8302ebc2ea8c..024e303188ad 100644
--- a/include/linux/compiler-context-analysis.h
+++ b/include/linux/compiler-context-analysis.h
@@ -243,7 +243,7 @@
* alias as a function argument).
*/
#define context_unsafe_alias(p) _context_unsafe_alias((void **)&(p))
-static inline void _context_unsafe_alias(void **p) { }
+static inline void _context_unsafe_alias(void **p) { (void)p; }
Why a void cast instead of __attribute__((unused))?
I agree; unfortunately, the macro isn't declared before this header
change needs it and I wanted to minimize the change.
Hmm ... as far as I know __attribute__() is not a macro.
Thanks,
Bart.