[PATCH v5 04/14] gpu: nova-core: Add a slice-buffer (sbuffer) datastructure

Miguel Ojeda
2025-10-16T19:19:06Z

On Thu, Oct 16, 2025 at 8:23?AM Alexandre Courbot <acourbot at nvidia.com>
wrote:
>
> On Mon Oct 13, 2025 at 3:20 PM JST, Alistair Popple wrote:
> >
> > +/// # Example:
> > +///
> > +/// ```
> > +/// let mut buf1 = [0u8; 5];
> > +/// let mut buf2 = [0u8; 5];
> > +/// let mut sbuffer = SBufferIter::new_writer([&buf1,
&buf2]);
> > +///
> > +/// let data = b"hello";
> > +/// let result = sbuffer.write_all(data);
> > +/// ```
>
> This example doesn't build - there are several things wrong with it. It
> is also missing statements to confirm and show the expected result. Here
> is a fixed and slightly improved version:

Yeah, I mentioned this one in a previous version -- the section header
is also still wrong too.

Alistair, please check the link I gave:

    https://docs.kernel.org/rust/coding-guidelines.html#code-documentation

or other code in the `kernel` crate for examples on how it is usually done.

It is not critical today, of course, but the further it is from what
will be needed in a few months, the harder it will become to start
building the docs and running the examples as KUnit tests.

Thanks!

Cheers,
Miguel