From: Alice Ryhl <aliceryhl@google.com>
To: Christian Benton <t1bur0n.kernel.org@protonmail.ch>
Cc: ojeda@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org,
rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, lossin@kernel.org
Subject: Re: [PATCH] rust: seq_file: add puts, putc, write, and hex_dump methods
Date: Tue, 7 Apr 2026 08:20:25 +0000 [thread overview]
Message-ID: <adS-SU4DzxC0ewnS@google.com> (raw)
In-Reply-To: <20260403233900.24640-1-t1bur0n.kernel.org@protonmail.ch>
On Fri, Apr 03, 2026 at 11:39:32PM +0000, Christian Benton wrote:
> The SeqFile abstraction currently only exposes seq_printf via the
> seq_print! macro. This leaves several commonly used seq_file operations
> unavailable to Rust kernel code.
>
> Add the following methods to SeqFile:
>
> - puts(): writes a C string using __seq_puts()
> - putc(): writes a single byte using seq_putc()
> - write(): writes raw bytes using seq_write()
> - hex_dump(): dumps binary data as formatted hex using seq_hex_dump()
>
> Also add HexDumpPrefix, a Rust enum wrapping the DUMP_PREFIX_NONE,
> DUMP_PREFIX_ADDRESS, and DUMP_PREFIX_OFFSET constants, replacing the
> raw integer interface with a type-safe alternative that makes invalid
> prefix values unrepresentable.
>
> Signed-off-by: Christian Benton <t1bur0n.kernel.org@protonmail.ch>
What is the use-case that motivated this patch?
It's possible that Rust Binder has some use-cases that can be converted
to puts(), but I don't think it has use-cases for the other methods.
Alice
prev parent reply other threads:[~2026-04-07 8:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 23:39 [PATCH] rust: seq_file: add puts, putc, write, and hex_dump methods Christian Benton
2026-04-07 8:20 ` Alice Ryhl [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adS-SU4DzxC0ewnS@google.com \
--to=aliceryhl@google.com \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=t1bur0n.kernel.org@protonmail.ch \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox