[RFC 4/4] amd/iommu: fully initialize array in 'flush_command_buffer'

Nicola Vetrini posted 4 patches 2 years, 3 months ago
[RFC 4/4] amd/iommu: fully initialize array in 'flush_command_buffer'
Posted by Nicola Vetrini 2 years, 3 months ago
Fully explicit initialization of the cmd array resolves a violation of
MISRA C:2012 Rule 9.3.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/drivers/passthrough/amd/iommu_cmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/amd/iommu_cmd.c b/xen/drivers/passthrough/amd/iommu_cmd.c
index cb28b36abc38..49b9fcac9410 100644
--- a/xen/drivers/passthrough/amd/iommu_cmd.c
+++ b/xen/drivers/passthrough/amd/iommu_cmd.c
@@ -66,7 +66,8 @@ static void flush_command_buffer(struct amd_iommu *iommu,
                          IOMMU_COMP_WAIT_S_FLAG_MASK),
         (addr >> 32) | MASK_INSR(IOMMU_CMD_COMPLETION_WAIT,
                                  IOMMU_CMD_OPCODE_MASK),
-        CMD_COMPLETION_DONE
+        CMD_COMPLETION_DONE,
+        0
     };
     s_time_t start, timeout;
     static unsigned int __read_mostly threshold = 1;
--
2.34.1
Re: [RFC 4/4] amd/iommu: fully initialize array in 'flush_command_buffer'
Posted by Jan Beulich 2 years, 3 months ago
On 24.10.2023 16:31, Nicola Vetrini wrote:
> Fully explicit initialization of the cmd array resolves a violation of
> MISRA C:2012 Rule 9.3.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

While I'm not overly happy, we accepted the rule, so
Acked-by: Jan Beulich <jbeulich@suse.com>