[XEN PATCH] xen/irq: address violations of MISRA C:2012 Rule 8.2

Federico Serafini posted 1 patch 6 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/fc077d4dba9c37d9d81cea5d184e59f00c3cdcd4.1696242264.git.federico.serafini@bugseng.com
xen/arch/arm/irq.c             |  3 ++-
xen/arch/x86/include/asm/irq.h |  4 ++--
xen/arch/x86/irq.c             |  8 ++++----
xen/include/xen/irq.h          | 21 +++++++++++----------
4 files changed, 19 insertions(+), 17 deletions(-)
[XEN PATCH] xen/irq: address violations of MISRA C:2012 Rule 8.2
Posted by Federico Serafini 6 months, 4 weeks ago
Add missing parameter names. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/arm/irq.c             |  3 ++-
 xen/arch/x86/include/asm/irq.h |  4 ++--
 xen/arch/x86/irq.c             |  8 ++++----
 xen/include/xen/irq.h          | 21 +++++++++++----------
 4 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 09648db17a..1f05ecdee5 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -182,7 +182,8 @@ void irq_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
 }
 
 int request_irq(unsigned int irq, unsigned int irqflags,
-                void (*handler)(int, void *, struct cpu_user_regs *),
+                void (*handler)(int irq, void *dev_id,
+                                struct cpu_user_regs *regs),
                 const char *devname, void *dev_id)
 {
     struct irqaction *action;
diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index ad907fc97f..a87af47ece 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -101,9 +101,9 @@ void cf_check irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 uint8_t alloc_hipriority_vector(void);
 
 void set_direct_apic_vector(
-    uint8_t vector, void (*handler)(struct cpu_user_regs *));
+    uint8_t vector, void (*handler)(struct cpu_user_regs *regs));
 void alloc_direct_apic_vector(
-    uint8_t *vector, void (*handler)(struct cpu_user_regs *));
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *regs));
 
 void do_IRQ(struct cpu_user_regs *regs);
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 6abfd81621..f42ad539dc 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -915,16 +915,16 @@ uint8_t alloc_hipriority_vector(void)
     return next++;
 }
 
-static void (*direct_apic_vector[X86_NR_VECTORS])(struct cpu_user_regs *);
+static void (*direct_apic_vector[X86_NR_VECTORS])(struct cpu_user_regs *regs);
 void set_direct_apic_vector(
-    uint8_t vector, void (*handler)(struct cpu_user_regs *))
+    uint8_t vector, void (*handler)(struct cpu_user_regs *regs))
 {
     BUG_ON(direct_apic_vector[vector] != NULL);
     direct_apic_vector[vector] = handler;
 }
 
 void alloc_direct_apic_vector(
-    uint8_t *vector, void (*handler)(struct cpu_user_regs *))
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *regs))
 {
     static DEFINE_SPINLOCK(lock);
 
@@ -964,7 +964,7 @@ static int __init cf_check irq_ratelimit_init(void)
 __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq, unsigned int irqflags,
-        void (*handler)(int, void *, struct cpu_user_regs *),
+        void (*handler)(int irq, void *dev_id, struct cpu_user_regs *regs),
         const char * devname, void *dev_id)
 {
     struct irqaction * action;
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 9747e818f7..58d462e8e6 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -18,7 +18,7 @@
     ASSERT(!in_irq() && (local_irq_is_enabled() || num_online_cpus() <= 1))
 
 struct irqaction {
-    void (*handler)(int, void *, struct cpu_user_regs *);
+    void (*handler)(int irq, void *dev_id, struct cpu_user_regs *regs);
     const char *name;
     void *dev_id;
     bool_t free_on_release;
@@ -62,17 +62,17 @@ struct irq_desc;
  */
 struct hw_interrupt_type {
     const char *typename;
-    unsigned int (*startup)(struct irq_desc *);
-    void (*shutdown)(struct irq_desc *);
-    void (*enable)(struct irq_desc *);
-    void (*disable)(struct irq_desc *);
-    void (*ack)(struct irq_desc *);
+    unsigned int (*startup)(struct irq_desc *desc);
+    void (*shutdown)(struct irq_desc *desc);
+    void (*enable)(struct irq_desc *desc);
+    void (*disable)(struct irq_desc *desc);
+    void (*ack)(struct irq_desc *desc);
 #ifdef CONFIG_X86
-    void (*end)(struct irq_desc *, u8 vector);
+    void (*end)(struct irq_desc *desc, u8 vector);
 #else
-    void (*end)(struct irq_desc *);
+    void (*end)(struct irq_desc *desc);
 #endif
-    void (*set_affinity)(struct irq_desc *, const cpumask_t *);
+    void (*set_affinity)(struct irq_desc *desc, const cpumask_t *mask);
 };
 
 typedef const struct hw_interrupt_type hw_irq_controller;
@@ -119,7 +119,8 @@ extern int setup_irq(unsigned int irq, unsigned int irqflags,
                      struct irqaction *new);
 extern void release_irq(unsigned int irq, const void *dev_id);
 extern int request_irq(unsigned int irq, unsigned int irqflags,
-               void (*handler)(int, void *, struct cpu_user_regs *),
+               void (*handler)(int irq, void *dev_id,
+                     struct cpu_user_regs *regs),
                const char *devname, void *dev_id);
 
 extern hw_irq_controller no_irq_type;
-- 
2.34.1
Re: [XEN PATCH] xen/irq: address violations of MISRA C:2012 Rule 8.2
Posted by Stefano Stabellini 6 months, 4 weeks ago
On Mon, 2 Oct 2023, Federico Serafini wrote:
> Add missing parameter names. No functional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Re: [XEN PATCH] xen/irq: address violations of MISRA C:2012 Rule 8.2
Posted by Jan Beulich 6 months, 2 weeks ago
On 03.10.2023 00:45, Stefano Stabellini wrote:
> On Mon, 2 Oct 2023, Federico Serafini wrote:
>> Add missing parameter names. No functional change.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Acked-by: Jan Beulich <jbeulich@suse.com>
Re: [XEN PATCH] xen/irq: address violations of MISRA C:2012 Rule 8.2
Posted by Henry Wang 6 months, 4 weeks ago
Hi,

> On Oct 3, 2023, at 06:45, Stefano Stabellini <sstabellini@kernel.org> wrote:
> 
> On Mon, 2 Oct 2023, Federico Serafini wrote:
>> Add missing parameter names. No functional change.
>> 
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Release-acked-by: Henry Wang <Henry.Wang@arm.com>

Kind regards,
Henry
Re: [XEN PATCH] xen/irq: address violations of MISRA C:2012 Rule 8.2
Posted by Jan Beulich 6 months, 2 weeks ago
On 03.10.2023 02:19, Henry Wang wrote:
>> On Oct 3, 2023, at 06:45, Stefano Stabellini <sstabellini@kernel.org> wrote:
>>
>> On Mon, 2 Oct 2023, Federico Serafini wrote:
>>> Add missing parameter names. No functional change.
>>>
>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>
>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> Release-acked-by: Henry Wang <Henry.Wang@arm.com>

Same question here wrt applicability now that we're past RC3.

Jan
Re: [XEN PATCH] xen/irq: address violations of MISRA C:2012 Rule 8.2
Posted by Henry Wang 6 months, 2 weeks ago

> On Oct 16, 2023, at 23:14, Jan Beulich <jbeulich@suse.com> wrote:
> 
> On 03.10.2023 02:19, Henry Wang wrote:
>>> On Oct 3, 2023, at 06:45, Stefano Stabellini <sstabellini@kernel.org> wrote:
>>> 
>>> On Mon, 2 Oct 2023, Federico Serafini wrote:
>>>> Add missing parameter names. No functional change.
>>>> 
>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>> 
>>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>> 
>> Release-acked-by: Henry Wang <Henry.Wang@arm.com>
> 
> Same question here wrt applicability now that we're past RC3.

Same answer here for this patch, as this is a simple one and nothing behavioral
is expected to change. So I am ok to commit this.

Kind regards,
Henry

> 
> Jan