mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
rust: block: mq: use pin_init::zeroed() for tag_set
Replace unsafe core::mem::zeroed() with pin_init::zeroed() for blk_mq_tag_set initialization. Signed-off-by: Ke Sun <sunke@kylinos.cn> Acked-by: Andreas Hindborg <a.hindborg@kernel.org> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://lore.kernel.org/r/20260120083824.477339-4-sunke@kylinos.cn Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d7a4693a25
commit
880528eaa6
1 changed files with 1 additions and 3 deletions
|
|
@ -38,9 +38,7 @@ impl<T: Operations> TagSet<T> {
|
|||
num_tags: u32,
|
||||
num_maps: u32,
|
||||
) -> impl PinInit<Self, error::Error> {
|
||||
// SAFETY: `blk_mq_tag_set` only contains integers and pointers, which
|
||||
// all are allowed to be 0.
|
||||
let tag_set: bindings::blk_mq_tag_set = unsafe { core::mem::zeroed() };
|
||||
let tag_set: bindings::blk_mq_tag_set = pin_init::zeroed();
|
||||
let tag_set: Result<_> = core::mem::size_of::<RequestDataWrapper>()
|
||||
.try_into()
|
||||
.map(|cmd_size| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue