Re: [PATCH RFC v2 4/7] iio: osf: add stream parser

From: Kim Jinseob

Date: Fri May 29 2026 - 08:48:42 EST


>
> On Thu, May 28, 2026 at 10:58:00PM +0100, Jonathan Cameron wrote:
> > Various minor things inline.
>
> Addressed in RFC v3.
>
> I applied the stream parser cleanups in the new series.
>
> > for (size_t i = 0; i < stream->len; i++)
> > match_len = min(stream->len - i, OSF_STREAM_MAGIC_LEN);
>
> Addressed in RFC v3.
>
> > if (get_unaligned_le16(stream->buf + 6) != OSF_FRAME_HEADER_LEN) {
> >
> > is fine. We are a bit flexible on line length when it helps readability.
>
> Addressed in RFC v3 where it improved readability.
>
> > As in previous patch, how do we get here with any of those being possible?
> > The last one might make sense as it's about coupling between parameters, but
> > I'm not seeing the first two as useful unless you clear stream->osf in remove
> > path or similar. If you do maybe a comment.
>
> Addressed in RFC v3. I removed the unnecessary internal-only checks and kept
> the boundary check for the invalid buffer/length relationship.
>
> > No way for first erro to be set, so same as:
> > return osf_stream_process(stream);
> >
> > If this changes later in this patch series then fine to keep it like this.
>
> Addressed in RFC v3.
>
> > copy_len = min(len, space);
>
> Addressed in RFC v3.
>
> I also reviewed the Sashiko feedback for this patch while preparing RFC v3.
> Normal chunked reception is no longer counted as an error-style partial frame
> condition, and the stream/core path was kept consistent with the revised
> validation boundary used in the rest of the series.
>
> Thanks,


>
> Jinseob