Re: [PATCH 3/3] platform/asus: asus-wmi: Document asus_wmi_evaluate_method_buf()

From: Bartu Alev

Date: Wed Dec 02 2026 - 10:16:41 EST




On 12/2/26 5:50 AM, Denis Benato wrote:
> This is confusing to me, can you make it shorter?
>
> "Anything other than a buffer is reported as an error"... anything what?
> The answer?
>
> The sentence "The firmware answers with an integer instead" doesn't
> make sense to me, probably because it's too convoluted and mixing
> implementation details, ACPI asus methods and function inner working.
yes, that wording was overly convoluted and leaked internal details.
would a shorter version like this work for v2?

/**
* asus_wmi_evaluate_method_buf() - Evaluate a WMI method returning a buffer
* @method_id: WMI method ID to evaluate (e.g. %ASUS_WMI_METHODID_DSTS)
* @arg0: First method argument, usually the device ID
* @arg1: Second method argument
* @ret_buffer: Caller buffer to copy the returned ACPI buffer into
* @size: Size of @ret_buffer in bytes
*
* Evaluate @method_id and copy the returned ACPI buffer into @ret_buffer.
* If the reply is shorter than @size, only the returned bytes are copied
* and the remainder of @ret_buffer is left untouched.
*
* Non-buffer ACPI replies are treated as errors:
%ASUS_WMI_UNSUPPORTED_METHOD
* (0xfffffffe) and 0xffffffff map to -ENODEV, while any other integer
* (such as 0 when an argument is omitted) or unexpected object type maps
* to -ENODATA.
*
* Return:
* * %0 - Success, buffer copied into @ret_buffer.
* * %-EIO - WMI method evaluation failed.
* * %-ENODEV - Firmware reported the device or method as unsupported.
* * %-ENOSPC - Returned buffer is larger than @size.
* * %-ENODATA - No object returned, empty buffer, or unexpected reply.
*/