diff mbox series

AMD/IOMMU: drop tasklet handler forward declaration

Message ID 47711743-f6b6-130b-6be5-cfbb84ee5e2a@suse.com (mailing list archive)
State New, archived
Headers show
Series AMD/IOMMU: drop tasklet handler forward declaration | expand

Commit Message

Jan Beulich Nov. 2, 2023, 2:23 p.m. UTC
do_amd_iommu_irq()'s forward declaration uses a parameter name different
from what the definition uses, thus vioating Misra C:2012 rule 8.3. We
can get away without such a forward declaration if instead we forward-
declare amd_iommu_irq_tasklet, putting its initialization past the
handler function's definition.

No functional change.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
We could even get away without forward-declaring amd_iommu_irq_tasklet,
by using softirq_tasklet_init in e.g. amd_iomm_prepare() or
amd_iommu_init(), much like VT-d code does. Still that's code that can
be avoided, even if (in the final binary) that code ends up in
.init.text, and hence will be discarded when booting completes. IOW I'd
instead be inclined to make VT-d code match what is being switched to
here.

Comments

Andrew Cooper Nov. 2, 2023, 8:46 p.m. UTC | #1
On 02/11/2023 2:23 pm, Jan Beulich wrote:
> do_amd_iommu_irq()'s forward declaration uses a parameter name different
> from what the definition uses, thus vioating Misra C:2012 rule 8.3. We
> can get away without such a forward declaration if instead we forward-
> declare amd_iommu_irq_tasklet, putting its initialization past the
> handler function's definition.
>
> No functional change.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -26,8 +26,7 @@ 
 static int __initdata nr_amd_iommus;
 static bool __initdata pci_init;
 
-static void cf_check do_amd_iommu_irq(void *data);
-static DECLARE_SOFTIRQ_TASKLET(amd_iommu_irq_tasklet, do_amd_iommu_irq, NULL);
+static struct tasklet amd_iommu_irq_tasklet;
 
 unsigned int __read_mostly amd_iommu_acpi_info;
 unsigned int __read_mostly ivrs_bdf_entries;
@@ -715,6 +714,8 @@  static void cf_check do_amd_iommu_irq(vo
     }
 }
 
+static DECLARE_SOFTIRQ_TASKLET(amd_iommu_irq_tasklet, do_amd_iommu_irq, NULL);
+
 static void cf_check iommu_interrupt_handler(
     int irq, void *dev_id, struct cpu_user_regs *regs)
 {