[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] x86/IOMMU: address violations of MISRA C:2012 Rule 14.4



On 2023-12-13 17:10, Simone Ballarin wrote:
From: Maria Celeste Cesario <maria.celeste.cesario@xxxxxxxxxxx>

The xen sources contain violations of MISRA C:2012 Rule 14.4 whose
headline states:
"The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type".

Add comparisons to avoid using enum constants as controlling expressions
to comply with Rule 14.4.
No functional change.

Signed-off-by: Maria Celeste Cesario <maria.celeste.cesario@xxxxxxxxxxx>
Signed-off-by: Simone Ballarin  <simone.ballarin@xxxxxxxxxxx>
---
Changes in v2
- rename prefix from AMD/IOMMU to x86/IOMMU
- move changes on msi.c and hpet.c in this patch.
---
 xen/arch/x86/hpet.c                      | 6 +++---
 xen/arch/x86/msi.c                       | 4 ++--
 xen/drivers/passthrough/amd/iommu_init.c | 4 ++--
 xen/drivers/passthrough/vtd/iommu.c      | 4 ++--
 xen/drivers/passthrough/vtd/quirks.c     | 2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)


+Stefano

Hi all,

this patch seems not to have been committed into staging, unlike the other patch from this series. Since these are the only remaining violations for Rule 14.4, then I think these changes could be reviewed.

This should apply cleanly on staging, but I can send a rebased version if there are problems.

Additionally, despite having patches addressing R14.4 already in staging, the rule itself is not in docs/misra/rules.rst due to concerns on the patch that aimed to add it [1], so it's probably best to send a new version of that as well, if Stefano agrees.

[1] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2308301840520.6458@ubuntu-linux-20-04-desktop/


--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.