]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/compiler: address violation of MISRA C Rule 20.9
authorNicola Vetrini <nicola.vetrini@bugseng.com>
Mon, 8 Apr 2024 07:23:15 +0000 (09:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Apr 2024 07:23:15 +0000 (09:23 +0200)
The rule states:
"All identifiers used in the controlling expression of #if or #elif
preprocessing directives shall be #define'd before evaluation".
In this case, using defined(identifier) is a MISRA-compliant
way to achieve the same effect.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/compiler.h

index fc87a2edad7f2d8fda74355f5c4301ad2842d671..179ff23e62c57318b189dd7972d4bd096670b946 100644 (file)
@@ -30,7 +30,7 @@
 
 #define __weak        __attribute__((__weak__))
 
-#if !CONFIG_CC_IS_CLANG || CONFIG_CLANG_VERSION >= 140000
+#if !defined(CONFIG_CC_IS_CLANG) || CONFIG_CLANG_VERSION >= 140000
 # define nocall       __attribute__((__error__("Nonstandard ABI")))
 #else
 # define nocall