lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/5] HID: core: Export some report item parsing functions.
On Mon, Mar 1, 2021 at 3:18 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Sun, Feb 28, 2021 at 3:30 AM Ronald Tschalär <ronald@innovation.ch> wrote:
> >
> > These are useful to drivers that need to scan or parse reports
> > themselves.
>
> ...
>
> > - while ((start = fetch_item(start, end, &item)) != NULL)
> > + while ((start = hid_fetch_item(start, end, &item)) != NULL)
> > dispatch_type[item.type](parser, &item);
>
> > - while ((next = fetch_item(start, end, &item)) != NULL) {
> > + while ((next = hid_fetch_item(start, end, &item)) != NULL) {
> > start = next;
>
> I don't see the full picture, but perhaps you may also introduce
> for_each_hid_item() or so.

Same here, I don't see the full picture, but I would suggest to not
export those functions at all.

From 4/5, I can see that you are using them in
appleib_find_collection(), which is only called by
appleib_add_device(), which in turn is always called with a parsed and
started HID device. Why can you not rely on the core parsing and
iterate over the already parsed hid_field?

Cheers,
Benjamin

\
 
 \ /
  Last update: 2021-03-01 15:30    [W:0.069 / U:2.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site