From: Armin Wolf <W_Armin@gmx.de>
To: Kurt Borja <kuurtb@gmail.com>
Cc: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v5 2/4] alienware-wmi: alienware_wmax_command() is now input size agnostic
Date: Mon, 14 Oct 2024 18:30:21 +0200 [thread overview]
Message-ID: <3fe7c4e0-c24a-4205-a870-0fcc6e76f1af@gmx.de> (raw)
In-Reply-To: <20241012020149.19700-3-kuurtb@gmail.com>
Am 12.10.24 um 04:01 schrieb Kurt Borja:
> alienware_wmax_command() now takes void * and size_t instead of struct
> wmax_basic_args to extend support to new WMAX methods. Also int *out_data
> was changed to u32 *out_data, because new interface specifies u32 as output
> parameter and all previous callers would pass u32 * regardless.
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> drivers/platform/x86/dell/alienware-wmi.c | 29 ++++++++++++-----------
> 1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c
> index 16a3fe9ac..b27f3b64c 100644
> --- a/drivers/platform/x86/dell/alienware-wmi.c
> +++ b/drivers/platform/x86/dell/alienware-wmi.c
> @@ -500,15 +500,15 @@ static void alienware_zone_exit(struct platform_device *dev)
> kfree(zone_attrs);
> }
>
> -static acpi_status alienware_wmax_command(struct wmax_basic_args *in_args,
> - u32 command, int *out_data)
> +static acpi_status alienware_wmax_command(void *in_args, size_t in_size,
> + u32 command, u32 *out_data)
> {
> acpi_status status;
> union acpi_object *obj;
> struct acpi_buffer input;
> struct acpi_buffer output;
>
> - input.length = sizeof(*in_args);
> + input.length = in_size;
> input.pointer = in_args;
> if (out_data) {
> output.length = ACPI_ALLOCATE_BUFFER;
> @@ -541,8 +541,8 @@ static ssize_t show_hdmi_cable(struct device *dev,
> .arg = 0,
> };
> status =
> - alienware_wmax_command(&in_args, WMAX_METHOD_HDMI_CABLE,
> - &out_data);
> + alienware_wmax_command(&in_args, sizeof(in_args),
> + WMAX_METHOD_HDMI_CABLE, &out_data);
> if (ACPI_SUCCESS(status)) {
> if (out_data == 0)
> return sysfs_emit(buf, "[unconnected] connected unknown\n");
> @@ -562,8 +562,8 @@ static ssize_t show_hdmi_source(struct device *dev,
> .arg = 0,
> };
> status =
> - alienware_wmax_command(&in_args, WMAX_METHOD_HDMI_STATUS,
> - &out_data);
> + alienware_wmax_command(&in_args, sizeof(in_args),
> + WMAX_METHOD_HDMI_STATUS, &out_data);
>
> if (ACPI_SUCCESS(status)) {
> if (out_data == 1)
> @@ -589,7 +589,8 @@ static ssize_t toggle_hdmi_source(struct device *dev,
> args.arg = 3;
> pr_debug("alienware-wmi: setting hdmi to %d : %s", args.arg, buf);
>
> - status = alienware_wmax_command(&args, WMAX_METHOD_HDMI_SOURCE, NULL);
> + status = alienware_wmax_command(&args, sizeof(args),
> + WMAX_METHOD_HDMI_SOURCE, NULL);
>
> if (ACPI_FAILURE(status))
> pr_err("alienware-wmi: HDMI toggle failed: results: %u\n",
> @@ -642,8 +643,8 @@ static ssize_t show_amplifier_status(struct device *dev,
> .arg = 0,
> };
> status =
> - alienware_wmax_command(&in_args, WMAX_METHOD_AMPLIFIER_CABLE,
> - &out_data);
> + alienware_wmax_command(&in_args, sizeof(in_args),
> + WMAX_METHOD_AMPLIFIER_CABLE, &out_data);
> if (ACPI_SUCCESS(status)) {
> if (out_data == 0)
> return sysfs_emit(buf, "[unconnected] connected unknown\n");
> @@ -694,8 +695,8 @@ static ssize_t show_deepsleep_status(struct device *dev,
> struct wmax_basic_args in_args = {
> .arg = 0,
> };
> - status = alienware_wmax_command(&in_args, WMAX_METHOD_DEEP_SLEEP_STATUS,
> - &out_data);
> + status = alienware_wmax_command(&in_args, sizeof(in_args),
> + WMAX_METHOD_DEEP_SLEEP_STATUS, &out_data);
> if (ACPI_SUCCESS(status)) {
> if (out_data == 0)
> return sysfs_emit(buf, "[disabled] s5 s5_s4\n");
> @@ -723,8 +724,8 @@ static ssize_t toggle_deepsleep(struct device *dev,
> args.arg = 2;
> pr_debug("alienware-wmi: setting deep sleep to %d : %s", args.arg, buf);
>
> - status = alienware_wmax_command(&args, WMAX_METHOD_DEEP_SLEEP_CONTROL,
> - NULL);
> + status = alienware_wmax_command(&args, sizeof(args),
> + WMAX_METHOD_DEEP_SLEEP_CONTROL, NULL);
>
> if (ACPI_FAILURE(status))
> pr_err("alienware-wmi: deep sleep control failed: results: %u\n",
next prev parent reply other threads:[~2024-10-14 16:30 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 9:33 [PATCH] Dell AWCC platform_profile support Kurt Borja
2024-10-07 12:24 ` Armin Wolf
2024-10-07 17:24 ` Kurt Borja
2024-10-08 4:42 ` [PATCH v2] alienware-wmi: " Kurt Borja
2024-10-08 10:18 ` Ilpo Järvinen
2024-10-08 19:34 ` Kurt Borja
2024-10-08 19:37 ` [PATCH] " Kurt Borja
2024-10-08 20:04 ` Kurt Borja
2024-10-08 19:56 ` [PATCH v3] " Kurt Borja
2024-10-09 8:42 ` Armin Wolf
2024-10-09 14:48 ` Kurt Borja
2024-10-09 15:48 ` Armin Wolf
2024-10-09 8:56 ` Ilpo Järvinen
2024-10-09 15:39 ` Kurt Borja
2024-10-10 3:44 ` kernel test robot
2024-10-10 9:46 ` Ilpo Järvinen
2024-10-10 18:39 ` Kurt Borja
2024-10-15 1:35 ` kernel test robot
2024-10-11 6:40 ` [PATCH 0/4] " Kurt Borja
2024-10-11 6:43 ` [PATCH v4 " Kurt Borja
2024-10-11 6:46 ` [PATCH v4 1/4] alienware-wmi: fixed indentation and clean up Kurt Borja
2024-10-11 11:04 ` Ilpo Järvinen
2024-10-12 1:57 ` Kurt Borja
2024-10-11 6:47 ` [PATCH v4 2/4] alienware-wmi: alienware_wmax_command() is now input size agnostic Kurt Borja
2024-10-11 11:07 ` Ilpo Järvinen
2024-10-11 6:47 ` [PATCH v4 3/4] alienware-wmi: added platform profile support Kurt Borja
2024-10-11 6:48 ` [PATCH v4 4/4] alienware-wmi: WMAX interface documentation Kurt Borja
2024-10-11 11:11 ` Ilpo Järvinen
2024-10-12 1:58 ` [PATCH v5 0/4] Dell AWCC platform_profile support Kurt Borja
2024-10-12 2:01 ` [PATCH v5 1/4] alienware-wmi: fixed indentation and clean up Kurt Borja
2024-10-14 16:26 ` Armin Wolf
2024-10-15 2:12 ` Kurt Borja
2024-10-12 2:01 ` [PATCH v5 2/4] alienware-wmi: alienware_wmax_command() is now input size agnostic Kurt Borja
2024-10-14 16:30 ` Armin Wolf [this message]
2024-10-15 2:14 ` Kurt Borja
2024-10-12 2:02 ` [PATCH v5 3/4] alienware-wmi: added platform profile support Kurt Borja
2024-10-14 16:40 ` Armin Wolf
2024-10-15 2:22 ` Kurt Borja
2024-10-15 8:20 ` Ilpo Järvinen
2024-10-12 2:03 ` [PATCH v5 4/4] alienware-wmi: WMAX interface documentation Kurt Borja
2024-10-14 17:10 ` Armin Wolf
2024-10-15 2:26 ` Kurt Borja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3fe7c4e0-c24a-4205-a870-0fcc6e76f1af@gmx.de \
--to=w_armin@gmx.de \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=kuurtb@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®