Skip to contentSkip to conversation

ACPI: APEI: fix return value of __setup handlers

PATCH Applied Randy Dunlap 3 participants 3 messages Mar 6, 2022 – Mar 8, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: APEI: fix return value of __setup handlers

__setup() handlers should return 1 to indicate that the boot option has been handled. Returning 0 causes a boot option to be listed in the Unknown kernel command line parameters and also added to init's arg list (if no '=' sign) or environment list (if of the form 'a=b').

Unknown kernel command line parameters "erst_disable
bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be passed to user space.

Run /sbin/init as init process
with arguments:
/sbin/init
erst_disable
bert_disable
hest_disable
with environment:

     HOME=/
     TERM=linux
     BOOT_IMAGE=/boot/bzImage-517rc6
Fixes a3e2acc5e37b ("ACPI / APEI: Add Boot Error Record Table (BERT) support")
Fixes a08f82d08053 ("ACPI, APEI, Error Record Serialization Table (ERST) support")
Fixes 9dc966641677 ("ACPI, APEI, HEST table parsing")
Link lore.kernel.org/r/[email protected]
Cc Huang Ying <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
Cc James Morse <[email protected]>
Cc Tony Luck <[email protected]>
Cc Borislav Petkov <[email protected]>
---
 drivers/acpi/apei/bert.c |    2 +-
 drivers/acpi/apei/erst.c |    2 +-
 drivers/acpi/apei/hest.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/apei/bert.c +1 -1
@@ -77,7 +77,7 @@ static int __init setup_bert_disable(cha
 {
 	bert_disable = 1;
 
-	return 0;
+	return 1;
 }
 __setup("bert_disable", setup_bert_disable);
 
drivers/acpi/apei/erst.c +1 -1
@@ -891,7 +891,7 @@ EXPORT_SYMBOL_GPL(erst_clear);
 static int __init setup_erst_disable(char *str)
 {
 	erst_disable = 1;
-	return 0;
+	return 1;
 }
 
 __setup("erst_disable", setup_erst_disable);
drivers/acpi/apei/hest.c +1 -1
@@ -224,7 +224,7 @@ err:
 static int __init setup_hest_disable(char *str)
 {
 	hest_disable = HEST_DISABLED;
-	return 0;
+	return 1;
 }
 
 __setup("hest_disable", setup_hest_disable);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Randy Dunlap

__setup() handlers should return 1 to indicate that the boot option has been handled. Returning 0 causes a boot option to be listed in the Unknown kernel command line parameters and also added to init's arg list (if no '=' sign) or environment list (if of the form 'a=b').

Unknown kernel command line parameters "erst_disable
bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be passed to user space.

Run /sbin/init as init process
with arguments:
/sbin/init
erst_disable
bert_disable
hest_disable
with environment:

Quoted 8 lines
     HOME=/
     TERM=linux
     BOOT_IMAGE=/boot/bzImage-517rc6
Fixes a3e2acc5e37b ("ACPI / APEI: Add Boot Error Record Table (BERT) support")
Fixes a08f82d08053 ("ACPI, APEI, Error Record Serialization Table (ERST) support")
Fixes 9dc966641677 ("ACPI, APEI, HEST table parsing")

Good catch! Thanks for fixing!

Best Regards,
Huang, Ying

Quoted 48 lines
Link lore.kernel.org/r/[email protected]
Cc Huang Ying <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
Cc James Morse <[email protected]>
Cc Tony Luck <[email protected]>
Cc Borislav Petkov <[email protected]>
---
 drivers/acpi/apei/bert.c |    2 +-
 drivers/acpi/apei/erst.c |    2 +-
 drivers/acpi/apei/hest.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/apei/bert.c +1 -1
@@ -77,7 +77,7 @@ static int __init setup_bert_disable(cha
 {
 	bert_disable = 1;
 
-	return 0;
+	return 1;
 }
 __setup("bert_disable", setup_bert_disable);
 
drivers/acpi/apei/erst.c +1 -1
@@ -891,7 +891,7 @@ EXPORT_SYMBOL_GPL(erst_clear);
 static int __init setup_erst_disable(char *str)
 {
 	erst_disable = 1;
-	return 0;
+	return 1;
 }
 
 __setup("erst_disable", setup_erst_disable);
drivers/acpi/apei/hest.c +1 -1
@@ -224,7 +224,7 @@ err:
 static int __init setup_hest_disable(char *str)
 {
 	hest_disable = HEST_DISABLED;
-	return 0;
+	return 1;
 }
 
 __setup("hest_disable", setup_hest_disable);
maintainer Applied
#2 lore raw
Quoted 23 lines · Ying
Quoted 20 lines · Randy Dunlap

__setup() handlers should return 1 to indicate that the boot option has been handled. Returning 0 causes a boot option to be listed in the Unknown kernel command line parameters and also added to init's arg list (if no '=' sign) or environment list (if of the form 'a=b').

Unknown kernel command line parameters "erst_disable
bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be passed to user space.

Run /sbin/init as init process
with arguments:
/sbin/init
erst_disable
bert_disable
hest_disable
with environment:

     HOME=/
     TERM=linux
     BOOT_IMAGE=/boot/bzImage-517rc6
Quoted 8 lines
Quoted 4 lines
Fixes a3e2acc5e37b ("ACPI / APEI: Add Boot Error Record Table (BERT) support")
Fixes a08f82d08053 ("ACPI, APEI, Error Record Serialization Table (ERST) support")
Fixes 9dc966641677 ("ACPI, APEI, HEST table parsing")

Good catch! Thanks for fixing!

Applied as 5.18 material, thanks!