Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>

authored by

Pratyush Yadav and committed by
Andrew Morton
11047466 b1551515

+9 -3
+9 -3
lib/test_kho.c
··· 306 306 if (err) 307 307 return err; 308 308 309 - pr_info("KHO restore succeeded\n"); 310 309 return 0; 311 310 } 312 311 ··· 318 319 return 0; 319 320 320 321 err = kho_retrieve_subtree(KHO_TEST_FDT, &fdt_phys); 321 - if (!err) 322 - return kho_test_restore(fdt_phys); 322 + if (!err) { 323 + err = kho_test_restore(fdt_phys); 324 + if (err) 325 + pr_err("KHO restore failed\n"); 326 + else 327 + pr_info("KHO restore succeeded\n"); 328 + 329 + return err; 330 + } 323 331 324 332 if (err != -ENOENT) { 325 333 pr_warn("failed to retrieve %s FDT: %d\n", KHO_TEST_FDT, err);