Skip to contentSkip to conversation

test_kho: always print restore status

PATCH Applied Pratyush Yadav 4 participants 4 messages Nov 18, 2025 – Nov 20, 2025

Subsystems (4)
lore
Share & tools
lore

Pratyush Yadav

author maintainer
#0 lore raw

PATCH 1/1 test_kho: always print restore status

Currently the KHO test only prints a message on success, and remains silent on failure. This makes it difficult to notice a failing test. A failing test is usually more interesting than a successful one.

Always print the test status after attempting restore.

---
 lib/test_kho.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
lib/test_kho.c +9 -3
index 85b60d87a50ad..47de562807955 100644
@@ -306,7 +306,6 @@ static int kho_test_restore(phys_addr_t fdt_phys)
 	if (err)
 		return err;
 
-	pr_info("KHO restore succeeded\n");
 	return 0;
 }
 
@@ -319,8 +318,15 @@ static int __init kho_test_init(void)
 		return 0;
 
 	err = kho_retrieve_subtree(KHO_TEST_FDT, &fdt_phys);
-	if (!err)
-		return kho_test_restore(fdt_phys);
+	if (!err) {
+		err = kho_test_restore(fdt_phys);
+		if (err)
+			pr_err("KHO restore failed\n");
+		else
+			pr_info("KHO restore succeeded\n");
+
+		return err;
+	}
 
 	if (err != -ENOENT) {
 		pr_warn("failed to retrieve %s FDT: %d\n", KHO_TEST_FDT, err);

base-commit: f0bfdc2b69f5c600b88ee484c01b213712c63d94

Signature · 1 line
2.47.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Pratyush Yadav

Currently the KHO test only prints a message on success, and remains silent on failure. This makes it difficult to notice a failing test. A failing test is usually more interesting than a successful one.

Always print the test status after attempting restore.

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Pratyush Yadav
Quoted 7 lines · Pratyush Yadav

Currently the KHO test only prints a message on success, and remains silent on failure. This makes it difficult to notice a failing test. A failing test is usually more interesting than a successful one.

Always print the test status after attempting restore.

Quoted 39 lines
---
 lib/test_kho.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
lib/test_kho.c +9 -3
index 85b60d87a50ad..47de562807955 100644
@@ -306,7 +306,6 @@ static int kho_test_restore(phys_addr_t fdt_phys)
 	if (err)
 		return err;
 
-	pr_info("KHO restore succeeded\n");
 	return 0;
 }
 
@@ -319,8 +318,15 @@ static int __init kho_test_init(void)
 		return 0;
 
 	err = kho_retrieve_subtree(KHO_TEST_FDT, &fdt_phys);
-	if (!err)
-		return kho_test_restore(fdt_phys);
+	if (!err) {
+		err = kho_test_restore(fdt_phys);
+		if (err)
+			pr_err("KHO restore failed\n");
+		else
+			pr_info("KHO restore succeeded\n");
+
+		return err;
+	}
 
 	if (err != -ENOENT) {
 		pr_warn("failed to retrieve %s FDT: %d\n", KHO_TEST_FDT, err);

base-commit: f0bfdc2b69f5c600b88ee484c01b213712c63d94

Signature · 1 line
2.47.3
Signature · 2 lines
Sincerely yours,
Mike.
Acked-by on v1 1/1
#3 lore raw
In reply to Pratyush Yadav
Quoted 7 lines · On Tue, 18 Nov 2025 19:10:45 +0100 Pratyush Yadav <[email protected]> wrote:

Currently the KHO test only prints a message on success, and remains silent on failure. This makes it difficult to notice a failing test. A failing test is usually more interesting than a successful one.

Always print the test status after attempting restore.

Thanks,
SJ

[...]