Skip to content

Commit 3522f86

Browse files
geerturafaeljw
authored andcommitted
ACPI: EC: Fix debugfs_create_*() usage
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: 1195a09 (ACPI: Provide /sys/kernel/debug/ec/...) Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 30a7acd commit 3522f86

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/acpi/ec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ static int acpi_ec_setup(struct acpi_ec *ec, bool handle_events)
15161516
}
15171517

15181518
acpi_handle_info(ec->handle,
1519-
"GPE=0x%lx, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n",
1519+
"GPE=0x%x, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n",
15201520
ec->gpe, ec->command_addr, ec->data_addr);
15211521
return ret;
15221522
}

drivers/acpi/ec_sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
128128
return -ENOMEM;
129129
}
130130

131-
if (!debugfs_create_x32("gpe", 0444, dev_dir, (u32 *)&first_ec->gpe))
131+
if (!debugfs_create_x32("gpe", 0444, dev_dir, &first_ec->gpe))
132132
goto error;
133133
if (!debugfs_create_bool("use_global_lock", 0444, dev_dir,
134134
&first_ec->global_lock))

drivers/acpi/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static inline void acpi_early_processor_osc(void) {}
159159
-------------------------------------------------------------------------- */
160160
struct acpi_ec {
161161
acpi_handle handle;
162-
unsigned long gpe;
162+
u32 gpe;
163163
unsigned long command_addr;
164164
unsigned long data_addr;
165165
bool global_lock;

0 commit comments

Comments
 (0)