Page MenuHomeFreeBSD

New function in acpi subsystem: acpi_HasMethod()
Needs ReviewPublic

Authored by georg.lindenberg_web.de on Aug 9 2020, 3:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 2 2024, 5:56 AM
Unknown Object (File)
Jan 1 2024, 5:16 AM
Unknown Object (File)
Dec 25 2023, 12:09 AM
Unknown Object (File)
Dec 23 2023, 2:45 AM
Unknown Object (File)
Sep 26 2023, 12:41 AM
Unknown Object (File)
Aug 13 2023, 4:56 PM
Unknown Object (File)
Jun 29 2023, 3:22 PM
Unknown Object (File)
Jun 27 2023, 11:43 AM

Details

Reviewers
mav
jkim
Summary

acpi_HasMethod() checks if an acpi method exists within a given handle.
This function can be useful e.g. if we don't need a handle to the method.
E.g. one might want to check whether a hardware vendor has implemented
an optional acpi method or not.

It's a bit simpler and easier to read than acpi_GetHandleInScope().

There is a similar function in linux, acpi_has_method().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32887
Build 30289: arc lint + arc unit

Event Timeline

If you need it to simplify porting from Linux, then I have no objections. Otherwise it looks too trivial to me.

In D26013#577422, @mav wrote:

If you need it to simplify porting from Linux, then I have no objections. Otherwise it looks too trivial to me.

I agree with @mav. It is too trivial.

Thanks for reviewing.

I am fine with either outcome.
So in Linux acpi_has_method() is referenced in 26 files (https://elixir.bootlin.com/linux/v4.3/ident/acpi_has_method). Their equivalent of acpi_GetHandleInScope (acpi_get_handle) is referenced in 53 files. So there are some use-cases.

Another option would be to allow a NULL pointer in acpi_GetHandleInScope(), when we don't need a handle, really. But this might break existing code.

I leave it up to you. :-)