Skip to contentSkip to conversation

xen: address violations of MISRA C:2012 Rule 8.2

PATCH In review Federico Serafini 3 participants 11 messages Dec 12, 2023 – Dec 13, 2023

lore
Share & tools
lore
#0 lore raw

cover xen: address violations of MISRA C:2012 Rule 8.2

This patch series adds the missing parameter names to address violations of MISRA C:2012 Rule 8.2. No functional changes are introduced.

Federico Serafini (4):
xen/compat: address violations of MISRA C:2012 Rule 8.2 x86/asm: address violations of MISRA C:2012 Rule 8.2 xen/drivers: address violations of MISRA C:2012 Rule 8.2 xen/iommu: address leftover violation of MISRA C:2012 Rule 8.2

 xen/arch/x86/include/asm/amd.h       | 2 +-
 xen/arch/x86/include/asm/debugreg.h  | 4 ++--
 xen/arch/x86/include/asm/flushtlb.h  | 3 ++-
 xen/arch/x86/include/asm/hap.h       | 2 +-
 xen/arch/x86/include/asm/iommu.h     | 2 +-
 xen/arch/x86/include/asm/microcode.h | 2 +-
 xen/drivers/char/ehci-dbgp.c         | 4 ++--
 xen/drivers/video/vga.c              | 2 +-
 xen/include/xen/compat.h             | 5 +++--
 xen/include/xen/iommu.h              | 2 +-
 xen/include/xen/video.h              | 2 +-
 11 files changed, 16 insertions(+), 14 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/4 xen/compat: address violations of MISRA C:2012 Rule 8.2

Add missing parameter names. No functional change.

---
 xen/include/xen/compat.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
xen/include/xen/compat.h +3 -2
index 41a5d61eef..7ec9d6567e 100644
@@ -232,9 +232,10 @@ int hypercall_xlat_continuation(unsigned int *id, unsigned int nr,
 
 /* In-place translation functons: */
 struct start_info;
-void xlat_start_info(struct start_info *, enum XLAT_start_info_console);
+void xlat_start_info(struct start_info *native,
+                     enum XLAT_start_info_console console);
 struct vcpu_runstate_info;
-void xlat_vcpu_runstate_info(struct vcpu_runstate_info *);
+void xlat_vcpu_runstate_info(struct vcpu_runstate_info *native);
 
 #else
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 2/4 x86/asm: address violations of MISRA C:2012 Rule 8.2

In reply to Federico Serafini

Add missing parameter names. No functional change.

---
 xen/arch/x86/include/asm/amd.h       | 2 +-
 xen/arch/x86/include/asm/debugreg.h  | 4 ++--
 xen/arch/x86/include/asm/flushtlb.h  | 3 ++-
 xen/arch/x86/include/asm/hap.h       | 2 +-
 xen/arch/x86/include/asm/iommu.h     | 2 +-
 xen/arch/x86/include/asm/microcode.h | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)
xen/arch/x86/include/asm/amd.h +1 -1
index 0700827561..2cc0ce2e9f 100644
@@ -157,7 +157,7 @@
 #define is_zen4_uarch()   boot_cpu_has(X86_FEATURE_AUTO_IBRS)
 
 struct cpuinfo_x86;
-int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
+int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...);
 
 extern s8 opt_allow_unsafe;
 
xen/arch/x86/include/asm/debugreg.h +2 -2
index b6454cc04e..2bdaf5d9aa 100644
@@ -96,8 +96,8 @@
 #define breakpoint_addr_ok(a) __addr_ok(a)
 
 struct vcpu;
-long set_debugreg(struct vcpu *, unsigned int reg, unsigned long value);
-void activate_debugregs(const struct vcpu *);
+long set_debugreg(struct vcpu *v, unsigned int reg, unsigned long value);
+void activate_debugregs(const struct vcpu *curr);
 
 struct cpu_policy;
 
xen/arch/x86/include/asm/flushtlb.h +2 -1
index a461ee36ff..bb0ad58db4 100644
@@ -141,7 +141,8 @@ unsigned int flush_area_local(const void *va, unsigned int flags);
 #define flush_local(flags) flush_area_local(NULL, flags)
 
 /* Flush specified CPUs' TLBs/caches */
-void flush_area_mask(const cpumask_t *, const void *va, unsigned int flags);
+void flush_area_mask(const cpumask_t *mask, const void *va,
+                     unsigned int flags);
 #define flush_mask(mask, flags) flush_area_mask(mask, NULL, flags)
 
 /* Flush all CPUs' TLBs/caches */
xen/arch/x86/include/asm/hap.h +1 -1
index 05e124ad57..f01ce73fb4 100644
@@ -32,7 +32,7 @@ int   hap_track_dirty_vram(struct domain *d,
                            unsigned int nr_frames,
                            XEN_GUEST_HANDLE(void) guest_dirty_bitmap);
 
-extern const struct paging_mode *hap_paging_get_mode(struct vcpu *);
+extern const struct paging_mode *hap_paging_get_mode(struct vcpu *v);
 int hap_set_allocation(struct domain *d, unsigned int pages, bool *preempted);
 unsigned int hap_get_allocation(struct domain *d);
 
xen/arch/x86/include/asm/iommu.h +1 -1
index eb720205e2..15a848ddc3 100644
@@ -87,7 +87,7 @@ extern const struct iommu_init_ops *iommu_init_ops;
 void iommu_update_ire_from_apic(unsigned int apic, unsigned int pin,
                                 uint64_t rte);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
-int iommu_setup_hpet_msi(struct msi_desc *);
+int iommu_setup_hpet_msi(struct msi_desc *msi);
 
 static inline void iommu_adjust_irq_affinities(void)
 {
xen/arch/x86/include/asm/microcode.h +1 -1
index 62ce3418f7..8f59b20b02 100644
@@ -22,7 +22,7 @@ struct cpu_signature {
 DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
 
 void microcode_set_module(unsigned int idx);
-int microcode_update(XEN_GUEST_HANDLE(const_void), unsigned long len);
+int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len);
 int early_microcode_init(unsigned long *module_map,
                          const struct multiboot_info *mbi);
 int microcode_init_cache(unsigned long *module_map,
Signature · 1 line
2.34.1
#6 lore raw

PATCH 3/4 xen/drivers: address violations of MISRA C:2012 Rule 8.2

In reply to Federico Serafini

Add missing parameter names. No functional change.

---
 xen/drivers/char/ehci-dbgp.c | 4 ++--
 xen/drivers/video/vga.c      | 2 +-
 xen/include/xen/video.h      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
xen/drivers/char/ehci-dbgp.c +2 -2
index 72e1beabbb..0f5b41899e 100644
@@ -341,7 +341,7 @@ struct ehci_dbgp {
     struct ehci_caps __iomem *ehci_caps;
 };
 
-static int ehci_dbgp_external_startup(struct ehci_dbgp *);
+static int ehci_dbgp_external_startup(struct ehci_dbgp *dbgp);
 
 static void ehci_dbgp_status(struct ehci_dbgp *dbgp, const char *str)
 {
@@ -997,7 +997,7 @@ err:
     return -ENODEV;
 }
 
-typedef void (*set_debug_port_t)(struct ehci_dbgp *, unsigned int);
+typedef void (*set_debug_port_t)(struct ehci_dbgp *dbgp, unsigned int port);
 
 static void cf_check default_set_debug_port(
     struct ehci_dbgp *dbgp, unsigned int port)
xen/drivers/video/vga.c +1 -1
index 18b590cdf0..b4d0183261 100644
@@ -21,7 +21,7 @@ static unsigned char *video;
 
 static void cf_check vga_text_puts(const char *s, size_t nr);
 static void cf_check vga_noop_puts(const char *s, size_t nr) {}
-void (*video_puts)(const char *, size_t nr) = vga_noop_puts;
+void (*video_puts)(const char *s, size_t nr) = vga_noop_puts;
 
 /*
  * 'vga=<mode-specifier>[,keep]' where <mode-specifier> is one of:
xen/include/xen/video.h +1 -1
index 96f8a50132..1ee1aa46b1 100644
@@ -13,7 +13,7 @@
 
 #ifdef CONFIG_VIDEO
 void video_init(void);
-extern void (*video_puts)(const char *, size_t nr);
+extern void (*video_puts)(const char *s, size_t nr);
 void video_endboot(void);
 #else
 #define video_init()    ((void)0)
Signature · 1 line
2.34.1
#8 lore raw

PATCH 4/4 xen/iommu: address leftover violation of MISRA C:2012 Rule 8.2

In reply to Federico Serafini

Add missing parameter name. No functional change.

---
 xen/include/xen/iommu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/xen/iommu.h +1 -1
index 69d572543c..f53d045e2c 100644
@@ -296,7 +296,7 @@ struct iommu_ops {
                                  uint64_t rte);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
 
-    int (*setup_hpet_msi)(struct msi_desc *);
+    int (*setup_hpet_msi)(struct msi_desc *msi_desc);
 
     void (*adjust_irq_affinities)(void);
     void (*clear_root_pgtable)(struct domain *d);
Signature · 1 line
2.34.1