xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
	xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
	consulting@bugseng.com, bertrand.marquis@arm.com, julien@xen.org,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>, "Wei Liu" <wl@xen.org>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Rahul Singh" <rahul.singh@arm.com>
Subject: [XEN PATCH v2 0/7] address some violations of MISRA C Rule 20.7
Date: Fri,  8 Mar 2024 12:20:57 +0100	[thread overview]
Message-ID: <cover.1709896401.git.nicola.vetrini@bugseng.com> (raw)

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), but in some cases (most notably in
patch 3) such adjustments have been made for consistency.

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.

Changes in v2:
- Removed a hunk of patch 1 touching __config_enabled (will be deviated in a
  subsequent series).
- Split patch 1 into three patches, for easier reviewing.
- Made minor adjustments to "xen-arm-address-some...".
- Dropped GUARD(1) hunk from the x86 patch.
- Dropped patch 4, 5 and 10: they will be subject to a deviation in the future.
- Patch 7, 8, 9 have been committed already. 

Nicola Vetrini (7):
  xen/spinlock: address violations of MISRA C Rule 20.7
  xen/include: address violations of MISRA C Rule 20.7
  xen/list: address violations of MISRA C Rule 20.7
  xen/param: address violations of MISRA C Rule 20.7
  xen/arm: address some violations of MISRA C Rule 20.7
  x86/irq: parenthesize negative constants
  arm/smmu: address some violations of MISRA C Rule 20.7

 xen/arch/arm/arm64/cpufeature.c          | 14 ++--
 xen/arch/arm/cpuerrata.c                 |  8 +--
 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         | 36 +++++-----
 xen/arch/arm/include/asm/vgic-emul.h     |  8 +--
 xen/arch/arm/vcpreg.c                    |  5 +-
 xen/arch/x86/include/asm/irq.h           |  8 +--
 xen/drivers/passthrough/arm/smmu.c       |  4 +-
 xen/include/xen/bug.h                    |  2 +-
 xen/include/xen/init.h                   |  4 +-
 xen/include/xen/list.h                   | 83 ++++++++++++------------
 xen/include/xen/param.h                  | 22 +++----
 xen/include/xen/spinlock.h               |  2 +-
 15 files changed, 102 insertions(+), 102 deletions(-)

-- 
2.34.1


             reply	other threads:[~2024-03-08 11:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 11:20 Nicola Vetrini [this message]
2024-03-08 11:20 ` [XEN PATCH v2 1/7] xen/spinlock: address violations of MISRA C Rule 20.7 Nicola Vetrini
2024-03-09  1:23   ` Stefano Stabellini
2024-03-08 11:20 ` [XEN PATCH v2 2/7] xen/include: " Nicola Vetrini
2024-03-09  1:26   ` Stefano Stabellini
2024-03-08 11:21 ` [XEN PATCH v2 3/7] xen/list: " Nicola Vetrini
2024-03-09  1:29   ` Stefano Stabellini
2024-03-11  7:48   ` Jan Beulich
2024-03-11  8:19     ` Nicola Vetrini
2024-03-08 11:21 ` [XEN PATCH v2 4/7] xen/param: " Nicola Vetrini
2024-03-09  1:32   ` Stefano Stabellini
2024-03-08 11:21 ` [XEN PATCH v2 5/7] xen/arm: address some " Nicola Vetrini
2024-03-09  1:53   ` Stefano Stabellini
2024-03-08 11:21 ` [XEN PATCH v2 6/7] x86/irq: parenthesize negative constants Nicola Vetrini
2024-03-09  1:54   ` Stefano Stabellini
2024-03-11  7:50     ` Jan Beulich
2024-03-08 11:21 ` [XEN PATCH v2 7/7] arm/smmu: address some violations of MISRA C Rule 20.7 Nicola Vetrini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1709896401.git.nicola.vetrini@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayan.kumar.halder@amd.com \
    --cc=bertrand.marquis@arm.com \
    --cc=consulting@bugseng.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=rahul.singh@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xenia.ragiadakou@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).