[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/compiler: address violation of MISRA C Rule 20.9



commit c079823df64c98dd7bb40fe77d9ef410e85a7624
Author:     Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
AuthorDate: Mon Apr 8 09:23:15 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Apr 8 09:23:15 2024 +0200

    xen/compiler: address violation of MISRA C Rule 20.9
    
    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@xxxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/include/xen/compiler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index fc87a2edad..179ff23e62 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -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
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.