Linux Trace Development
 help / color / mirror / Atom feed
* [PATCH] libtracefs: Remove unused variable mode in tracefs_cpu_alloc_fd()
@ 2026-11-08 10:18 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2026-11-08 10:18 UTC (permalink / raw)
  To: Linux Trace Devel

From: Steven Rostedt <rostedt@goodmis.org>

When tracefs_cpu_alloc_fd() was introduced, it broke up
-tracefs_cpu_open() to use parts in multiple functions. As
tracefs_cpu_alloc_fd() was created from -tracefs_cpu_open(), it had the
mode variable from that function, but it never used it.
Remove the unuesd mode variable.

Fixes: da88fcef46b46 ("libtracefs: Add tracefs_cpu_alloc_fd() and tracefs_cpu_free_fd()")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 src/tracefs-record.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/tracefs-record.c b/src/tracefs-record.c
index f5197c458c07..644082b6ba0e 100644
--- a/src/tracefs-record.c
+++ b/src/tracefs-record.c
@@ -54,17 +54,14 @@ struct tracefs_cpu *
 tracefs_cpu_alloc_fd(int fd, int subbuf_size, bool nonblock)
 {
 	struct tracefs_cpu *tcpu;
-	int mode = O_RDONLY;
 	int ret;
 
 	tcpu = calloc(1, sizeof(*tcpu));
 	if (!tcpu)
 		return NULL;
 
-	if (nonblock) {
-		mode |= O_NONBLOCK;
+	if (nonblock)
 		tcpu->flags |= TC_NONBLOCK | TC_PERM_NONBLOCK;
-	}
 
 	tcpu->splice_pipe[0] = -1;
 	tcpu->splice_pipe[1] = -1;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-08 10:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08 10:18 [PATCH] libtracefs: Remove unused variable mode in tracefs_cpu_alloc_fd() Steven Rostedt

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