diff mbox series

[v2,6/9] ACPI: HMAT: use hotplug_memory_notifier() directly

Message ID 20220920025123.2868953-7-liushixin2@huawei.com (mailing list archive)
State New
Headers show
Series mm: Use hotplug_memory_notifier() instead of register_hotmemory_notifier() | expand

Commit Message

Liu Shixin Sept. 20, 2022, 2:51 a.m. UTC
Since patch 316346243be6 has already updated the minimum gcc version to 5.1.
The previous problem mentioned in patch f02c69680088 is not existed. So we
can now revert to use hotplug_memory_notifier() directly rather than
register_hotmemory_notifier().

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/acpi/numa/hmat.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

David Hildenbrand Sept. 20, 2022, 12:04 p.m. UTC | #1
On 20.09.22 04:51, Liu Shixin wrote:
> Since patch 316346243be6 has already updated the minimum gcc version to 5.1.
> The previous problem mentioned in patch f02c69680088 is not existed. So we
> can now revert to use hotplug_memory_notifier() directly rather than
> register_hotmemory_notifier().
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
index c3d783aca196..84dffb3dc30e 100644
--- a/drivers/acpi/numa/hmat.c
+++ b/drivers/acpi/numa/hmat.c
@@ -768,11 +768,6 @@  static int hmat_callback(struct notifier_block *self,
 	return NOTIFY_OK;
 }
 
-static struct notifier_block hmat_callback_nb = {
-	.notifier_call = hmat_callback,
-	.priority = 2,
-};
-
 static __init void hmat_free_structures(void)
 {
 	struct memory_target *target, *tnext;
@@ -855,7 +850,7 @@  static __init int hmat_init(void)
 	hmat_register_targets();
 
 	/* Keep the table and structures if the notifier may use them */
-	if (!register_hotmemory_notifier(&hmat_callback_nb))
+	if (!hotplug_memory_notifier(hmat_callback, 2))
 		return 0;
 out_put:
 	hmat_free_structures();