|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH] xen: fixed violations of MISRA C:2012 Rule 3.1
Hi, On 13/06/2023 09:27, Jan Beulich wrote: On 13.06.2023 09:42, Nicola Vetrini wrote:The xen sources contain several violations of Rule 3.1 from MISRA C:2012, whose headline states: "The character sequences '/*' and '//' shall not be used within a comment". Most of the violations are due to the presence of links to webpages within C-style comment blocks, such as: xen/arch/arm/include/asm/smccc.h:37.1-41.3 /* * This file provides common defines for ARM SMC Calling Convention as * specified in * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html */ In this case, we propose to deviate all of these occurrences with a project deviation to be captured by a tool configuration. There are, however, a few other violations that do not fall under this category, namely: 1. in file "xen/arch/arm/include/asm/arm64/flushtlb.h" we propose to avoid the usage of a nested comment; 2. in file "xen/common/xmalloc_tlsf.c" we propose to substitute the commented-out if statement with a "#if 0 .. #endif; 3. in file "xen/include/xen/atomic.h" and "xen/drivers/passthrough/arm/smmu-v3.c" we propose to split the C-style comment containing the nested comment into two doxygen comments, clearly identifying the second as a code sample. This can then be captured with a project deviation by a tool configuration. Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> --- Changes: - Resending the patch with the right maintainers in CC.But without otherwise addressing comments already given, afaics. One more remark: I actually dislike the proposal. In this case, the code is meant to look like assembly code. I would replace the // with ;. Also, I would like to keep the comment style in sync in arm32/flushtlb.h. So can this be updated as well? Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |