[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 Wed, Dec 13, 2023 at 05:10:50PM +0100, 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.

If we really want to go this route, we also need to amend the comment
in iommu_intremap definition, as it's no longer valid:

extern enum __packed iommu_intremap {
   /*
    * In order to allow traditional boolean uses of the iommu_intremap
    * variable, the "off" value has to come first (yielding a value of zero).
    */
   iommu_intremap_off,

We no longer allow traditional boolean uses of iommu_intremap.

Thanks, Roger.



 


Rackspace

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