Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] runner/kmemleak: Remove unnecessary lseek() calls
@ 2025-03-10 20:02 Peter Senna Tschudin
  2025-03-11  1:38 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Peter Senna Tschudin @ 2025-03-10 20:02 UTC (permalink / raw)
  To: igt-dev
  Cc: Peter Senna Tschudin, vitaly.prosyak, christian.koenig,
	alexander.deucher, jesse.zhang, harry.wentland,
	zbigniew.kempczynski, kamil.konieczny, ryszard.knop,
	lucas.demarchi, katarzyna.piecielska

Earlier versions of the code performed multiple read operations on the
kmemleak file without closing and reopening the file descriptor. To
handle this, lseek() was used to reset the read position.

However, the current implementation no longer requires these lseek()
calls, as the redundant read operations have been removed. This commit
eliminates the leftover lseek() calls that are now unnecessary.

Cc: vitaly.prosyak@amd.com
Cc: christian.koenig@amd.com
Cc: alexander.deucher@amd.com
Cc: jesse.zhang@amd.com
Cc: harry.wentland@amd.com
Cc: zbigniew.kempczynski@intel.com
Cc: kamil.konieczny@linux.intel.com
Cc: ryszard.knop@intel.com
Cc: lucas.demarchi@intel.com
Cc: katarzyna.piecielska@intel.com
Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com>
---
 runner/kmemleak.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/runner/kmemleak.c b/runner/kmemleak.c
index e1bfb65ba..e52bc12d5 100644
--- a/runner/kmemleak.c
+++ b/runner/kmemleak.c
@@ -116,9 +116,6 @@ static bool runner_kmemleak_found_leaks(void)
 
 	rlen = read(fd, buf, 1);
 
-	if (rlen == 1)
-		lseek(fd, 0, SEEK_SET);
-
 	close(fd);
 
 	return rlen == 1;
@@ -169,12 +166,6 @@ static bool runner_kmemleak_append_to(const char *last_test, int resdirfd,
 	if (kmemleakfd < 0)
 		return false;
 
-	/* Seek back to first byte */
-	if (lseek(kmemleakfd, 0, SEEK_SET) == (off_t)-1) {
-		close(kmemleakfd);
-		return false;
-	}
-
 	/* Open text file to append */
 	resfilefd = openat(resdirfd, KMEMLEAK_RESFILENAME,
 			   O_RDWR | O_CREAT | O_APPEND, 0666);
-- 
2.34.1


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

end of thread, other threads:[~2025-03-28 14:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10 20:02 [PATCH i-g-t] runner/kmemleak: Remove unnecessary lseek() calls Peter Senna Tschudin
2025-03-11  1:38 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-03-11  1:47 ` ✗ i915.CI.BAT: failure " Patchwork
2025-03-11  7:10   ` Peter Senna Tschudin
2025-03-11  9:51     ` Ravali, JupallyX
2025-03-11  9:50 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-11 13:45 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-11 15:21   ` Peter Senna Tschudin
2025-03-12  5:54     ` Ravali, JupallyX
2025-03-11 21:50 ` ✗ Xe.CI.Full: " Patchwork
2025-03-12 10:18   ` Peter Senna Tschudin
2025-03-12  5:51 ` ✓ i915.CI.Full: success " Patchwork
2025-03-13 10:58 ` [PATCH i-g-t] " Kamil Konieczny
2025-03-28 14:02 ` Kamil Konieczny

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