]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
test_kho: always print restore status
authorPratyush Yadav <pratyush@kernel.org>
Tue, 18 Nov 2025 18:10:45 +0000 (19:10 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 27 Nov 2025 22:24:42 +0000 (14:24 -0800)
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.

Link: https://lkml.kernel.org/r/20251118181046.23321-1-pratyush@kernel.org
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: SeongJae Park <sj@kerneel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/test_kho.c

index 85b60d87a50ad63fec147a51a543096ac72d8ef6..47de5628079557195246e1d261a20e3fca9a5a26 100644 (file)
@@ -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);