rust: block: use `NullTerminatedFormatter`
authorAndreas Hindborg <a.hindborg@kernel.org>
Tue, 2 Sep 2025 09:55:02 +0000 (11:55 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Sep 2025 11:23:56 +0000 (05:23 -0600)
commitc3a54220b54a1bda0662f0e7ab90ffabf5036d50
tree9c7f998428b5767c7f857678e886a24e4ec15eec
parentf4b72f1558be1e2b173b6b1f93c09dc668592a26
rust: block: use `NullTerminatedFormatter`

Use the new `NullTerminatedFormatter` to write the name of a `GenDisk` to
the name buffer. This new formatter automatically adds a trailing null
marker after the written characters, so we don't need to append that at the
call site any longer.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250902-rnull-up-v6-16-v7-8-b5212cc89b98@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
rust/kernel/block/mq/gen_disk.rs
rust/kernel/block/mq/raw_writer.rs
rust/kernel/str.rs