Allow all-zero initialization for structures that have KABI padding
added. Otherwise, the new __kabi_reserved* fields would need to be
individually initialized. This fixes reported errors such as:
error[E0063]: missing field `__kabi_reserved1` in initializer of `blk_mq_ops`
--> /proc/self/cwd/common/rust/kernel/block/mq/operations.rs:216:42
|
216 | const VTABLE: bindings::blk_mq_ops = bindings::blk_mq_ops {
| ^^^^^^^^^^^^^^^^^^^^ missing `__kabi_reserved1`
Bug: 151154716
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Matthew Maurer <mmaurer@google.com>
Cc: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If7996037e95b3947eb3b3afa9513cff18f4be116
Signed-off-by: Carlos Llamas <cmllamas@google.com>
commit d072acda4862f095ec9056979b654cc06a22cc68 upstream.
Currently FFI integer types are defined in libcore. This commit creates
the `ffi` crate and asks bindgen to use that crate for FFI integer types
instead of `core::ffi`.
This commit is preparatory and no type changes are made in this commit
yet.
Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20240913213041.395655-4-gary@garyguo.net
[ Added `rustdoc`, `rusttest` and KUnit tests support. Rebased on top of
`rust-next` (e.g. migrated more `core::ffi` cases). Reworded crate
docs slightly and formatted. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 28e848386b92645f93b9f2fdba5882c3ca7fb3e2 ]
Fix several issues with rustdoc formatting for the
`kernel::block::mq::Request` module, in particular:
- An ordered list not rendering correctly, fixed by using numbers
prefixes instead of letters.
- Code snippets formatted as regular text, fixed by wrapping the
code with `back-ticks`.
- References to types missing intra-doc links, fixed by wrapping the
types with [square brackets].
Reported-by: Miguel Ojeda <ojeda@kernel.org>
Closes: https://github.com/Rust-for-Linux/linux/issues/1108
Signed-off-by: Francesco Zardi <frazar00@gmail.com>
Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Fixes: 3253aba340 ("rust: block: introduce `kernel::block::mq` module")
Link: https://lore.kernel.org/r/20240903173027.16732-3-frazar00@gmail.com
[ Added an extra intra-doc link. Took the chance to add some periods
for consistency. Reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>