diff mbox series

[XEN,01/10] arm/gic: address violations of MISRA C:2012 Rule 8.2

Message ID e55bfe55e0c34e96692f397ff69365bc0819fd90.1697207038.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series arm: address some violations of MISRA C:2012 Rule 8.2 | expand

Commit Message

Federico Serafini Oct. 13, 2023, 3:24 p.m. UTC
Add missing parameter names, no functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/arm/include/asm/gic.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Stefano Stabellini Oct. 13, 2023, 11:09 p.m. UTC | #1
On Fri, 13 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>
Julien Grall Oct. 16, 2023, 8:53 a.m. UTC | #2
Hi,

On 13/10/2023 16:24, Federico Serafini wrote:
> Add missing parameter names, no functional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>   xen/arch/arm/include/asm/gic.h | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
> index f1ef347edc..03f209529b 100644
> --- a/xen/arch/arm/include/asm/gic.h
> +++ b/xen/arch/arm/include/asm/gic.h
> @@ -246,7 +246,7 @@ void gic_set_irq_type(struct irq_desc *desc, unsigned int type);
>   
>   /* Program the GIC to route an interrupt */
>   extern void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
> -extern int gic_route_irq_to_guest(struct domain *, unsigned int virq,
> +extern int gic_route_irq_to_guest(struct domain *d, unsigned int virq,
>                                     struct irq_desc *desc,
>                                     unsigned int priority);
>   
> @@ -330,11 +330,11 @@ struct gic_hw_operations {
>       /* Initialize the GIC and the boot CPU */
>       int (*init)(void);
>       /* Save GIC registers */
> -    void (*save_state)(struct vcpu *);
> +    void (*save_state)(struct vcpu *v);
>       /* Restore GIC registers */
> -    void (*restore_state)(const struct vcpu *);
> +    void (*restore_state)(const struct vcpu *v);
>       /* Dump GIC LR register information */
> -    void (*dump_state)(const struct vcpu *);
> +    void (*dump_state)(const struct vcpu *v);
>   
>       /* hw_irq_controller to enable/disable/eoi host irq */
>       hw_irq_controller *gic_host_irq_type;
> @@ -369,9 +369,9 @@ struct gic_hw_operations {
>       /* Clear LR register */
>       void (*clear_lr)(int lr);
>       /* Read LR register and populate gic_lr structure */
> -    void (*read_lr)(int lr, struct gic_lr *);
> +    void (*read_lr)(int lr, struct gic_lr *lr_reg);
>       /* Write LR register from gic_lr structure */
> -    void (*write_lr)(int lr, const struct gic_lr *);
> +    void (*write_lr)(int lr, const struct gic_lr *lr_reg);

Are the parameters name meant to match the declaration of the callbacks?
I am asking it because I see there are some inconsistencies between the 
declaration in GICv3 and GICv2. So this may want to be harmonized.

Cheers,
Federico Serafini Oct. 17, 2023, 2:02 p.m. UTC | #3
On 16/10/23 10:53, Julien Grall wrote:
> Hi,
> 
> On 13/10/2023 16:24, Federico Serafini wrote:
>> Add missing parameter names, no functional change.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>> ---
>>   xen/arch/arm/include/asm/gic.h | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/xen/arch/arm/include/asm/gic.h 
>> b/xen/arch/arm/include/asm/gic.h
>> index f1ef347edc..03f209529b 100644
>> --- a/xen/arch/arm/include/asm/gic.h
>> +++ b/xen/arch/arm/include/asm/gic.h
>> @@ -246,7 +246,7 @@ void gic_set_irq_type(struct irq_desc *desc, 
>> unsigned int type);
>>   /* Program the GIC to route an interrupt */
>>   extern void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int 
>> priority);
>> -extern int gic_route_irq_to_guest(struct domain *, unsigned int virq,
>> +extern int gic_route_irq_to_guest(struct domain *d, unsigned int virq,
>>                                     struct irq_desc *desc,
>>                                     unsigned int priority);
>> @@ -330,11 +330,11 @@ struct gic_hw_operations {
>>       /* Initialize the GIC and the boot CPU */
>>       int (*init)(void);
>>       /* Save GIC registers */
>> -    void (*save_state)(struct vcpu *);
>> +    void (*save_state)(struct vcpu *v);
>>       /* Restore GIC registers */
>> -    void (*restore_state)(const struct vcpu *);
>> +    void (*restore_state)(const struct vcpu *v);
>>       /* Dump GIC LR register information */
>> -    void (*dump_state)(const struct vcpu *);
>> +    void (*dump_state)(const struct vcpu *v);
>>       /* hw_irq_controller to enable/disable/eoi host irq */
>>       hw_irq_controller *gic_host_irq_type;
>> @@ -369,9 +369,9 @@ struct gic_hw_operations {
>>       /* Clear LR register */
>>       void (*clear_lr)(int lr);
>>       /* Read LR register and populate gic_lr structure */
>> -    void (*read_lr)(int lr, struct gic_lr *);
>> +    void (*read_lr)(int lr, struct gic_lr *lr_reg);
>>       /* Write LR register from gic_lr structure */
>> -    void (*write_lr)(int lr, const struct gic_lr *);
>> +    void (*write_lr)(int lr, const struct gic_lr *lr_reg);
> 
> Are the parameters name meant to match the declaration of the callbacks?
> I am asking it because I see there are some inconsistencies between the 
> declaration in GICv3 and GICv2. So this may want to be harmonized.
> 
> Cheers,
> 

I can propose another patch that also changes parameter names
of gicv3_write_lr() as well as adding the missing ones in gic.h.
diff mbox series

Patch

diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index f1ef347edc..03f209529b 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -246,7 +246,7 @@  void gic_set_irq_type(struct irq_desc *desc, unsigned int type);
 
 /* Program the GIC to route an interrupt */
 extern void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
-extern int gic_route_irq_to_guest(struct domain *, unsigned int virq,
+extern int gic_route_irq_to_guest(struct domain *d, unsigned int virq,
                                   struct irq_desc *desc,
                                   unsigned int priority);
 
@@ -330,11 +330,11 @@  struct gic_hw_operations {
     /* Initialize the GIC and the boot CPU */
     int (*init)(void);
     /* Save GIC registers */
-    void (*save_state)(struct vcpu *);
+    void (*save_state)(struct vcpu *v);
     /* Restore GIC registers */
-    void (*restore_state)(const struct vcpu *);
+    void (*restore_state)(const struct vcpu *v);
     /* Dump GIC LR register information */
-    void (*dump_state)(const struct vcpu *);
+    void (*dump_state)(const struct vcpu *v);
 
     /* hw_irq_controller to enable/disable/eoi host irq */
     hw_irq_controller *gic_host_irq_type;
@@ -369,9 +369,9 @@  struct gic_hw_operations {
     /* Clear LR register */
     void (*clear_lr)(int lr);
     /* Read LR register and populate gic_lr structure */
-    void (*read_lr)(int lr, struct gic_lr *);
+    void (*read_lr)(int lr, struct gic_lr *lr_reg);
     /* Write LR register from gic_lr structure */
-    void (*write_lr)(int lr, const struct gic_lr *);
+    void (*write_lr)(int lr, const struct gic_lr *lr_reg);
     /* Read VMCR priority */
     unsigned int (*read_vmcr_priority)(void);
     /* Read APRn register */