Commit b7fe4822 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Greg Kroah-Hartman

ACPI: EC: Fix debugfs_create_*() usage


[ Upstream commit 3522f867 ]

acpi_ec.gpe is "unsigned long", hence treating it as "u32" would expose
the wrong half on big-endian 64-bit systems.  Fix this by changing its
type to "u32" and removing the cast, as all other code already uses u32
or sometimes even only u8.

Fixes: 1195a098 (ACPI: Provide /sys/kernel/debug/ec/...)
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c979024a
...@@ -1518,7 +1518,7 @@ static int acpi_ec_setup(struct acpi_ec *ec, bool handle_events) ...@@ -1518,7 +1518,7 @@ static int acpi_ec_setup(struct acpi_ec *ec, bool handle_events)
} }
acpi_handle_info(ec->handle, acpi_handle_info(ec->handle,
"GPE=0x%lx, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n", "GPE=0x%x, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n",
ec->gpe, ec->command_addr, ec->data_addr); ec->gpe, ec->command_addr, ec->data_addr);
return ret; return ret;
} }
......
...@@ -128,7 +128,7 @@ static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count) ...@@ -128,7 +128,7 @@ static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
return -ENOMEM; return -ENOMEM;
} }
if (!debugfs_create_x32("gpe", 0444, dev_dir, (u32 *)&first_ec->gpe)) if (!debugfs_create_x32("gpe", 0444, dev_dir, &first_ec->gpe))
goto error; goto error;
if (!debugfs_create_bool("use_global_lock", 0444, dev_dir, if (!debugfs_create_bool("use_global_lock", 0444, dev_dir,
&first_ec->global_lock)) &first_ec->global_lock))
......
...@@ -158,7 +158,7 @@ static inline void acpi_early_processor_osc(void) {} ...@@ -158,7 +158,7 @@ static inline void acpi_early_processor_osc(void) {}
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
struct acpi_ec { struct acpi_ec {
acpi_handle handle; acpi_handle handle;
unsigned long gpe; u32 gpe;
unsigned long command_addr; unsigned long command_addr;
unsigned long data_addr; unsigned long data_addr;
bool global_lock; bool global_lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment