Skip to contentSkip to conversation

trace: remove the dead IS_ERR() check in trace_pipe_open()

PATCH In review Yash Suthar 2 participants 2 messages Apr 20 – Apr 28 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace: remove the dead IS_ERR() check in trace_pipe_open()

in trace_pipe_open() already check the IS_ERR(iter) and return early on error,so iter after will be valid and it is safe to return 0 at end.

---
 kernel/trace/trace_remote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_remote.c +1 -1
index d6c3f94d67cd..2a6cc000ec98 100644
@@ -602,7 +602,7 @@ static int trace_pipe_open(struct inode *inode, struct file *filp)
 
 	filp->private_data = iter;
 
-	return IS_ERR(iter) ? PTR_ERR(iter) : 0;
+	return 0;
 }
 
 static int trace_pipe_release(struct inode *inode, struct file *filp)
Signature · 1 line
2.43.0
maintainer
#1 lore raw

On Mon, 20 Apr 2026 15:42:36 +0530
Yash Suthar <[email protected]> wrote:

"remove the dead"? What is this? a horror flick? ;-)

The subsystem is "tracing" not "trace" and the first word should be capitalized. I changed the subject to:

[PATCH] tracing: Remove redundant IS_ERR() check in trace_pipe_open()

And pulled it in.

When submitting changes to a subsystem, please do a git log --no-merges to see how other commits are done in that subsystem.

Thanks,

-- Steve

Quoted 22 lines

in trace_pipe_open() already check the IS_ERR(iter) and return early on error,so iter after will be valid and it is safe to return 0 at end.

---
 kernel/trace/trace_remote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_remote.c +1 -1
index d6c3f94d67cd..2a6cc000ec98 100644
@@ -602,7 +602,7 @@ static int trace_pipe_open(struct inode *inode, struct file *filp)
 
 	filp->private_data = iter;
 
-	return IS_ERR(iter) ? PTR_ERR(iter) : 0;
+	return 0;
 }
 
 static int trace_pipe_release(struct inode *inode, struct file *filp)