[PATCH] trace: remove the dead IS_ERR() check in trace_pipe_open()

Yash Suthar posted 1 patch 1 month, 3 weeks ago
kernel/trace/trace_remote.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] trace: remove the dead IS_ERR() check in trace_pipe_open()
Posted by Yash Suthar 1 month, 3 weeks ago
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.

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
---
 kernel/trace/trace_remote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_remote.c b/kernel/trace/trace_remote.c
index d6c3f94d67cd..2a6cc000ec98 100644
--- a/kernel/trace/trace_remote.c
+++ b/kernel/trace/trace_remote.c
@@ -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)
-- 
2.43.0
Re: [PATCH] trace: remove the dead IS_ERR() check in trace_pipe_open()
Posted by Steven Rostedt 1 month, 2 weeks ago
On Mon, 20 Apr 2026 15:42:36 +0530
Yash Suthar <yashsuthar983@gmail.com> 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

> 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.
> 
> Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
> ---
>  kernel/trace/trace_remote.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_remote.c b/kernel/trace/trace_remote.c
> index d6c3f94d67cd..2a6cc000ec98 100644
> --- a/kernel/trace/trace_remote.c
> +++ b/kernel/trace/trace_remote.c
> @@ -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)