summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhang jiao <zhangjiao2@cmss.chinamobile.com>2024-09-30 09:27:57 +0800
committerMichael Ellerman <mpe@ellerman.id.au>2024-11-14 22:41:00 +1100
commit7ca93aa9204b706e4afcd4fae0dc8798500598d5 (patch)
tree1ca46b651363f9fec208ba11cef3e051bb8b8332
parentb196db2f536645eda7684655f3fae913e33fda4b (diff)
selftests/powerpc: Remove the path after initialization.
If there were no anamolies noted, then we can simply remove the log file and return, but only after the path variable has been initialized. Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://patch.msgid.link/20240930012757.2395-1-zhangjiao2@cmss.chinamobile.com
-rw-r--r--tools/testing/selftests/powerpc/mm/tlbie_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/powerpc/mm/tlbie_test.c b/tools/testing/selftests/powerpc/mm/tlbie_test.c
index 48344a74b212..35f0098399cc 100644
--- a/tools/testing/selftests/powerpc/mm/tlbie_test.c
+++ b/tools/testing/selftests/powerpc/mm/tlbie_test.c
@@ -313,16 +313,16 @@ static inline void end_verification_log(unsigned int tid, unsigned nr_anamolies)
fclose(f);
- if (nr_anamolies == 0) {
- remove(path);
- return;
- }
-
sprintf(logfile, logfilename, tid);
strcpy(path, logdir);
strcat(path, separator);
strcat(path, logfile);
+ if (nr_anamolies == 0) {
+ remove(path);
+ return;
+ }
+
printf("Thread %02d chunk has %d corrupted words. For details check %s\n",
tid, nr_anamolies, path);
}