[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v1 1/2] xen/page_alloc: address violation of Rule 14.3
From: Federico Serafini <federico.serafini@xxxxxxxxxxx> MISRA C Rule 14.3 states that "Controlling expressions shall not be invariant". Add a SAF comment to deviate the rule for build configurations without CONFIG_LLC_COLORING enabled. Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx> Signed-off-by: Victor Lira <victorm.lira@xxxxxxx> --- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx> Cc: Michal Orzel <michal.orzel@xxxxxxx> Cc: Jan Beulich <jbeulich@xxxxxxxx> Cc: Julien Grall <julien@xxxxxxx> Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx> Cc: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> Cc: Federico Serafini <federico.serafini@xxxxxxxxxxx> Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx> --- docs/misra/safe.json | 8 ++++++++ xen/common/page_alloc.c | 1 + 2 files changed, 9 insertions(+) diff --git a/docs/misra/safe.json b/docs/misra/safe.json index e3489dba8e..9438815d19 100644 --- a/docs/misra/safe.json +++ b/docs/misra/safe.json @@ -116,6 +116,14 @@ }, { "id": "SAF-14-safe", + "analyser": { + "eclair": "MC3A2.R14.3" + }, + "name": "Rule 14.3: loop controlling expression is invariant due to the build configuration", + "text": "The controlling expression of a loop can be invariant in a specific build configuration." + }, + { + "id": "SAF-15-safe", "analyser": {}, "name": "Sentinel", "text": "Next ID to be used" diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index bd4538c28d..6d6ca7ca50 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -2038,6 +2038,7 @@ static struct page_info *alloc_color_heap_page(unsigned int memflags, spin_lock(&heap_lock); + /* SAF-14-safe MISRA C R14.3 condition always false without LLC_COLORING */ for ( i = 0; i < domain_num_llc_colors(d); i++ ) { unsigned long free = free_colored_pages[domain_llc_color(d, i)]; -- 2.47.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |