]> git.ipfire.org Git - thirdparty/linux.git/commit
ACPI: APEI: GHES: Extract helper functions for error status handling
authorShuai Xue <xueshuai@linux.alibaba.com>
Mon, 12 Jan 2026 03:22:38 +0000 (11:22 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Jan 2026 16:05:05 +0000 (17:05 +0100)
commitfeb2d38013ddfc8ea4b53134d194582dc1e4de2c
tree536ba847de8c9ce336cc9360c83467417b478b35
parentf2edc1fb9c81b7b57a092204455e4d159a10873e
ACPI: APEI: GHES: Extract helper functions for error status handling

Refactors the GHES driver by extracting common functionality into
reusable helper functions:

1. ghes_has_active_errors() - Checks if any error sources in a given list
   have active errors
2. ghes_map_error_status() - Maps error status address to virtual address
3. ghes_unmap_error_status() - Unmaps error status virtual address
4. Use `guard(rcu)()` instead of explicit `rcu_read_lock()`/`rcu_read_unlock()`.

These helpers eliminate code duplication in the NMI path and prepare for
similar usage in the SEA path in a subsequent patch.

No functional change intended.

Tested-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://patch.msgid.link/20260112032239.30023-3-xueshuai@linux.alibaba.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/ghes.c