From: Andreas Hindborg <a.hindborg@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
"Frederic Weisbecker" <frederic@kernel.org>,
"Lyude Paul" <lyude@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Anna-Maria Behnsen" <anna-maria@linutronix.de>,
"John Stultz" <jstultz@google.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
"Daniel Almeida" <daniel.almeida@collabora.com>
Subject: Re: [PATCH v3] hrtimer: add usage examples to documentation
Date: Mon, 23 Feb 2026 18:22:16 +0100 [thread overview]
Message-ID: <87ikbn2x4n.fsf@t14s.mail-host-address-is-not-set> (raw)
In-Reply-To: <CANiq72naMNGc8p3GJT6gBisOn7Kv0pU2-B6-O3GPKodcKjzKiw@mail.gmail.com>
"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com> writes:
> On Mon, Feb 23, 2026 at 4:29 PM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>>
>> So, after copying these use statements elsewhere to format them, I was
>> rereading your message and I see that what you actually write is that
>> maybe we should be using the vertical style for imports in examples.
>>
>> The examples would be nothing but a wall of use statements. Do we
>> really want that? I know it is the style we picked for the kernel in
>> general, but I don't think it should necessarily apply to the examples.
>
> That is why I asked if we could perhaps merge two pairs of examples :)
> i.e. to reduce the "duplicated" boilerplate from the imports, and
> perhaps a couple of the items/types that are the same too.
>
> Either that, or you may want to hide them (but I am considering that
> we may want to just never hide them (or always doing so) and thus
> avoid the discussions that keep coming up on that).
>
> As for using a different style for examples, I can see we could save a
> few lines per example, but we would have to remember a different
> convention and we would increase the risk of conflicts there (though I
> reckon there may be not many conflicts there unlike the module
> imports).
I think I'll await broader consensus before shipping another version of
this patch. My 2c is that the imports take away form the actual example
code. I'd rather not have them.
If we are going to keep the imports visible in the examples, I would
prefer to fold the imports, so they take less space. I realize this is
not consistent with the general style we adopted, but I don't think that
is important. These are just examples to help understand an API. They
are not going to be subject of merge conflicts at a regular basis.
If we hide the imports, we might as well go for consistency with the
style we adopted.
Best regards,
Andreas Hindborg
prev parent reply other threads:[~2026-02-23 17:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 8:11 Andreas Hindborg
2026-02-20 18:18 ` Miguel Ojeda
2026-02-23 15:15 ` Andreas Hindborg
2026-02-23 15:28 ` Andreas Hindborg
2026-02-23 15:46 ` Miguel Ojeda
2026-02-23 17:22 ` Andreas Hindborg [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=87ikbn2x4n.fsf@t14s.mail-host-address-is-not-set \
--to=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=anna-maria@linutronix.de \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=frederic@kernel.org \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=lyude@redhat.com \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=tglx@linutronix.de \
--cc=tmgross@umich.edu \
/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
all inboxes | Powered by JetHome®