From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.89 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796179864; b=NstuHOgLoxjOUH7Y4GR5NGDTvOeYjPvXPx9StaFbdKWyz/3TYNeL/elnJJW/ErQM4qMV XfjNdZIwCzzMO1UDsR8XFp0lQHxkSeCryQW9RgTIiIDp05Dgom+VX2tC+9X38fTboSsnu MrsDXqxqDvec+Bh/1hwvs1xwEJy0J+S1vcvAaM5PFtlfcj64t8Ev8/JaHP4Njxq0JTk7d a3w7kbGz2/lq3UUPCFSg+TXVSHvK82hvb1sXcqgBA3VVT4neA/ei7SIJCvKY4fv6krJBM TVPnxwJJrlH7j4yM3CyODT3oTtVuudI6000Q0qb/PhnG6+pGc/s999uvwVUrDQecOaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796179864; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=6zeZNgx5apVAxFkK3AQ8znqH/KOcK/upgd0ErD1WAdA=; b=MYF609ha0iE27GKy5U3QJkB52eDlNHim7CAXvkCiMBjgbgyk7HefgDre7dRapBGXGTf1 tEYzjVY77CgO/FplPxtX1lAu77UfpWDcEOR+nRFKe06nCq0jxC7G0sNUP6QYm/phowvuK lJH4Z4H0qEVTb5Uj8XtgHJ2D3U6FY8O10Mfm5UBc85FWvm/UOK6N6xJZ4ZQCnmC2iPAHi Gnjb+HFWSIlRQsENgGBNhYqE4YDJNz+K45Or8bLaaRJhGAduIo5u6Dz39hNzcD9Je96sj +gkDz0hnZ5FKVDO3mRCIZ2gI0ByU5SjW4hCNqDMwYvK68Q/v+x5OGt5TCBD5RQWWfFw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=WoLqA96U; arc=none smtp.remote-ip=95.215.58.89 Received: from mta1.migadu.com (out-89.mta1.migadu.com [95.215.58.89]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFEBA606A322 for ; Wed, 2 Dec 2026 02:51:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AFEBA606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=WoLqA96U X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=/XIT5VbC81V0fmPenEGSFINVLjO6PFoAtzGbaKFZVhU=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796179860; v=1; x=1796784660; b=WoLqA96UJydnE9/78i2Vvn9Pj0VqbJBhidFHLQrP6dHYzPxwF22ibcMQ/B2/hzPYHZO5YTwR knxn6Uf7X99WJw4Kaz31Lks044zgJHfzlfwwE1GkHfm2bg27GY6YXozuu7tvt/6Sa70/ojipgGL 3tmFx8TYSo4aL9eIkQW3epJk= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 2ee15cb1ff82137c; Wed, 02 Dec 2026 02:51:00 +0000 X-Mizu-Trace-ID: 2ee15cb1ff82137c X-Migadu-Flow: FLOW_OUT Message-ID: <177a8ebd-aabb-4178-8a7d-d8827a983e8f@linux.dev> Date: Wed, 2 Dec 2026 03:50:59 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] platform/asus: asus-wmi: Document asus_wmi_evaluate_method_buf() To: Bartu Alev , Corentin Chary , "Luke D. Jones" , Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261202-asus-wmi-eval-buf-v1-0-640c12d437dc@gmail.com> <20261202-asus-wmi-eval-buf-v1-3-640c12d437dc@gmail.com> Content-Language: en-US From: Denis Benato In-Reply-To: <20261202-asus-wmi-eval-buf-v1-3-640c12d437dc@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/2/26 00:31, Bartu Alev wrote: > Add kernel-doc for the helper: its parameters, the fact that only > obj->buffer.length bytes are copied and the tail of ret_buffer is left > untouched on short replies, and the meaning of every error return, i.e. > -EIO when the evaluation fails, -ENODEV for the 0xfffffffe and 0xffffffff > sentinels, -ENOSPC when the reply does not fit and -ENODATA for any other > integer, a missing object or an unexpected type. The return values are > listed as a ReST list as Documentation/doc-guide/kernel-doc.rst asks. > > Suggested-by: Denis Benato > Signed-off-by: Bartu Alev > --- > drivers/platform/asus/asus-wmi.c | 29 ++++++++++++++++++++++++++--- > 1 file changed, 26 insertions(+), 3 deletions(-) > > diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c > index 015e207e840e6..4627ef0cad0c4 100644 > --- a/drivers/platform/asus/asus-wmi.c > +++ b/drivers/platform/asus/asus-wmi.c > @@ -462,9 +462,32 @@ static int asus_wmi_evaluate_method5(u32 method_id, > return 0; > } > > -/* > - * Returns as an error if the method output is not a buffer. Typically this > - * means that the method called is unsupported. > +/** > + * asus_wmi_evaluate_method_buf() - Evaluate a WMI method returning a buffer > + * @method_id: WMI method ID to evaluate, such as ASUS_WMI_METHODID_DSTS > + * @arg0: First method argument, usually the device ID > + * @arg1: Second method argument > + * @ret_buffer: Buffer to copy the reply into > + * @size: Size of @ret_buffer > + * > + * Evaluate the method and copy the reply into @ret_buffer. The reply must > + * be a non-empty ACPI buffer; only obj->buffer.length bytes are copied and > + * the rest of @ret_buffer is left untouched, so callers that need the > + * whole buffer must initialise it themselves. Anything other than a > + * buffer is reported as an error. The firmware answers with an integer > + * instead, %ASUS_WMI_UNSUPPORTED_METHOD (0xfffffffe) when it does not > + * implement the device or method. That value and 0xffffffff, which > + * asus_wmi_get_devstate() treats the same way, are reported as -ENODEV. > + * No object at all, an empty buffer, an unexpected object type and any > + * other integer, including the 0 some methods return when called without > + * an argument, are reported as -ENODATA. > + * 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. > + * Return: > + * * %0 - reply copied into @ret_buffer > + * * %-EIO - the WMI evaluation failed > + * * %-ENODEV - the firmware does not implement the device or method > + * * %-ENOSPC - the reply does not fit into @ret_buffer > + * * %-ENODATA - no object, an empty buffer, an unexpected type or another integer > */ > static int asus_wmi_evaluate_method_buf(u32 method_id, > u32 arg0, u32 arg1, u8 *ret_buffer, size_t size) >