Re: [PATCH v3 2/3] ACPI: APEI: GHES: Extract helper functions for error status handling

From: Breno Leitao

Date: Mon Jan 12 2026 - 04:39:59 EST


On Mon, Jan 12, 2026 at 11:22:38AM +0800, Shuai Xue wrote:
> 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@xxxxxxxxx>
> Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
> Signed-off-by: Shuai Xue <xueshuai@xxxxxxxxxxxxxxxxx>

Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>