Skip to content

Commit 597b93b

Browse files
gregkhopsiff
authored andcommitted
Revert "rust: pin-init: internal: init: document load-bearing fact of field accessors"
This reverts commit 0890fba6129dc244bd6d61756dda1ec69b24f60b which is commit 580cc37b1de4fcd9997c48d7080e744533f09f36 upstream. It breaks the build at this time. Link: https://lore.kernel.org/r/20260402112712.110869-1-ojeda@kernel.org Reported-by: Miguel Ojeda <ojeda@kernel.org> Cc: Benno Lossin <lossin@kernel.org> Cc: Gary Guo <gary@garyguo.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit e7ccb57fe716486f2c41e265d205e143f11cb4a8) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent bc89a99 commit 597b93b

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

rust/kernel/init/macros.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,10 +1205,6 @@ macro_rules! __init_internal {
12051205
// return when an error/panic occurs.
12061206
// We also use the `data` to require the correct trait (`Init` or `PinInit`) for `$field`.
12071207
unsafe { $data.$field(::core::ptr::addr_of_mut!((*$slot).$field), init)? };
1208-
// NOTE: the field accessor ensures that the initialized field is properly aligned.
1209-
// Unaligned fields will cause the compiler to emit E0793. We do not support
1210-
// unaligned fields since `Init::__init` requires an aligned pointer; the call to
1211-
// `ptr::write` below has the same requirement.
12121208
// SAFETY:
12131209
// - the project function does the correct field projection,
12141210
// - the field has been initialized,
@@ -1248,10 +1244,6 @@ macro_rules! __init_internal {
12481244
// return when an error/panic occurs.
12491245
unsafe { $crate::init::Init::__init(init, ::core::ptr::addr_of_mut!((*$slot).$field))? };
12501246

1251-
// NOTE: the field accessor ensures that the initialized field is properly aligned.
1252-
// Unaligned fields will cause the compiler to emit E0793. We do not support
1253-
// unaligned fields since `Init::__init` requires an aligned pointer; the call to
1254-
// `ptr::write` below has the same requirement.
12551247
// SAFETY:
12561248
// - the field is not structurally pinned, since the line above must compile,
12571249
// - the field has been initialized,
@@ -1292,10 +1284,6 @@ macro_rules! __init_internal {
12921284
unsafe { ::core::ptr::write(::core::ptr::addr_of_mut!((*$slot).$field), $field) };
12931285
}
12941286

1295-
// NOTE: the field accessor ensures that the initialized field is properly aligned.
1296-
// Unaligned fields will cause the compiler to emit E0793. We do not support
1297-
// unaligned fields since `Init::__init` requires an aligned pointer; the call to
1298-
// `ptr::write` below has the same requirement.
12991287
#[allow(unused_variables, unused_assignments)]
13001288
// SAFETY:
13011289
// - the field is not structurally pinned, since no `use_data` was required to create this
@@ -1336,10 +1324,6 @@ macro_rules! __init_internal {
13361324
// SAFETY: The memory at `slot` is uninitialized.
13371325
unsafe { ::core::ptr::write(::core::ptr::addr_of_mut!((*$slot).$field), $field) };
13381326
}
1339-
// NOTE: the field accessor ensures that the initialized field is properly aligned.
1340-
// Unaligned fields will cause the compiler to emit E0793. We do not support
1341-
// unaligned fields since `Init::__init` requires an aligned pointer; the call to
1342-
// `ptr::write` below has the same requirement.
13431327
// SAFETY:
13441328
// - the project function does the correct field projection,
13451329
// - the field has been initialized,

0 commit comments

Comments
 (0)