From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796167929; b=3ocZTtiaZq8PjZHkjOxUCEBJRA9QP18IHppmSpi7gz9PYeVy06wnSiKwnq/Uag1vtJji agnJLDiGohVZaU/eBv7quVKrBDm2PjBx5EG2bOT6DicTM8w3HWDGMnAzAwFmBIQXb4rF1 AFkVqEOPoIKoxp96TWYo/W6FCSITs0vjVVul2LRVhNy4r6+5BHIYDsnny374/sTSs+0GG cKfRtEIq5hARkhu3F60e8jkXbY4NJ61dIsvIVK7NyaxVAN46mxPedpeo8gRPCf66lnM+e nNL5mOtt7WYCq7Y4OP4Kj82BerLpChQLVfs/MBfswr7gKkgbfz6J5CxQla960UoX+CA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796167929; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=vLp6jJuLfg8SdmXDfPAhTPX5VSgo/1XMDQH2Lx2fWyw=; b=vSdym/Ywh/0Dbsf7R2dqAEoYIG3c5BzZcZB7QODbe15ys183BD03Ockc/IdBNRkGE9Qg H2H38dna+ALJpg/phnDbAnkZcFWTr6ZfXBrc0+WO0c13T1qIdTdm/xOwRU2NzANSBeBQi b4vu/mad89qxLpdKiILHG/QZ72IoYctWuvQWLmKaP9HDMAhGal/oy/z8NCNX1mNZTANUz UGLqqS0MyHgocnD1WXx+hQX53mgUfxEKdjRt6PVaPxmBk201X5QQnAmmGrYYSgribfBhh kClg2TUTO+9sQUs0IZuq5TYPU8ZnGStjmLXkz7ENzeMi/eRKSeC6mf01JIYZO7+xSCg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=JQOGADfC; arc=none smtp.remote-ip=209.85.221.47 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 686C4606A322 for ; Tue, 1 Dec 2026 23:32:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 686C4606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=JQOGADfC Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-4c84abcb549so1752265f8f.1 for ; Tue, 01 Dec 2026 15:32:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796167927; x=1796772727; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=vLp6jJuLfg8SdmXDfPAhTPX5VSgo/1XMDQH2Lx2fWyw=; b=JQOGADfCtnDBxMai4CC3OGKiyDsOYNKkwJgmih+l3E1AExSoS0GyALHoOIfZWvccgM 0Lpy8p3rhWdT3Z9BOJ0T7jIVVESs+61gyWL24aZJWR1MSBNLfTlwXp/zKWCAvNx0OYEe uCquEMvzsLW/kMtoW8ViN36faQWJSYzxfKEGo7i52Uzy56fUDA+00zp02xeYFFrfvOsG tPoTJNG/Vy3FMkck6xtRel4e9VBokTLs8TNnatpP+OosgxCFCyBtVNLeljMnweVQL6bg EHg3QZEfdhWfwxVbwEk18s7MBg+w/AH5pXzPCt6MaAIarrEW5QXe/ecfNsc2xU/r4IAV C+gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796167927; x=1796772727; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=vLp6jJuLfg8SdmXDfPAhTPX5VSgo/1XMDQH2Lx2fWyw=; b=AGbLhrDW+ckDvqHVPmGEOUAt9p0BnVXS1El00I3db00grNHqwmCCVLFQ9OYpqv4r9A 6f3SUrJG07GN5Ok4KdKJu0ROYndsCSDN0C5v1xX3hdq6S06+cZnBYSYeR6VeECe15frv OsoX/1NiZMtWqeU/kQsu7lpLvN+XTs9dvuU76dR70s2uXNV7+RR4us4F2GrMGarAsRQP rtrG3LWec5Q/WrvtS0nKtymLL/PrJqUEsSjqnHzfiG17A2UbcR2SSvWwlfb9EpfHkXpj 3ZxOgVZFuFbppMhZKeH465JbcBIYNCrNiCGcuxy1EIt12RCw9MypDHZBOnYNogT93E5X 2Rjg== X-Forwarded-Encrypted: i=1; AL+hErHIxMLwXkKQXB4dsmEFHfIBGr1Mc1vlNjRJpZthNd1m3AJVh8+M+DZkkSvQYNPvQ791NG8059gBBKl742M=@vger.kernel.org X-Gm-Message-State: APuU4Z+b1LMlDtntvoUdpTx2/Z4X1ddy47jI3z0ITIwIm6DXbOq7CxaB Zzu2UASF9CH381xZiL0esxIHw703TBQH0/ciVfBr33jSZnOWEgkIergL X-Gm-Gg: AZFdTZdTiynJQOOT92me48oDPIP/10rfIqd6yvQqWViZI3+YPyoMGpBB09sa2KPRtiD aEDY+CMs6+QNV1/1C7tF1NqGQcqsAbw+nWSDVbyf9syTeUbiUzWVlDZ7wwLPCrz1EiHsN7DiSeQ E+gGCrvWH95Z+BjK3jUNE0e59uyo3/A3eNknmaHbf/LJ1nZ6oQWid31U0kPauJ+3LUZSAV7gtA+ jEV7hDEjj36wOudz5c3E2qg7pfltqR6er6rYyOLJdmz+Kr4Hq4kD4XGPoRhwSuhGm/VApP3DssR gzHi1roVurSdXny3svi9X2ZP3xjXy6XmtMqBWdrhKM4/moDGb2D7/yD1Q7HNRu2b/O8Ihu0Sy6U ztWeBEvpnhP6cJ77fIgBLxuovcoB8PP8PWyt5pTMH8K+UV23TaakXNUfH3mlq1Xgpph597n1xxk 85A1EDG63z8ltZZ3hzQaZx59uS4EcIPtjExB/8yQp1XGO/bsrJVUjkca+s4JK0DsG+AuoQyVDNq qM9VDsnrXodofiPw4PUjiMHdNvvsE+TH8wskJnakdVcraf1prOejUAlY5NbS1EAwGEPQUfmF/Sn ruJU4xkIrk7ibofUOzsIHZBDcMI= X-Received: by 2002:a05:600c:5308:b0:4bb:76d6:1f5d with SMTP id 5b1f17b1804b1-4bb887ca192mr761375765e9.2.1796167926534; Tue, 01 Dec 2026 15:32:06 -0800 (PST) Received: from [127.0.1.1] ([85.105.252.11]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6a680483sm73983323f8f.28.2026.12.01.15.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 15:32:05 -0800 (PST) From: Bartu Alev Date: Wed, 02 Dec 2026 02:31:44 +0300 Subject: [PATCH 3/3] platform/asus: asus-wmi: Document asus_wmi_evaluate_method_buf() 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-asus-wmi-eval-buf-v1-3-640c12d437dc@gmail.com> References: <20261202-asus-wmi-eval-buf-v1-0-640c12d437dc@gmail.com> In-Reply-To: <20261202-asus-wmi-eval-buf-v1-0-640c12d437dc@gmail.com> To: Corentin Chary , "Luke D. Jones" , Denis Benato , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Bartu Alev X-Mailer: b4 0.15.2 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. + * + * 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) -- 2.56.1