diff mbox series

[XEN] xen/spinlock: address violations of MISRA C:2012 Rules 8.2 and 8.3

Message ID 29b6a47a2711f065c02a3d2d94e1a201986cf015.1690882872.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series [XEN] xen/spinlock: address violations of MISRA C:2012 Rules 8.2 and 8.3 | expand

Commit Message

Federico Serafini Aug. 1, 2023, 9:46 a.m. UTC
Give a name to unnamed parameters to address violations of
MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with
named parameters").
Keep consistency between parameter names and types used in function
declarations and the ones used in the corresponding function
definitions, thus addressing violations of MISRA C:2012 Rule 8.3
("All declarations of an object or function shall use the same names
and type qualifiers").

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/spinlock.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Jan Beulich Aug. 1, 2023, 1:50 p.m. UTC | #1
On 01.08.2023 11:46, Federico Serafini wrote:
> --- a/xen/include/xen/spinlock.h
> +++ b/xen/include/xen/spinlock.h
> @@ -125,8 +125,9 @@ struct lock_profile_qhead {
>      } while(0)
>  
>  void _lock_profile_register_struct(
> -    int32_t, struct lock_profile_qhead *, int32_t);
> -void _lock_profile_deregister_struct(int32_t, struct lock_profile_qhead *);
> +    int32_t type, struct lock_profile_qhead *qhead, int32_t idx);
> +void _lock_profile_deregister_struct(int32_t type,
> +                                     struct lock_profile_qhead *qhead);

In adjacent declaration it would be nice if the same line wrapping
style was used. Can surely be taken care of while committing. With
the adjustment:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan
diff mbox series

Patch

diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 0a02a527dc..4a1c155e96 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -125,8 +125,9 @@  struct lock_profile_qhead {
     } while(0)
 
 void _lock_profile_register_struct(
-    int32_t, struct lock_profile_qhead *, int32_t);
-void _lock_profile_deregister_struct(int32_t, struct lock_profile_qhead *);
+    int32_t type, struct lock_profile_qhead *qhead, int32_t idx);
+void _lock_profile_deregister_struct(int32_t type,
+                                     struct lock_profile_qhead *qhead);
 
 #define lock_profile_register_struct(type, ptr, idx)                          \
     _lock_profile_register_struct(type, &((ptr)->profile_head), idx)
@@ -178,7 +179,7 @@  typedef struct spinlock {
 #define spin_lock_init(l) (*(l) = (spinlock_t)SPIN_LOCK_UNLOCKED)
 
 void _spin_lock(spinlock_t *lock);
-void _spin_lock_cb(spinlock_t *lock, void (*cond)(void *), void *data);
+void _spin_lock_cb(spinlock_t *lock, void (*cb)(void *), void *data);
 void _spin_lock_irq(spinlock_t *lock);
 unsigned long _spin_lock_irqsave(spinlock_t *lock);