Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'locking-core-2025-01-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking updates from Ingo Molnar:
"Lockdep:

- Improve and fix lockdep bitsize limits, clarify the Kconfig
documentation (Carlos Llamas)

- Fix lockdep build warning on Clang related to
chain_hlock_class_idx() inlining (Andy Shevchenko)

- Relax the requirements of PROVE_RAW_LOCK_NESTING arch support by
not tying it to ARCH_SUPPORTS_RT unnecessarily (Waiman Long)

Rust integration:

- Support lock pointers managed by the C side (Lyude Paul)

- Support guard types (Lyude Paul)

- Update MAINTAINERS file filters to include the Rust locking code
(Boqun Feng)

Wake-queues:

- Add raw_spin_*wake() helpers to simplify locking code (John Stultz)

SMP cross-calls:

- Fix potential data update race by evaluating the local cond_func()
before IPI side-effects (Mathieu Desnoyers)

Guard primitives:

- Ease [c]tags based searches by including the cleanup/guard type
primitives (Peter Zijlstra)

ww_mutexes:

- Simplify the ww_mutex self-test code via swap() (Thorsten Blum)

Static calls:

- Update the static calls MAINTAINERS file-pattern (Jiri Slaby)"

* tag 'locking-core-2025-01-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
MAINTAINERS: Add static_call_inline.c to STATIC BRANCH/CALL
cleanup, tags: Create tags for the cleanup primitives
sched/wake_q: Add helper to call wake_up_q after unlock with preemption disabled
rust: sync: Add lock::Backend::assert_is_held()
rust: sync: Add SpinLockGuard type alias
rust: sync: Add MutexGuard type alias
rust: sync: Make Guard::new() public
rust: sync: Add Lock::from_raw() for Lock<(), B>
locking: MAINTAINERS: Start watching Rust locking primitives
lockdep: Move lockdep_assert_locked() under #ifdef CONFIG_PROVE_LOCKING
lockdep: Mark chain_hlock_class_idx() with __maybe_unused
lockdep: Document MAX_LOCKDEP_CHAIN_HLOCKS calculation
lockdep: Clarify size for LOCKDEP_*_BITS configs
lockdep: Fix upper limit for LOCKDEP_*_BITS configs
locking/ww_mutex/test: Use swap() macro
smp/scf: Evaluate local cond_func() before IPI side-effects
locking/lockdep: Enforce PROVE_RAW_LOCK_NESTING only if ARCH_SUPPORTS_RT

+152 -69
+7 -2
MAINTAINERS
··· 13439 13439 M: Peter Zijlstra <peterz@infradead.org> 13440 13440 M: Ingo Molnar <mingo@redhat.com> 13441 13441 M: Will Deacon <will@kernel.org> 13442 + M: Boqun Feng <boqun.feng@gmail.com> (LOCKDEP & RUST) 13442 13443 R: Waiman Long <longman@redhat.com> 13443 - R: Boqun Feng <boqun.feng@gmail.com> (LOCKDEP) 13444 13444 L: linux-kernel@vger.kernel.org 13445 13445 S: Maintained 13446 13446 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core ··· 13454 13454 F: include/linux/spinlock*.h 13455 13455 F: kernel/locking/ 13456 13456 F: lib/locking*.[ch] 13457 + F: rust/helpers/mutex.c 13458 + F: rust/helpers/spinlock.c 13459 + F: rust/kernel/sync/lock.rs 13460 + F: rust/kernel/sync/lock/ 13461 + F: rust/kernel/sync/locked_by.rs 13457 13462 X: kernel/locking/locktorture.c 13458 13463 13459 13464 LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks) ··· 22472 22467 F: include/linux/jump_label*.h 22473 22468 F: include/linux/static_call*.h 22474 22469 F: kernel/jump_label.c 22475 - F: kernel/static_call.c 22470 + F: kernel/static_call*.c 22476 22471 22477 22472 STI AUDIO (ASoC) DRIVERS 22478 22473 M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
+34
include/linux/sched/wake_q.h
··· 63 63 extern void wake_q_add_safe(struct wake_q_head *head, struct task_struct *task); 64 64 extern void wake_up_q(struct wake_q_head *head); 65 65 66 + /* Spin unlock helpers to unlock and call wake_up_q with preempt disabled */ 67 + static inline 68 + void raw_spin_unlock_wake(raw_spinlock_t *lock, struct wake_q_head *wake_q) 69 + { 70 + guard(preempt)(); 71 + raw_spin_unlock(lock); 72 + if (wake_q) { 73 + wake_up_q(wake_q); 74 + wake_q_init(wake_q); 75 + } 76 + } 77 + 78 + static inline 79 + void raw_spin_unlock_irq_wake(raw_spinlock_t *lock, struct wake_q_head *wake_q) 80 + { 81 + guard(preempt)(); 82 + raw_spin_unlock_irq(lock); 83 + if (wake_q) { 84 + wake_up_q(wake_q); 85 + wake_q_init(wake_q); 86 + } 87 + } 88 + 89 + static inline 90 + void raw_spin_unlock_irqrestore_wake(raw_spinlock_t *lock, unsigned long flags, 91 + struct wake_q_head *wake_q) 92 + { 93 + guard(preempt)(); 94 + raw_spin_unlock_irqrestore(lock, flags); 95 + if (wake_q) { 96 + wake_up_q(wake_q); 97 + wake_q_init(wake_q); 98 + } 99 + } 66 100 #endif /* _LINUX_SCHED_WAKE_Q_H */
+1 -4
kernel/futex/pi.c
··· 1020 1020 * it sees the futex_q::pi_state. 1021 1021 */ 1022 1022 ret = __rt_mutex_start_proxy_lock(&q.pi_state->pi_mutex, &rt_waiter, current, &wake_q); 1023 - preempt_disable(); 1024 - raw_spin_unlock_irq(&q.pi_state->pi_mutex.wait_lock); 1025 - wake_up_q(&wake_q); 1026 - preempt_enable(); 1023 + raw_spin_unlock_irq_wake(&q.pi_state->pi_mutex.wait_lock, &wake_q); 1027 1024 1028 1025 if (ret) { 1029 1026 if (ret == 1)
+3 -1
kernel/locking/lockdep.c
··· 157 157 __this_cpu_dec(lockdep_recursion); 158 158 } 159 159 160 + #ifdef CONFIG_PROVE_LOCKING 160 161 static inline bool lockdep_assert_locked(void) 161 162 { 162 163 return DEBUG_LOCKS_WARN_ON(__owner != current); 163 164 } 165 + #endif 164 166 165 167 static struct task_struct *lockdep_selftest_task_struct; 166 168 ··· 432 430 return (hlock->class_idx | (hlock->read << MAX_LOCKDEP_KEYS_BITS)); 433 431 } 434 432 435 - static inline unsigned int chain_hlock_class_idx(u16 hlock_id) 433 + static inline __maybe_unused unsigned int chain_hlock_class_idx(u16 hlock_id) 436 434 { 437 435 return hlock_id & (MAX_LOCKDEP_KEYS - 1); 438 436 }
+2 -1
kernel/locking/lockdep_internals.h
··· 119 119 120 120 #define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS) 121 121 122 - #define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5) 122 + #define AVG_LOCKDEP_CHAIN_DEPTH 5 123 + #define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS * AVG_LOCKDEP_CHAIN_DEPTH) 123 124 124 125 extern struct lock_chain lock_chains[]; 125 126
+4 -12
kernel/locking/mutex.c
··· 657 657 goto err; 658 658 } 659 659 660 - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); 661 - /* Make sure we do wakeups before calling schedule */ 662 - wake_up_q(&wake_q); 663 - wake_q_init(&wake_q); 660 + raw_spin_unlock_irqrestore_wake(&lock->wait_lock, flags, &wake_q); 664 661 665 662 schedule_preempt_disabled(); 666 663 ··· 707 710 if (ww_ctx) 708 711 ww_mutex_lock_acquired(ww, ww_ctx); 709 712 710 - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); 711 - wake_up_q(&wake_q); 713 + raw_spin_unlock_irqrestore_wake(&lock->wait_lock, flags, &wake_q); 712 714 preempt_enable(); 713 715 return 0; 714 716 ··· 716 720 __mutex_remove_waiter(lock, &waiter); 717 721 err_early_kill: 718 722 trace_contention_end(lock, ret); 719 - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); 723 + raw_spin_unlock_irqrestore_wake(&lock->wait_lock, flags, &wake_q); 720 724 debug_mutex_free_waiter(&waiter); 721 725 mutex_release(&lock->dep_map, ip); 722 - wake_up_q(&wake_q); 723 726 preempt_enable(); 724 727 return ret; 725 728 } ··· 930 935 if (owner & MUTEX_FLAG_HANDOFF) 931 936 __mutex_handoff(lock, next); 932 937 933 - preempt_disable(); 934 - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); 935 - wake_up_q(&wake_q); 936 - preempt_enable(); 938 + raw_spin_unlock_irqrestore_wake(&lock->wait_lock, flags, &wake_q); 937 939 } 938 940 939 941 #ifndef CONFIG_DEBUG_LOCK_ALLOC
+5 -27
kernel/locking/rtmutex.c
··· 1292 1292 */ 1293 1293 get_task_struct(owner); 1294 1294 1295 - preempt_disable(); 1296 - raw_spin_unlock_irq(&lock->wait_lock); 1297 - /* wake up any tasks on the wake_q before calling rt_mutex_adjust_prio_chain */ 1298 - wake_up_q(wake_q); 1299 - wake_q_init(wake_q); 1300 - preempt_enable(); 1301 - 1295 + raw_spin_unlock_irq_wake(&lock->wait_lock, wake_q); 1302 1296 1303 1297 res = rt_mutex_adjust_prio_chain(owner, chwalk, lock, 1304 1298 next_lock, waiter, task); ··· 1636 1642 owner = rt_mutex_owner(lock); 1637 1643 else 1638 1644 owner = NULL; 1639 - preempt_disable(); 1640 - raw_spin_unlock_irq(&lock->wait_lock); 1641 - if (wake_q) { 1642 - wake_up_q(wake_q); 1643 - wake_q_init(wake_q); 1644 - } 1645 - preempt_enable(); 1645 + raw_spin_unlock_irq_wake(&lock->wait_lock, wake_q); 1646 1646 1647 1647 if (!owner || !rtmutex_spin_on_owner(lock, waiter, owner)) 1648 1648 rt_mutex_schedule(); ··· 1787 1799 */ 1788 1800 raw_spin_lock_irqsave(&lock->wait_lock, flags); 1789 1801 ret = __rt_mutex_slowlock_locked(lock, ww_ctx, state, &wake_q); 1790 - preempt_disable(); 1791 - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); 1792 - wake_up_q(&wake_q); 1793 - preempt_enable(); 1802 + raw_spin_unlock_irqrestore_wake(&lock->wait_lock, flags, &wake_q); 1794 1803 rt_mutex_post_schedule(); 1795 1804 1796 1805 return ret; ··· 1845 1860 owner = rt_mutex_owner(lock); 1846 1861 else 1847 1862 owner = NULL; 1848 - preempt_disable(); 1849 - raw_spin_unlock_irq(&lock->wait_lock); 1850 - wake_up_q(wake_q); 1851 - wake_q_init(wake_q); 1852 - preempt_enable(); 1863 + raw_spin_unlock_irq_wake(&lock->wait_lock, wake_q); 1853 1864 1854 1865 if (!owner || !rtmutex_spin_on_owner(lock, &waiter, owner)) 1855 1866 schedule_rtlock(); ··· 1874 1893 1875 1894 raw_spin_lock_irqsave(&lock->wait_lock, flags); 1876 1895 rtlock_slowlock_locked(lock, &wake_q); 1877 - preempt_disable(); 1878 - raw_spin_unlock_irqrestore(&lock->wait_lock, flags); 1879 - wake_up_q(&wake_q); 1880 - preempt_enable(); 1896 + raw_spin_unlock_irqrestore_wake(&lock->wait_lock, flags, &wake_q); 1881 1897 } 1882 1898 1883 1899 #endif /* RT_MUTEX_BUILD_SPINLOCKS */
+3 -6
kernel/locking/test-ww_mutex.c
··· 404 404 static int *get_random_order(int count) 405 405 { 406 406 int *order; 407 - int n, r, tmp; 407 + int n, r; 408 408 409 409 order = kmalloc_array(count, sizeof(*order), GFP_KERNEL); 410 410 if (!order) ··· 415 415 416 416 for (n = count - 1; n > 1; n--) { 417 417 r = prandom_u32_below(n + 1); 418 - if (r != n) { 419 - tmp = order[n]; 420 - order[n] = order[r]; 421 - order[r] = tmp; 422 - } 418 + if (r != n) 419 + swap(order[n], order[r]); 423 420 } 424 421 425 422 return order;
+3 -2
kernel/smp.c
··· 815 815 WARN_ON_ONCE(!in_task()); 816 816 817 817 /* Check if we need local execution. */ 818 - if ((scf_flags & SCF_RUN_LOCAL) && cpumask_test_cpu(this_cpu, mask)) 818 + if ((scf_flags & SCF_RUN_LOCAL) && cpumask_test_cpu(this_cpu, mask) && 819 + (!cond_func || cond_func(this_cpu, info))) 819 820 run_local = true; 820 821 821 822 /* Check if we need remote execution, i.e., any CPU excluding this one. */ ··· 869 868 send_call_function_ipi_mask(cfd->cpumask_ipi); 870 869 } 871 870 872 - if (run_local && (!cond_func || cond_func(this_cpu, info))) { 871 + if (run_local) { 873 872 unsigned long flags; 874 873 875 874 local_irq_save(flags);
+11 -11
lib/Kconfig.debug
··· 1397 1397 For more details, see Documentation/locking/lockdep-design.rst. 1398 1398 1399 1399 config PROVE_RAW_LOCK_NESTING 1400 - bool 1400 + bool "Enable raw_spinlock - spinlock nesting checks" if !ARCH_SUPPORTS_RT 1401 1401 depends on PROVE_LOCKING 1402 - default y 1402 + default y if ARCH_SUPPORTS_RT 1403 1403 help 1404 1404 Enable the raw_spinlock vs. spinlock nesting checks which ensure 1405 1405 that the lock nesting rules for PREEMPT_RT enabled kernels are ··· 1502 1502 bool 1503 1503 1504 1504 config LOCKDEP_BITS 1505 - int "Bitsize for MAX_LOCKDEP_ENTRIES" 1505 + int "Size for MAX_LOCKDEP_ENTRIES (as Nth power of 2)" 1506 1506 depends on LOCKDEP && !LOCKDEP_SMALL 1507 - range 10 30 1507 + range 10 24 1508 1508 default 15 1509 1509 help 1510 1510 Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message. 1511 1511 1512 1512 config LOCKDEP_CHAINS_BITS 1513 - int "Bitsize for MAX_LOCKDEP_CHAINS" 1513 + int "Size for MAX_LOCKDEP_CHAINS (as Nth power of 2)" 1514 1514 depends on LOCKDEP && !LOCKDEP_SMALL 1515 1515 range 10 21 1516 1516 default 16 ··· 1518 1518 Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message. 1519 1519 1520 1520 config LOCKDEP_STACK_TRACE_BITS 1521 - int "Bitsize for MAX_STACK_TRACE_ENTRIES" 1521 + int "Size for MAX_STACK_TRACE_ENTRIES (as Nth power of 2)" 1522 1522 depends on LOCKDEP && !LOCKDEP_SMALL 1523 - range 10 30 1523 + range 10 26 1524 1524 default 19 1525 1525 help 1526 1526 Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message. 1527 1527 1528 1528 config LOCKDEP_STACK_TRACE_HASH_BITS 1529 - int "Bitsize for STACK_TRACE_HASH_SIZE" 1529 + int "Size for STACK_TRACE_HASH_SIZE (as Nth power of 2)" 1530 1530 depends on LOCKDEP && !LOCKDEP_SMALL 1531 - range 10 30 1531 + range 10 26 1532 1532 default 14 1533 1533 help 1534 1534 Try increasing this value if you need large STACK_TRACE_HASH_SIZE. 1535 1535 1536 1536 config LOCKDEP_CIRCULAR_QUEUE_BITS 1537 - int "Bitsize for elements in circular_queue struct" 1537 + int "Size for elements in circular_queue struct (as Nth power of 2)" 1538 1538 depends on LOCKDEP 1539 - range 10 30 1539 + range 10 26 1540 1540 default 12 1541 1541 help 1542 1542 Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure.
+5
rust/helpers/mutex.c
··· 12 12 { 13 13 __mutex_init(mutex, name, key); 14 14 } 15 + 16 + void rust_helper_mutex_assert_is_held(struct mutex *mutex) 17 + { 18 + lockdep_assert_held(mutex); 19 + }
+5
rust/helpers/spinlock.c
··· 30 30 { 31 31 return spin_trylock(lock); 32 32 } 33 + 34 + void rust_helper_spin_assert_is_held(spinlock_t *lock) 35 + { 36 + lockdep_assert_held(lock); 37 + }
+2 -2
rust/kernel/sync.rs
··· 16 16 pub use arc::{Arc, ArcBorrow, UniqueArc}; 17 17 pub use condvar::{new_condvar, CondVar, CondVarTimeoutResult}; 18 18 pub use lock::global::{global_lock, GlobalGuard, GlobalLock, GlobalLockBackend, GlobalLockedBy}; 19 - pub use lock::mutex::{new_mutex, Mutex}; 20 - pub use lock::spinlock::{new_spinlock, SpinLock}; 19 + pub use lock::mutex::{new_mutex, Mutex, MutexGuard}; 20 + pub use lock::spinlock::{new_spinlock, SpinLock, SpinLockGuard}; 21 21 pub use locked_by::LockedBy; 22 22 23 23 /// Represents a lockdep class. It's a wrapper around C's `lock_class_key`.
+34 -1
rust/kernel/sync/lock.rs
··· 90 90 // SAFETY: The safety requirements ensure that the lock is initialised. 91 91 *guard_state = unsafe { Self::lock(ptr) }; 92 92 } 93 + 94 + /// Asserts that the lock is held using lockdep. 95 + /// 96 + /// # Safety 97 + /// 98 + /// Callers must ensure that [`Backend::init`] has been previously called. 99 + unsafe fn assert_is_held(ptr: *mut Self::State); 93 100 } 94 101 95 102 /// A mutual exclusion primitive. 96 103 /// 97 104 /// Exposes one of the kernel locking primitives. Which one is exposed depends on the lock 98 105 /// [`Backend`] specified as the generic parameter `B`. 106 + #[repr(C)] 99 107 #[pin_data] 100 108 pub struct Lock<T: ?Sized, B: Backend> { 101 109 /// The kernel lock object. ··· 139 131 B::init(slot, name.as_char_ptr(), key.as_ptr()) 140 132 }), 141 133 }) 134 + } 135 + } 136 + 137 + impl<B: Backend> Lock<(), B> { 138 + /// Constructs a [`Lock`] from a raw pointer. 139 + /// 140 + /// This can be useful for interacting with a lock which was initialised outside of Rust. 141 + /// 142 + /// # Safety 143 + /// 144 + /// The caller promises that `ptr` points to a valid initialised instance of [`State`] during 145 + /// the whole lifetime of `'a`. 146 + /// 147 + /// [`State`]: Backend::State 148 + pub unsafe fn from_raw<'a>(ptr: *mut B::State) -> &'a Self { 149 + // SAFETY: 150 + // - By the safety contract `ptr` must point to a valid initialised instance of `B::State` 151 + // - Since the lock data type is `()` which is a ZST, `state` is the only non-ZST member of 152 + // the struct 153 + // - Combined with `#[repr(C)]`, this guarantees `Self` has an equivalent data layout to 154 + // `B::State`. 155 + unsafe { &*ptr.cast() } 142 156 } 143 157 } 144 158 ··· 241 211 /// # Safety 242 212 /// 243 213 /// The caller must ensure that it owns the lock. 244 - pub(crate) unsafe fn new(lock: &'a Lock<T, B>, state: B::GuardState) -> Self { 214 + pub unsafe fn new(lock: &'a Lock<T, B>, state: B::GuardState) -> Self { 215 + // SAFETY: The caller can only hold the lock if `Backend::init` has already been called. 216 + unsafe { B::assert_is_held(lock.state.get()) }; 217 + 245 218 Self { 246 219 lock, 247 220 state,
+13
rust/kernel/sync/lock/mutex.rs
··· 86 86 /// [`struct mutex`]: srctree/include/linux/mutex.h 87 87 pub type Mutex<T> = super::Lock<T, MutexBackend>; 88 88 89 + /// A [`Guard`] acquired from locking a [`Mutex`]. 90 + /// 91 + /// This is simply a type alias for a [`Guard`] returned from locking a [`Mutex`]. It will unlock 92 + /// the [`Mutex`] upon being dropped. 93 + /// 94 + /// [`Guard`]: super::Guard 95 + pub type MutexGuard<'a, T> = super::Guard<'a, T, MutexBackend>; 96 + 89 97 /// A kernel `struct mutex` lock backend. 90 98 pub struct MutexBackend; 91 99 ··· 133 125 } else { 134 126 None 135 127 } 128 + } 129 + 130 + unsafe fn assert_is_held(ptr: *mut Self::State) { 131 + // SAFETY: The `ptr` pointer is guaranteed to be valid and initialized before use. 132 + unsafe { bindings::mutex_assert_is_held(ptr) } 136 133 } 137 134 }
+13
rust/kernel/sync/lock/spinlock.rs
··· 87 87 /// A kernel `spinlock_t` lock backend. 88 88 pub struct SpinLockBackend; 89 89 90 + /// A [`Guard`] acquired from locking a [`SpinLock`]. 91 + /// 92 + /// This is simply a type alias for a [`Guard`] returned from locking a [`SpinLock`]. It will unlock 93 + /// the [`SpinLock`] upon being dropped. 94 + /// 95 + /// [`Guard`]: super::Guard 96 + pub type SpinLockGuard<'a, T> = super::Guard<'a, T, SpinLockBackend>; 97 + 90 98 // SAFETY: The underlying kernel `spinlock_t` object ensures mutual exclusion. `relock` uses the 91 99 // default implementation that always calls the same locking method. 92 100 unsafe impl super::Backend for SpinLockBackend { ··· 132 124 } else { 133 125 None 134 126 } 127 + } 128 + 129 + unsafe fn assert_is_held(ptr: *mut Self::State) { 130 + // SAFETY: The `ptr` pointer is guaranteed to be valid and initialized before use. 131 + unsafe { bindings::spin_assert_is_held(ptr) } 135 132 } 136 133 }
+7
scripts/tags.sh
··· 212 212 '/^SEQCOUNT_LOCKTYPE(\([^,]*\),[[:space:]]*\([^,]*\),[^)]*)/seqcount_\2_init/' 213 213 '/^\<DECLARE_IDTENTRY[[:alnum:]_]*([^,)]*,[[:space:]]*\([[:alnum:]_]\+\)/\1/' 214 214 '/^\<DEFINE_IDTENTRY[[:alnum:]_]*([[:space:]]*\([[:alnum:]_]\+\)/\1/' 215 + '/^\<DEFINE_FREE(\([[:alnum:]_]\+\)/cleanup_\1/' 216 + '/^\<DEFINE_CLASS(\([[:alnum:]_]\+\)/class_\1/' 217 + '/^\<EXTEND_CLASS(\([[:alnum:]_]\+\),[[:space:]]*\([[:alnum:]_]\+\)/class_\1\2/' 218 + '/^\<DEFINE_GUARD(\([[:alnum:]_]\+\)/class_\1/' 219 + '/^\<DEFINE_GUARD_COND(\([[:alnum:]_]\+\),[[:space:]]*\([[:alnum:]_]\+\)/class_\1\2/' 220 + '/^\<DEFINE_LOCK_GUARD_[[:digit:]](\([[:alnum:]_]\+\)/class_\1/' 221 + '/^\<DEFINE_LOCK_GUARD_[[:digit:]]_COND(\([[:alnum:]_]\+\),[[:space:]]*\([[:alnum:]_]\+\)/class_\1\2/' 215 222 ) 216 223 regex_kconfig=( 217 224 '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/'