lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 10 Feb 2018 23:59:14 +0800
From:   Donglin Peng <dolinux.peng@...il.com>
To:     viro@...iv.linux.org.uk
Cc:     linux-fsdevel@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] seq_file: remove redundant assignment of index to m->index

There are two redundant assignments in the traverse() function, because
the while loop will break after these two assignments, and after that
the variable index will be assigned to m->index again.

Signed-off-by: Peng Donglin <dolinux.peng@...il.com>
---
 fs/seq_file.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index eea09f6..2298656 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -120,14 +120,12 @@ static int traverse(struct seq_file *m, loff_t offset)
         if (pos + m->count > offset) {
             m->from = offset - pos;
             m->count -= m->from;
-            m->index = index;
             break;
         }
         pos += m->count;
         m->count = 0;
         if (pos == offset) {
             index++;
-            m->index = index;
             break;
         }
         p = m->op->next(m, p, &index);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ