From: Peter Senna Tschudin <peter.senna@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Peter Senna Tschudin <peter.senna@linux.intel.com>,
vitaly.prosyak@amd.com, christian.koenig@amd.com,
alexander.deucher@amd.com, jesse.zhang@amd.com,
harry.wentland@amd.com, zbigniew.kempczynski@intel.com,
kamil.konieczny@linux.intel.com, ryszard.knop@intel.com,
lucas.demarchi@intel.com, katarzyna.piecielska@intel.com
Subject: [PATCH i-g-t] runner/kmemleak: Remove unnecessary lseek() calls
Date: Mon, 10 Mar 2025 21:02:20 +0100 [thread overview]
Message-ID: <20250310200220.233045-1-peter.senna@linux.intel.com> (raw)
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
next reply other threads:[~2025-03-10 20:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 20:02 Peter Senna Tschudin [this message]
2025-03-11 1:38 ` ✓ Xe.CI.BAT: success for runner/kmemleak: Remove unnecessary lseek() calls 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250310200220.233045-1-peter.senna@linux.intel.com \
--to=peter.senna@linux.intel.com \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=harry.wentland@amd.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jesse.zhang@amd.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=katarzyna.piecielska@intel.com \
--cc=lucas.demarchi@intel.com \
--cc=ryszard.knop@intel.com \
--cc=vitaly.prosyak@amd.com \
--cc=zbigniew.kempczynski@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox