From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Armin Wolf <W_Armin@gmx.de>
Cc: Hans de Goede <hdegoede@redhat.com>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] platform/x86: wmi: Remove unused variable in address space handler
Date: Mon, 18 Dec 2023 14:05:30 +0200 (EET) [thread overview]
Message-ID: <b0c2cabb-873d-8858-5175-9d60dddca639@linux.intel.com> (raw)
In-Reply-To: <20231216015601.395118-2-W_Armin@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]
On Sat, 16 Dec 2023, Armin Wolf wrote:
> The variable "i" is always zero and only used in shift operations.
> Remove it to make the code more readable.
>
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
> ---
> drivers/platform/x86/wmi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index 7303702290e5..906d3a2831ae 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -1144,7 +1144,7 @@ acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
> u32 bits, u64 *value,
> void *handler_context, void *region_context)
> {
> - int result = 0, i = 0;
> + int result = 0;
> u8 temp = 0;
>
> if ((address > 0xFF) || !value)
> @@ -1158,9 +1158,9 @@ acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
>
> if (function == ACPI_READ) {
> result = ec_read(address, &temp);
> - (*value) |= ((u64)temp) << i;
> + *value = temp;
> } else {
> - temp = 0xff & ((*value) >> i);
> + temp = 0xff & *value;
> result = ec_write(address, temp);
> }
Seems to have been like this already when it got introduced...
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
next prev parent reply other threads:[~2023-12-18 12:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-16 1:55 [PATCH 0/6] platform/x86: wmi: ACPI improvements Armin Wolf
2023-12-16 1:55 ` [PATCH 1/6] platform/x86: wmi: Remove unused variable in address space handler Armin Wolf
2023-12-18 12:05 ` Ilpo Järvinen [this message]
2023-12-16 1:55 ` [PATCH 2/6] platform/x86: wmi: Remove ACPI handlers after WMI devices Armin Wolf
2023-12-16 1:55 ` [PATCH 3/6] platform/x86: wmi: Use devres for resource handling Armin Wolf
2023-12-18 14:15 ` Hans de Goede
2023-12-16 1:55 ` [PATCH 4/6] platform/x86: wmi: Create WMI bus device first Armin Wolf
2023-12-16 1:56 ` [PATCH 5/6] platform/x86: wmi: Decouple ACPI notify handler from wmi_block_list Armin Wolf
2023-12-16 1:56 ` [PATCH 6/6] platform/x86: wmi: Simplify get_subobj_info() Armin Wolf
2023-12-18 14:31 ` [PATCH 0/6] platform/x86: wmi: ACPI improvements Hans de Goede
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=b0c2cabb-873d-8858-5175-9d60dddca639@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=W_Armin@gmx.de \
--cc=hdegoede@redhat.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