diff options
| author | Dan Carpenter <[email protected]> | 2024-10-24 08:07:15 +0000 |
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2024-10-24 15:31:41 +0000 |
| commit | 3d1c651272cf1df8aac7d9b6d92d836d27bed50f (patch) | |
| tree | a891c5a563ae868f93cb1f76b90c29640966c4c6 /rust/helpers/bug.c | |
| parent | ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context (diff) | |
| download | kernel-3d1c651272cf1df8aac7d9b6d92d836d27bed50f.tar.gz kernel-3d1c651272cf1df8aac7d9b6d92d836d27bed50f.zip | |
ACPI: PRM: Clean up guid type in struct prm_handler_info
Clang 19 prints a warning when we pass &th->guid to efi_pa_va_lookup():
drivers/acpi/prmt.c:156:29: error: passing 1-byte aligned argument to
4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an
unaligned pointer access [-Werror,-Walign-mismatch]
156 | (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
| ^
The problem is that efi_pa_va_lookup() takes a efi_guid_t and &th->guid
is a regular guid_t. The difference between the two types is the
alignment. efi_guid_t is a typedef.
typedef guid_t efi_guid_t __aligned(__alignof__(u32));
It's possible that this a bug in Clang 19. Even though the alignment of
&th->guid is not explicitly specified, it will still end up being aligned
at 4 or 8 bytes.
Anyway, as Ard points out, it's cleaner to change guid to efi_guid_t type
and that also makes the warning go away.
Fixes: 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")
Reported-by: Linux Kernel Functional Testing <[email protected]>
Suggested-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Tested-by: Paul E. McKenney <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Link: https://patch.msgid.link/[email protected]
[ rjw: Subject edit ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'rust/helpers/bug.c')
0 files changed, 0 insertions, 0 deletions
