Re: [PATCH v5 06/12] seq_buf: Add seq_buf_strlen()
From: Alejandro Colomar
Date: Fri Oct 23 2026 - 05:37:19 EST
Hi Steven,
> Date: 2026-10-22 20:37:13-0400
> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
[...]
> > struct seq_buf {
> > char *buffer;
> > size_t size;
> > size_t len;
> > };
> >
> > struct alx_seq_buf {
> > char *buffer;
> > char *p;
> > char *end;
> > };
>
> OK, I was thinking you were adding another pointer.
>
> >
> > int
> > main(void)
> > {
> > printf("%zu\n", sizeof(struct seq_buf));
> > printf("%zu\n", sizeof(struct alx_seq_buf));
> > }
> > alx@debian:~/tmp$ gcc -Wall -Wextra seq_buf_size_comparison.c
> > alx@debian:~/tmp$ ./a.out
> > 24
> > 24
> >
> > size_t and pointers should always have the same size, so this doesn't
> > change the size.
> >
> > Am I missing something?
> >
> >
> > Cheers,
> > Alex
> >
> > > Yes the seq_buf code can be complex, but it's in one location where it can
> > > be highly tested and verified. The point of seq_buf is to do the complexity
> > > so that other places in the kernel doesn't need to.
>
> We could look into updating it to pointers later, but right now I
> rather keep what we have. Let's focus first on the new stuff. It's not
> that hard to validate.
I agree to doing that later. But I want to do that later. :-)
Have a lovely day!
Alex
>
> -- Steve
--
<https://www.alejandro-colomar.es>
Attachment:
signature.asc
Description: PGP signature