File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -30,28 +30,20 @@ pub struct LockClassKey(Opaque<bindings::lock_class_key>);
30
30
unsafe impl Sync for LockClassKey { }
31
31
32
32
impl LockClassKey {
33
- /// Creates a new lock class key.
34
- pub const fn new ( ) -> Self {
35
- Self ( Opaque :: uninit ( ) )
36
- }
37
-
38
33
pub ( crate ) fn as_ptr ( & self ) -> * mut bindings:: lock_class_key {
39
34
self . 0 . get ( )
40
35
}
41
36
}
42
37
43
- impl Default for LockClassKey {
44
- fn default ( ) -> Self {
45
- Self :: new ( )
46
- }
47
- }
48
-
49
38
/// Defines a new static lock class and returns a pointer to it.
50
39
#[ doc( hidden) ]
51
40
#[ macro_export]
52
41
macro_rules! static_lock_class {
53
42
( ) => { {
54
- static CLASS : $crate:: sync:: LockClassKey = $crate:: sync:: LockClassKey :: new( ) ;
43
+ static CLASS : $crate:: sync:: LockClassKey =
44
+ // SAFETY: lockdep expects uninitialized memory when it's handed a statically allocated
45
+ // lock_class_key
46
+ unsafe { :: core:: mem:: MaybeUninit :: uninit( ) . assume_init( ) } ;
55
47
& CLASS
56
48
} } ;
57
49
}
You can’t perform that action at this time.
0 commit comments