]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tracefs: Removed unused 'ret' variable in eventfs_iterate()
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 14 Apr 2026 15:03:44 +0000 (11:03 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 14 Apr 2026 15:08:24 +0000 (11:08 -0400)
Moving to guard() usage removed the need of using the 'ret' variable but
it wasn't removed. As it was set to zero, the compiler in use didn't warn
(although some compilers do).

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20260414110344.75c0663f@robin
Fixes: 4d9b262031f ("eventfs: Simplify code using guard()s")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604100111.AAlbQKmK-lkp@intel.com/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/tracefs/event_inode.c

index af8d05df2726cb95a9398363e90b07a214b47a77..81df94038f2e24d9fc30c2bf6c3c12e377a4dde4 100644 (file)
@@ -574,7 +574,6 @@ static int eventfs_iterate(struct file *file, struct dir_context *ctx)
        struct eventfs_inode *ei;
        const char *name;
        umode_t mode;
-       int ret = -EINVAL;
        int ino;
        int i, r, c;
 
@@ -599,7 +598,6 @@ static int eventfs_iterate(struct file *file, struct dir_context *ctx)
         * Need to create the dentries and inodes to have a consistent
         * inode number.
         */
-       ret = 0;
 
        /* Start at 'c' to jump over already read entries */
        for (i = c; i < ei->nr_entries; i++, ctx->pos++) {