Skip to content

address violations of MISRA C:2012 Rule 5.3 on x86

Nicola Vetrini xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86: mechanically rename to address MISRA C:2012 Rule 5.3xen/arch/x86/apic.c xen/arch/x86/cpu/mcheck/mce.c xen/arch/x86/cpu/mwait-idle.c +8 more+37 -373 replies
2/4x86/emulate: move a variable declaration to address MISRA C:2012 Rule 5.3xen/arch/x86/hvm/emulate.c+3 -34 replies
3/4x86/mm: mechanically rename variable to avoid shadowingxen/arch/x86/mm/p2m.c+3 -31 reply
4/4x86: avoid shadowing to address MISRA C:2012 Rule 5.3xen/arch/x86/x86_emulate/x86_emulate.c+6 -83 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [XEN PATCH 0/4] address violations of MISRA C:2012 Rule 5.3 on x86

This series aims to address some violations of MISRA C:2012 Rule 5.3:
"An identifier declared in an inner scope shall not hide an identifier declared in an outer scope"

To resolve such violations two strategies have been applied:

1. rename several function parameters or local variables;
2. remove a local variable declaration in an inner scope, if using the outer variable does not change the semantics of the function.

Nicola Vetrini (4):
x86: mechanically rename to address MISRA C:2012 Rule 5.3 x86/emulate: move a variable declaration to address MISRA C:2012 Rule

    5.3

x86/mm: mechanically rename variable to avoid shadowing
x86: avoid shadowing to address MISRA C:2012 Rule 5.3

 xen/arch/x86/apic.c                    |  8 ++++----
 xen/arch/x86/cpu/mcheck/mce.c          | 12 ++++++------
 xen/arch/x86/cpu/mwait-idle.c          | 24 ++++++++++++------------
 xen/arch/x86/domain.c                  |  2 +-
 xen/arch/x86/e820.c                    |  6 +++---
 xen/arch/x86/emul-i8254.c              |  2 +-
 xen/arch/x86/hvm/emulate.c             |  6 +++---
 xen/arch/x86/include/asm/e820.h        |  2 +-
 xen/arch/x86/include/asm/hvm/save.h    |  8 ++++----
 xen/arch/x86/include/asm/hvm/vpt.h     |  2 +-
 xen/arch/x86/mm/p2m.c                  |  6 +++---
 xen/arch/x86/psr.c                     |  4 ++--
 xen/arch/x86/traps.c                   |  4 ++--
 xen/arch/x86/x86_emulate/x86_emulate.c | 14 ++++++--------
 14 files changed, 49 insertions(+), 51 deletions(-)

--
2.34.1