sst-linux/drivers/acpi
Dan Carpenter 2c3766fac9 ACPI: PRM: Clean up guid type in struct prm_handler_info
commit 3d1c651272cf1df8aac7d9b6d92d836d27bed50f upstream.

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 <lkft@linaro.org>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/3777d71b-9e19-45f4-be4e-17bf4fa7a834@stanley.mountain
[ rjw: Subject edit ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-01 01:56:07 +01:00
..
acpica ACPICA: iasl: handle empty connection_node 2024-10-17 15:21:39 +02:00
apei ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events 2024-02-05 20:12:47 +00:00
arm64
dptf
nfit
numa x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() 2024-06-12 11:03:17 +02:00
pmic ACPI: PMIC: Remove unneeded check in tps68470_pmic_opregion_probe() 2024-10-17 15:20:36 +02:00
x86 ACPI: x86: Force StorageD3Enable on more products 2024-07-05 09:31:43 +02:00
ac.c
acpi_adxl.c
acpi_amba.c
acpi_apd.c
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c ACPI: extlog: fix NULL pointer dereference check 2024-02-05 20:12:47 +00:00
acpi_fpdt.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c ACPI: LPIT: Avoid u32 multiplication overflow 2024-01-25 15:27:19 -08:00
acpi_lpss.c ACPI: LPSS: Advertise number of chip selects via property 2024-06-12 11:03:10 +02:00
acpi_memhotplug.c
acpi_pad.c ACPI: PAD: fix crash in exit_round_robin() 2024-10-17 15:21:36 +02:00
acpi_pcc.c
acpi_platform.c
acpi_pnp.c
acpi_processor.c ACPI: processor: Fix memory leaks in error paths of processor_add() 2024-09-12 11:10:28 +02:00
acpi_tad.c
acpi_video.c ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop 2024-02-05 20:12:47 +00:00
acpi_watchdog.c
battery.c ACPI: battery: Fix possible crash when unregistering a battery hook 2024-10-17 15:22:08 +02:00
bgrt.c
blacklist.c
bus.c
button.c ACPI: button: Add DMI quirk for Samsung Galaxy Book2 to fix initial lid detection issue 2024-11-01 01:56:06 +01:00
container.c
cppc_acpi.c cpufreq: CPPC: fix perf_to_khz/khz_to_perf conversion exception 2024-11-01 01:56:05 +01:00
custom_method.c
debugfs.c
device_pm.c
device_sysfs.c ACPI: sysfs: validate return type of _STR method 2024-10-17 15:21:21 +02:00
dock.c
ec_sys.c
ec.c ACPI: EC: Do not release locks during operation region accesses 2024-10-17 15:21:37 +02:00
event.c
evged.c
fan_attr.c
fan_core.c
fan.h
glue.c
hed.c
internal.h
ioapic.c
irq.c
Kconfig
Makefile
nvs.c
osi.c
osl.c
pci_irq.c
pci_link.c
pci_mcfg.c
pci_root.c
pci_slot.c
pfr_telemetry.c
pfr_update.c
platform_profile.c
power.c
pptt.c
prmt.c ACPI: PRM: Clean up guid type in struct prm_handler_info 2024-11-01 01:56:07 +01:00
proc.c
processor_core.c
processor_driver.c
processor_idle.c ACPI: processor_idle: Fix invalid comparison with insertion sort for latency 2024-07-18 13:18:41 +02:00
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c
property.c acpi: property: Let args be NULL in __acpi_node_get_property_reference 2024-01-25 15:27:46 -08:00
reboot.c
resource.c ACPI: resource: Add LG 16T90SP to irq1_level_low_skip_override[] 2024-11-01 01:56:06 +01:00
sbs.c ACPI: SBS: manage alarm sysfs attribute through psy core 2024-08-14 13:52:45 +02:00
sbshc.c
sbshc.h
scan.c ACPI: scan: Fix device check notification handling 2024-03-26 18:20:38 -04:00
sleep.c Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default" 2024-04-13 13:05:11 +02:00
sleep.h
spcr.c
sysfs.c
tables.c
thermal.c
tiny-power-button.c
utils.c
video_detect.c ACPI: video: Add force_vendor quirk for Panasonic Toughbook CF-18 2024-10-17 15:21:37 +02:00
viot.c
wakeup.c