Re: [PATCH v4 08/13] ACPI: APEI: GHES: remove unused ghes_{,un}register_vendor_record_notifier()

Jonathan Cameron <[email protected]> Mon, 27 Jul 2026 02:57:13 +0100
Newsgroups org.kernel.vger.linux-pwm,org.kernel.vger.linux-acpi,org.kernel.vger.linux-gpio,org.kernel.vger.linux-iio,org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.platform-driver-x86
Message-ID <20260727025713.321f70e5@jic23-huawei>
On Sun, 26 Jul 2026 10:17:34 +0000
Eliav Farber <[email protected]> wrote:

> Remove ghes_register_vendor_record_notifier() and
> ghes_unregister_vendor_record_notifier() along with their
> EXPORT_SYMBOL_GPL()s and ghes.h declarations, since there are no
> remaining in-tree callers =E2=80=94 all users go through
> devm_ghes_register_vendor_record_notifier() instead.
>=20
> Inline the register/unregister calls directly into
> devm_ghes_register_vendor_record_notifier() and its destroy callback.
>=20
> Signed-off-by: Eliav Farber <[email protected]>

+CC Shiju Jose who wrote this code in the first place.

Looks fine to me.

Reviewed-by: Jonathan Cameron <[email protected]>

> ---
> Changes in v4:
> - Split from the devm conversion patch into its own commit
>   (Andy Shevchenko)
>=20
> Changes in v2:
> - New patch: remove unused ghes_register_vendor_record_notifier() and
>   ghes_unregister_vendor_record_notifier() along with their
>   EXPORT_SYMBOL_GPL()s and ghes.h declarations, since there are no
>   in-tree callers (Jonathan Cameron)
>=20
>  drivers/acpi/apei/ghes.c | 16 +++-------------
>  include/acpi/ghes.h      | 16 ----------------
>  2 files changed, 3 insertions(+), 29 deletions(-)
>=20
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index 3236a3ce79d6..4e092f71ca84 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -677,29 +677,19 @@ static void ghes_handle_aer(struct acpi_hest_generi=
c_data *gdata)
> =20
>  static BLOCKING_NOTIFIER_HEAD(vendor_record_notify_list);
> =20
> -int ghes_register_vendor_record_notifier(struct notifier_block *nb)
> +static void ghes_vendor_record_notifier_destroy(void *data)
>  {
> -	return blocking_notifier_chain_register(&vendor_record_notify_list, nb);
> -}
> -EXPORT_SYMBOL_GPL(ghes_register_vendor_record_notifier);
> +	struct notifier_block *nb =3D data;
> =20
> -void ghes_unregister_vendor_record_notifier(struct notifier_block *nb)
> -{
>  	blocking_notifier_chain_unregister(&vendor_record_notify_list, nb);
>  }
> -EXPORT_SYMBOL_GPL(ghes_unregister_vendor_record_notifier);
> -
> -static void ghes_vendor_record_notifier_destroy(void *nb)
> -{
> -	ghes_unregister_vendor_record_notifier(nb);
> -}
> =20
>  int devm_ghes_register_vendor_record_notifier(struct device *dev,
>  					      struct notifier_block *nb)
>  {
>  	int ret;
> =20
> -	ret =3D ghes_register_vendor_record_notifier(nb);
> +	ret =3D blocking_notifier_chain_register(&vendor_record_notify_list, nb=
);
>  	if (ret)
>  		return ret;
> =20
> diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
> index 8d7e5caef3f1..3cd13171c14f 100644
> --- a/include/acpi/ghes.h
> +++ b/include/acpi/ghes.h
> @@ -55,22 +55,6 @@ enum {
>  };
> =20
>  #ifdef CONFIG_ACPI_APEI_GHES
> -/**
> - * ghes_register_vendor_record_notifier - register a notifier for vendor
> - * records that the kernel would otherwise ignore.
> - * @nb: pointer to the notifier_block structure of the event handler.
> - *
> - * return 0 : SUCCESS, non-zero : FAIL
> - */
> -int ghes_register_vendor_record_notifier(struct notifier_block *nb);
> -
> -/**
> - * ghes_unregister_vendor_record_notifier - unregister the previously
> - * registered vendor record notifier.
> - * @nb: pointer to the notifier_block structure of the vendor record han=
dler.
> - */
> -void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
> -
>  /**
>   * devm_ghes_register_vendor_record_notifier - device-managed vendor
>   * record notifier registration.