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 perf/smmuv3: Enable HiSilicon Erratum 162001900 quirk for HIP08/09 2023-09-23 11:11:00 +02:00
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: AC: Remove the leftover struct acpi_ac_bl 2022-09-24 18:22:59 +02:00
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: FPDT: properly handle invalid FPDT subtables 2023-11-28 17:07:12 +00:00
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 Merge branches 'acpi-scan', 'acpi-bus' and 'acpi-platform' 2022-09-30 20:28:22 +02:00
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 ACPI: watchdog: Replace open coded variant of resource_union() 2020-11-17 18:06:29 +01:00
battery.c ACPI: battery: Fix possible crash when unregistering a battery hook 2024-10-17 15:22:08 +02:00
bgrt.c
blacklist.c ACPI: blacklist: Unify the message printing 2021-06-07 15:36:45 +02:00
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 ACPI: debugfs: Remove dead ACPICA debug code 2020-09-25 18:25:51 +02:00
device_pm.c PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3() 2023-03-11 13:55:33 +01:00
device_sysfs.c ACPI: sysfs: validate return type of _STR method 2024-10-17 15:21:21 +02:00
dock.c ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() 2021-12-17 18:45:51 +01:00
ec_sys.c ACPI: EC: Mark the ec_sys write_support param as module_param_hw() 2021-12-01 20:19:30 +01:00
ec.c ACPI: EC: Do not release locks during operation region accesses 2024-10-17 15:21:37 +02:00
event.c
evged.c ACPI: GED: fix -Wformat 2020-11-09 19:25:20 +01:00
fan_attr.c
fan_core.c
fan.h ACPI: DPTF: Support Meteor Lake 2022-05-25 15:37:07 +02:00
glue.c ACPI: Fix selecting wrong ACPI fwnode for the iGPU on some Dell laptops 2023-01-18 11:58:11 +01:00
hed.c ACPI: HED: Drop unused ACPI_MODULE_NAME() definition 2021-03-08 16:51:48 +01:00
internal.h ACPI: scan: Eliminate __acpi_device_add() 2022-08-23 18:19:27 +02:00
ioapic.c
irq.c ACPI: irq: Fix incorrect return value in acpi_register_gsi() 2023-10-25 12:03:14 +02:00
Kconfig
Makefile ACPI: processor: Split out thermal initialization from ACPI PSS 2022-06-29 18:51:22 +02:00
nvs.c
osi.c
osl.c
pci_irq.c ACPI: PCI: IRQ: Consolidate printing diagnostic messages 2021-03-08 16:51:08 +01:00
pci_link.c
pci_mcfg.c
pci_root.c
pci_slot.c
pfr_telemetry.c
pfr_update.c
platform_profile.c ACPI: platform-profile: call sysfs_notify() from platform_profile_store() 2021-08-16 18:32:02 +02:00
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 proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
processor_core.c
processor_driver.c ACPI: processor: Split out thermal initialization from ACPI PSS 2022-06-29 18:51:22 +02:00
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 ACPI: processor: perflib: Avoid updating frequency QoS unnecessarily 2023-08-03 10:24:18 +02:00
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 ACPI: reboot: Unify the message printing 2021-06-07 15:36:46 +02:00
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 ACPI: s2idle: Add a new ->check() callback for platform_s2idle_ops 2022-09-09 17:37:40 +02:00
spcr.c
sysfs.c ACPI: sysfs: Fix BERT error region memory mapping 2022-04-13 19:58:14 +02:00
tables.c ACPI: tables: Make LAPIC_ADDR_OVR address readable in message 2022-03-25 18:11:42 +01:00
thermal.c ACPI: thermal: Drop nocrt parameter 2023-09-02 09:16:18 +02:00
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 ACPI: VIOT: Initialize the correct IOMMU fwspec 2023-05-11 23:03:12 +09:00
wakeup.c