diff options
author | Benno Lossin <benno.lossin@proton.me> | 2023-08-14 10:46:31 +0200 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2023-08-21 14:31:48 +0200 |
commit | f8badd150763ae0f9c8482fabe0fdbac81735d34 (patch) | |
tree | 2e751ab3ffa7184d23860e104b136c0db44eb15b /rust/kernel/init/__internal.rs | |
parent | rust: init: consolidate init macros (diff) | |
download | linux-f8badd150763ae0f9c8482fabe0fdbac81735d34.tar.xz linux-f8badd150763ae0f9c8482fabe0fdbac81735d34.zip |
rust: init: make `#[pin_data]` compatible with conditional compilation of fields
This patch allows one to write
```
#[pin_data]
pub struct Foo {
#[cfg(CONFIG_BAR)]
a: Bar,
#[cfg(not(CONFIG_BAR))]
a: Baz,
}
```
Before, this would result in a compile error, because `#[pin_data]`
would generate two functions named `a` for both fields unconditionally.
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230814084602.25699-3-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/init/__internal.rs')
0 files changed, 0 insertions, 0 deletions