Re: [PATCH v1 1/5] ACPI: utils: Introduce acpi_match_video_device_handle() helper

From: Andy Shevchenko
Date: Fri Jul 08 2022 - 17:31:30 EST


On Sat, Jul 09, 2022 at 12:27:09AM +0300, Andy Shevchenko wrote:
> On Tue, Jul 05, 2022 at 08:40:30PM +0200, Rafael J. Wysocki wrote:
> > On Fri, Jul 1, 2022 at 7:47 AM Mika Westerberg
> > <mika.westerberg@xxxxxxxxxxxxxxx> wrote:
> > > On Fri, Jul 01, 2022 at 12:28:15AM +0300, Andy Shevchenko wrote:

...

> > > > extern long acpi_is_video_device(acpi_handle handle);
> > > > +extern bool acpi_match_video_device_handle(acpi_handle handle);

> > > I think we can do slightly better here. The only caller of
> > > acpi_is_video_device() is in drivers/acpi/video_detect.c so we can move
> > > it there and make it static (is_video_device()).
>
> AFAICS, the scan.c is user of it as well.
>
> > > Then we can name this one acpi_is_video_device() instead and in addition
> > > make it take struct acpi_device as parameter instead of acpi_handle (I
> > > think we should not use acpi_handles in drivers if possible).
> >
> > Agreed.
>
> Not sure it will help to have acpi device since most of the callers asks for
> handle to be checked.

Actually it's 2:2 now. I'm fine with ACPI device and name like

acpi_dev_is_video_device()

> Taking into account above, what we can do is to rename it to
>
> acpi_handle_is_video_device()
>
> which should be clearer than initial proposal.
>
> Thoughts?

--
With Best Regards,
Andy Shevchenko