Skip to contentSkip to conversation

ACPI: APEI: mark some functions __init

PATCH In review Miaohe Lin 2 participants 3 messages Jun 17, 2023 – Jun 20, 2023

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 ACPI: APEI: mark some functions __init

hest_esrc_len() and apei_hest_parse() are only called inside __init section. So mark them __init too.

---
 drivers/acpi/apei/hest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/apei/hest.c +2 -2
index 6aef1ee5e1bd..2d78e808ab8b 100644
@@ -55,7 +55,7 @@ static inline bool is_generic_error(struct acpi_hest_header *hest_hdr)
 	       hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR_V2;
 }
 
-static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
+static int __init hest_esrc_len(struct acpi_hest_header *hest_hdr)
 {
 	u16 hest_type = hest_hdr->type;
 	int len;
@@ -88,7 +88,7 @@ static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
 
 typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data);
 
-static int apei_hest_parse(apei_hest_func_t func, void *data)
+static int __init apei_hest_parse(apei_hest_func_t func, void *data)
 {
 	struct acpi_hest_header *hest_hdr;
 	int i, rc, len;
Signature · 1 line
2.27.0
reviewer
#1 lore raw
Quoted 2 lines · Miaohe Lin

hest_esrc_len() and apei_hest_parse() are only called inside __init section. So mark them __init too.

Hi, Miaohe,

should ghes_estatus_pool_init also be marked with __init?

Thanks.

Best Regards,
Shuai

Quoted 28 lines
---
 drivers/acpi/apei/hest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/apei/hest.c +2 -2
index 6aef1ee5e1bd..2d78e808ab8b 100644
@@ -55,7 +55,7 @@ static inline bool is_generic_error(struct acpi_hest_header *hest_hdr)
 	       hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR_V2;
 }
 
-static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
+static int __init hest_esrc_len(struct acpi_hest_header *hest_hdr)
 {
 	u16 hest_type = hest_hdr->type;
 	int len;
@@ -88,7 +88,7 @@ static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
 
 typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data);
 
-static int apei_hest_parse(apei_hest_func_t func, void *data)
+static int __init apei_hest_parse(apei_hest_func_t func, void *data)
 {
 	struct acpi_hest_header *hest_hdr;
 	int i, rc, len;
author
#2 lore raw
Quoted 9 lines · Shuai Xue
Quoted 2 lines · Miaohe Lin

hest_esrc_len() and apei_hest_parse() are only called inside __init section. So mark them __init too.

Hi, Miaohe,

should ghes_estatus_pool_init also be marked with __init?

Yes, I think so. It's only called within __init section too. And it's in fact on my plan in another patch. Thanks for your comment.

Quoted 7 lines

Thanks.

Best Regards,
Shuai