|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC PATCH 0/4] fix some issues related to MISRA C:2012 Rule 9.1
This patch series is aimed at discussing different categories of
patterns concerning local variables that are possibly not
initialized in all code paths, which results in hard-to-prove
correctness. The main categories are as follows:
1. Variables initialized by passing a pointer to them to a function.
Many such functions are coupled with error handling which results
in the variable not being initialized.
2. Some variables are used in switch statements and the control flow
ensures that all code paths do initialize them, but due to the
presence of goto statements, the flow is harder to follow.
I emphasize that, as far as I can tell, the code is already
compliant with the rule, but there is room for improvement, especially
on the side of allowing automatic checks to be more effective.
Nicola Vetrini (4):
xen/arm: justify or initialize conditionally uninitialized variables
xen/arm64: bitops: justify uninitialized variable inside a macro
xen/arm: initialize conditionally uninitialized local variables
xen/arm: initialize conditionally uninitialized local variables
docs/misra/safe.json | 24 +++++++++++++++
xen/arch/arm/arm64/lib/bitops.c | 3 ++
xen/arch/arm/arm64/lib/find_next_bit.c | 1 +
xen/arch/arm/bootfdt.c | 6 ++++
xen/arch/arm/cpuerrata.c | 6 ++--
xen/arch/arm/decode.c | 2 ++
xen/arch/arm/dm.c | 2 +-
xen/arch/arm/domain_build.c | 29 ++++++++++++++----
xen/arch/arm/domctl.c | 8 ++---
xen/arch/arm/efi/efi-boot.h | 6 ++--
xen/arch/arm/gic-v3-its.c | 9 +++---
xen/arch/arm/gic-v3-lpi.c | 17 ++++++-----
xen/arch/arm/guest_walk.c | 12 ++++----
xen/arch/arm/include/asm/guest_atomics.h | 3 ++
xen/arch/arm/include/asm/p2m.h | 10 ++++---
xen/arch/arm/mm.c | 1 +
xen/arch/arm/p2m.c | 33 ++++++++++++---------
xen/arch/arm/platforms/xilinx-zynqmp-eemi.c | 10 ++-----
xen/arch/arm/psci.c | 10 +++----
xen/drivers/char/pl011.c | 2 +-
20 files changed, 129 insertions(+), 65 deletions(-)
--
2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |