From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Kurt Borja <kuurtb@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
W_Armin@gmx.de, LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v4 2/4] alienware-wmi: alienware_wmax_command() is now input size agnostic
Date: Fri, 11 Oct 2024 14:07:58 +0300 (EEST) [thread overview]
Message-ID: <61bddc97-0fd0-8639-2df2-8b0b48f90695@linux.intel.com> (raw)
In-Reply-To: <20241011064712.306484-2-kuurtb@gmail.com>
On Fri, 11 Oct 2024, Kurt Borja wrote:
As mentioned, please add the description of the change here.
This change also does int * -> u32 *, which I think is fine but please
mention the justification here. If somebody looks this change 10 years
from now, it helps a lot when the reasoning is recorded into the change.
--
i.
> 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..8f7a8bfef 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 insize,
> + 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 = insize;
> 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-11 11:08 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 [this message]
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
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=61bddc97-0fd0-8639-2df2-8b0b48f90695@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=W_Armin@gmx.de \
--cc=hdegoede@redhat.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®