Re: [PATCH v3] hrtimer: add usage examples to documentation

From: Andreas Hindborg

Date: Mon Feb 23 2026 - 10:29:52 EST


Andreas Hindborg <a.hindborg@xxxxxxxxxx> writes:

> Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> writes:
>
>> On Fri, Feb 20, 2026 at 9:12 AM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>>>
>>> +//! prelude::*,
>>
>> The prelude should already be there in examples.
>>
>>> +//! sync::{
>>> +//! atomic::{ordering, Atomic},
>>> +//! completion::Completion,
>>> +//! Arc,
>>> +//! },
>>> +//! time::{
>>> +//! hrtimer::{
>>> +//! RelativeMode, HrTimer, HrTimerCallback, HrTimerPointer,
>>> +//! HrTimerRestart, HrTimerCallbackContext
>>> +//! },
>>> +//! Delta, Monotonic,
>>> +//! },
>>> +//! };
>>
>> This uses a mixture of the vertical style and the horizontal one -- I
>> guess you did it to save on lines, but it looks strange now that we
>> have a style for imports.
>
> It uses random line breaks to make check_patch.pl not yell at me. I
> guess I could copy them somewhere else, do the formatting and copy them
> back. Not really a workflow I care for though.

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.


Best regards,
Andreas Hindborg