On 21.12.23 11:34, Jan Beulich wrote:
On 12.12.2023 13:57, Julien Grall wrote:On 12/12/2023 09:47, Juergen Gross wrote:@@ -109,12 +109,16 @@ struct lock_profile_qhead { spinlock_t l = _SPIN_LOCK_UNLOCKED(NULL); \ static struct lock_profile __lock_profile_data_##l = _LOCK_PROFILE(l); \ _LOCK_PROFILE_PTR(l) +#define DEFINE_RSPINLOCK(l) \ + rspinlock_t l = _SPIN_LOCK_UNLOCKED(NULL); \ + static struct lock_profile __lock_profile_data_##l = _LOCK_PROFILE(l); \ + _LOCK_PROFILE_PTR(l)-#define spin_lock_init_prof(s, l) \+#define __spin_lock_init_prof(s, l, locktype) \If I am not mistaken the double-underscore prefix is a violation in MISRA. So can this be renamed to: spin_lock_init_prof__()?Is the new parameter needed at all? Can't we use typeof((s)->l) in place of passing the type explicitly?
IMO spin_lock_init_prof() should be usable for spinlock_t only, and rspin_lock_init_prof() for rspinlock_t only. Using typeof() would make either of them usable for both types. Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
