public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] selftests/powerpc: Remove the path after initialization.
@ 2024-09-30  1:27 zhangjiao2
  2024-10-02  5:45 ` Ritesh Harjani
  2024-11-17 12:09 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: zhangjiao2 @ 2024-09-30  1:27 UTC (permalink / raw)
  To: ritesh.list
  Cc: linux-kernel, linux-kselftest, linuxppc-dev, mpe, shuah,
	zhang jiao

From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

If there were no anamolies noted, then we can
simply remove the log file and return.

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
v1->v2:
	Remove the path after initialization.

 tools/testing/selftests/powerpc/mm/tlbie_test.c | 10 +++++-----
 1 file 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);
 }
-- 
2.33.0




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] selftests/powerpc: Remove the path after initialization.
  2024-09-30  1:27 [PATCH v2] selftests/powerpc: Remove the path after initialization zhangjiao2
@ 2024-10-02  5:45 ` Ritesh Harjani
  2024-11-17 12:09 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2024-10-02  5:45 UTC (permalink / raw)
  To: zhangjiao2
  Cc: linux-kernel, linux-kselftest, linuxppc-dev, mpe, shuah,
	zhang jiao

zhangjiao2 <zhangjiao2@cmss.chinamobile.com> writes:

> From: zhang jiao <zhangjiao2@cmss.chinamobile.com>
>
> If there were no anamolies noted, then we can
> simply remove the log file and return, ....

after the path variable has been initialized.

(minor nit)


>
> Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> ---
> v1->v2:
> 	Remove the path after initialization.
>
>  tools/testing/selftests/powerpc/mm/tlbie_test.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)


Thanks for the fix. Looks good to me. 
Please feel free to add - 

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] selftests/powerpc: Remove the path after initialization.
  2024-09-30  1:27 [PATCH v2] selftests/powerpc: Remove the path after initialization zhangjiao2
  2024-10-02  5:45 ` Ritesh Harjani
@ 2024-11-17 12:09 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2024-11-17 12:09 UTC (permalink / raw)
  To: ritesh.list, zhangjiao2
  Cc: linux-kernel, linux-kselftest, linuxppc-dev, mpe, shuah

On Mon, 30 Sep 2024 09:27:57 +0800, zhangjiao2 wrote:
> If there were no anamolies noted, then we can
> simply remove the log file and return.
> 
> 

Applied to powerpc/next.

[1/1] selftests/powerpc: Remove the path after initialization.
      https://git.kernel.org/powerpc/c/7ca93aa9204b706e4afcd4fae0dc8798500598d5

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-17 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30  1:27 [PATCH v2] selftests/powerpc: Remove the path after initialization zhangjiao2
2024-10-02  5:45 ` Ritesh Harjani
2024-11-17 12:09 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox