Skip to contentSkip to conversation

libtracefs: Remove unused variable mode in tracefs_cpu_alloc_fd()

PATCH New Steven Rostedt 1 participant 1 message Nov 8

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Remove unused variable mode in tracefs_cpu_alloc_fd()

From: Steven Rostedt <[email protected]>

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()")
---
 src/tracefs-record.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
src/tracefs-record.c +1 -4
index f5197c458c07..644082b6ba0e 100644
@@ -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;
Signature · 1 line
2.53.0