All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH 00/10] address some violations of MISRA C Rule 20.7
@ 2024-02-29 15:27 Nicola Vetrini
  2024-02-29 15:27 ` [XEN PATCH 01/10] xen/include: address " Nicola Vetrini
                   ` (9 more replies)
  0 siblings, 10 replies; 54+ messages in thread
From: Nicola Vetrini @ 2024-02-29 15:27 UTC (permalink / raw)
  To: nicola.vetrini, xen-devel
  Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
	consulting, jbeulich, andrew.cooper3, roger.pau, bertrand.marquis,
	julien, George Dunlap, Wei Liu, Volodymyr Babchuk, Rahul Singh

Hi all,

this series aims to refactor some macros that cause violations of MISRA C Rule
20.7 ("Expressions resulting from the expansion of macro parameters shall be
enclosed in parentheses"). All the macros touched by these patches are in some
way involved in violations, and the strategy adopted to bring them into
compliance is to add parentheses around macro arguments where needed.

Given that the community has previously requested a deviation from the rule, as
stated in docs/misra/deviations.rst, and reported below for convenience [1],
some macro parameters do not need any adjusting (e.g., when used as lhs to
an assignment in statement expressions).

This series fixes a significant portion of the violations on Arm
(from ~14000 to ~2500). On x86, though there is one patch touching it, there are
still many more; they will be part of a later series.

[1] - Code violating Rule 20.7 is safe when macro parameters are used:
       (1) as function arguments;
       (2) as macro arguments;
       (3) as array indices;
       (4) as lhs in assignments.

Nicola Vetrini (10):
  xen/include: address violations of MISRA C Rule 20.7
  xen/arm: address some violations of MISRA C Rule 20.7
  x86: address some violations of MISRA C Rule 20.7
  xen/public: address violations of MISRA C Rule 20.7
  xen/perfc: address violations of MISRA C Rule 20.7
  arm/smmu: address some violations of MISRA C Rule 20.7
  xen/arm: smmuv3: address violations of MISRA C Rule 20.7
  xen/errno: address violations of MISRA C Rule 20.7
  xen/include: tasklet: address violations of MISRA C Rule 20.7
  xen/keyhandler: address violations of MISRA C Rule 20.7

 xen/arch/arm/arm64/cpufeature.c          | 14 +++---
 xen/arch/arm/cpuerrata.c                 |  4 +-
 xen/arch/arm/include/asm/arm64/sysregs.h |  2 +-
 xen/arch/arm/include/asm/guest_atomics.h |  4 +-
 xen/arch/arm/include/asm/mm.h            |  2 +-
 xen/arch/arm/include/asm/smccc.h         |  8 ++--
 xen/arch/arm/include/asm/vgic-emul.h     |  8 ++--
 xen/arch/arm/vcpreg.c                    |  5 +-
 xen/arch/x86/include/asm/irq.h           |  6 +--
 xen/arch/x86/usercopy.c                  |  2 +-
 xen/common/keyhandler.c                  |  4 +-
 xen/common/perfc.c                       |  8 ++--
 xen/drivers/passthrough/arm/smmu-v3.c    |  2 +-
 xen/drivers/passthrough/arm/smmu.c       |  4 +-
 xen/include/public/xen.h                 |  2 +-
 xen/include/xen/bug.h                    |  2 +-
 xen/include/xen/errno.h                  |  2 +-
 xen/include/xen/init.h                   |  4 +-
 xen/include/xen/kconfig.h                |  2 +-
 xen/include/xen/list.h                   | 59 ++++++++++++------------
 xen/include/xen/param.h                  | 22 ++++-----
 xen/include/xen/spinlock.h               |  2 +-
 xen/include/xen/tasklet.h                |  2 +-
 23 files changed, 85 insertions(+), 85 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 54+ messages in thread
* [XEN PATCH 00/10] address some violations of MISRA C Rule 20.7
@ 2024-03-18 11:53 Nicola Vetrini
  0 siblings, 0 replies; 54+ messages in thread
From: Nicola Vetrini @ 2024-03-18 11:53 UTC (permalink / raw)
  To: nicola.vetrini, xen-devel
  Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
	consulting, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Wei Liu, Daniel P. Smith, Julien Grall, Rahul Singh,
	Bertrand Marquis, Volodymyr Babchuk, George Dunlap,
	Dario Faggioli

Hi all,

this series aims to refactor some macros that cause violations of MISRA C Rule
20.7 ("Expressions resulting from the expansion of macro parameters shall be
enclosed in parentheses"). All the macros touched by these patches are in some
way involved in violations, and the strategy adopted to bring them into
compliance is to add parentheses around macro arguments where needed.

Given that the community has previously requested a deviation from the rule, as
stated in docs/misra/deviations.rst, and reported below for convenience [1],
some macro parameters do not need any adjusting (e.g., when used as lhs to
an assignment in statement expressions).

Note that the patch on list.h of the earlier series [2] has been intentionally
left out of this series, because it still needs some adjustments.

[1] - Code violating Rule 20.7 is safe when macro parameters are used:
       (1) as function arguments;
       (2) as macro arguments;
       (3) as array indices;
       (4) as lhs in assignments.
       
[2] https://lore.kernel.org/xen-devel/cover.1709896401.git.nicola.vetrini@bugseng.com/

Nicola Vetrini (10):
  x86/cpufeature: add parentheses to comply with Rule 20.7
  AMD/IOMMU: guest: address violations of MISRA C Rule 20.7
  xen/xsm: add parentheses to comply with MISRA C Rule 20.7
  xen/device_tree: address violations of MISRA C Rule 20.7
  EFI: address violations of MISRA C Rule 20.7
  xen/arm: smmu: address violations of MISRA C Rule 20.7
  xen/efi: efibind: address violations of MISRA C Rule 20.7
  xen/notifier: address violations of MISRA C Rule 20.7
  xen/wait: address violations of MISRA C Rule 20.7
  xen/sched: address violations of MISRA C Rule 20.7

 xen/arch/arm/include/asm/arm64/efibind.h  | 4 ++--
 xen/arch/x86/include/asm/cpufeatureset.h  | 2 +-
 xen/arch/x86/include/asm/x86_64/efibind.h | 4 ++--
 xen/common/sched/private.h                | 2 +-
 xen/drivers/passthrough/amd/iommu_guest.c | 2 +-
 xen/drivers/passthrough/arm/smmu.c        | 2 +-
 xen/include/efi/efierr.h                  | 2 +-
 xen/include/xen/device_tree.h             | 2 +-
 xen/include/xen/notifier.h                | 2 +-
 xen/include/xen/wait.h                    | 4 ++--
 xen/include/xsm/dummy.h                   | 4 ++--
 11 files changed, 15 insertions(+), 15 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2024-03-18 11:54 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29 15:27 [XEN PATCH 00/10] address some violations of MISRA C Rule 20.7 Nicola Vetrini
2024-02-29 15:27 ` [XEN PATCH 01/10] xen/include: address " Nicola Vetrini
2024-02-29 16:10   ` Andrew Cooper
2024-02-29 16:21     ` Nicola Vetrini
2024-02-29 16:47       ` Andrew Cooper
2024-02-29 16:53         ` Nicola Vetrini
2024-02-29 16:25   ` Jan Beulich
2024-02-29 16:40     ` Nicola Vetrini
2024-02-29 16:47       ` Jan Beulich
2024-02-29 15:27 ` [XEN PATCH 02/10] xen/arm: address some " Nicola Vetrini
2024-02-29 16:34   ` Jan Beulich
2024-03-01 15:30     ` Nicola Vetrini
2024-03-04 18:17       ` Nicola Vetrini
2024-03-05  1:43         ` Stefano Stabellini
2024-03-05 10:25           ` Nicola Vetrini
2024-02-29 15:27 ` [XEN PATCH 03/10] x86: " Nicola Vetrini
2024-02-29 16:37   ` Jan Beulich
2024-02-29 16:45     ` Nicola Vetrini
2024-02-29 17:05       ` Jan Beulich
2024-03-05 10:26         ` Nicola Vetrini
2024-02-29 15:27 ` [XEN PATCH 04/10] xen/public: address " Nicola Vetrini
2024-02-29 16:40   ` Jan Beulich
2024-02-29 16:49     ` Nicola Vetrini
2024-02-29 22:49       ` Stefano Stabellini
2024-03-05 10:21         ` Nicola Vetrini
2024-03-05 10:26           ` Jan Beulich
2024-03-05 16:17             ` Nicola Vetrini
2024-03-01  7:54       ` Jan Beulich
2024-02-29 15:27 ` [XEN PATCH 05/10] xen/perfc: " Nicola Vetrini
2024-02-29 16:42   ` Jan Beulich
2024-02-29 16:50     ` Nicola Vetrini
2024-02-29 15:27 ` [XEN PATCH 06/10] arm/smmu: address some " Nicola Vetrini
2024-02-29 22:53   ` Stefano Stabellini
2024-03-05 10:23     ` Nicola Vetrini
2024-03-07  1:31   ` Stefano Stabellini
2024-02-29 15:27 ` [XEN PATCH 07/10] xen/arm: smmuv3: address " Nicola Vetrini
2024-02-29 22:54   ` Stefano Stabellini
2024-02-29 15:28 ` [XEN PATCH 08/10] xen/errno: " Nicola Vetrini
2024-02-29 22:55   ` Stefano Stabellini
2024-03-01  8:10     ` Nicola Vetrini
2024-03-04  9:39   ` Jan Beulich
2024-02-29 15:28 ` [XEN PATCH 09/10] xen/include: tasklet: " Nicola Vetrini
2024-02-29 22:56   ` Stefano Stabellini
2024-02-29 15:28 ` [XEN PATCH 10/10] xen/keyhandler: " Nicola Vetrini
2024-02-29 22:57   ` Stefano Stabellini
2024-03-01  8:00     ` Jan Beulich
2024-03-02  1:37       ` Stefano Stabellini
2024-03-04  8:00         ` Jan Beulich
2024-03-05  2:03           ` Stefano Stabellini
2024-03-05  7:00             ` Jan Beulich
2024-03-07  1:39               ` Stefano Stabellini
2024-03-07  7:42                 ` Jan Beulich
2024-03-07 13:52                   ` Nicola Vetrini
  -- strict thread matches above, loose matches on Subject: below --
2024-03-18 11:53 [XEN PATCH 00/10] address some " Nicola Vetrini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.