Received: by 10.223.185.116 with SMTP id b49csp327958wrg; Sat, 10 Feb 2018 08:00:29 -0800 (PST) X-Google-Smtp-Source: AH8x227MNFiZwQ+Rt9ljhDv76ECzvRPk7SCRSE4Q+/TU2w4TtSFL0Q2t4mGZFY5IXfr5tPiQUmoE X-Received: by 10.99.159.10 with SMTP id g10mr5272929pge.27.1518278429817; Sat, 10 Feb 2018 08:00:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518278429; cv=none; d=google.com; s=arc-20160816; b=RPxuX3yYooT+HcYn30z5dzcOqLv4ELZXjyAyiLNurO75w2K5AHqKfUyfbPU0aaGYQy dE1xiSyjcRmJG/WQ99cTUJJCN01qwb8e/wNwPYVIfAiMH/sMgtt0hC52aW0KcZZDIIvh kR3vUlrFpl7q9HgaZo0cPa8I2U9oLuE3uaWU2mTa5enJYrxU1x+q3wk9cRHIbQDKdMI0 KpXNhkbihYgN7ZvojTX2ZvfAFRj8KuVt/BTkTiR/BtMBvHf5YciPAwxPLh8CiZmWorZc VdZk9W9jwu4K42jDhIbmE2AQwjOCq3nSDqd+oOjqPF0Nf6ImA2J4lneWjBnGVa7+MgP5 IhCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature:arc-authentication-results; bh=7DVeeQvAqSpJQqKXKKg0moa4cUz32pD+/3IKgVu6jdQ=; b=ym0XIJXj5PUw1c7lhNQkGr23e4TN+0Fl/HlRp7C5w61VHMRP/K8F1KFRK50aY23Rzb WVInEsbgEFEJs4JvcsgQNIWxHwnY2YEsPXmR3zBUCLHEMcTs06k2V3ZkS2vNUyHN6CJw oJ+hv9CJrlO1l36k6n07lI9yvceDaP7Ncr3XrbDCq6fy2bDYl0jYLcsmZSNCWEQ1iUIE PA7opGFh7tR1nW2uGt+wsN49mR0gsLLddVIuIjHsUblUUwedSrs3wZaVXPcxV+7UZX49 Eq50pXtBxTFnvczDhvJWCi4I8po6LsGFY1mDdBMNj+uol8hUQFUyI5N8TSR6rKNPmalJ Mj0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UC4HKWAr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si1588229pld.110.2018.02.10.08.00.15; Sat, 10 Feb 2018 08:00:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UC4HKWAr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751248AbeBJP7h (ORCPT + 99 others); Sat, 10 Feb 2018 10:59:37 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:41157 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbeBJP7g (ORCPT ); Sat, 10 Feb 2018 10:59:36 -0500 Received: by mail-qk0-f196.google.com with SMTP id h186so1526069qke.8; Sat, 10 Feb 2018 07:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=7DVeeQvAqSpJQqKXKKg0moa4cUz32pD+/3IKgVu6jdQ=; b=UC4HKWArYfePgF4LGgOQR+be+vdj7kSKpeI1zchdRzrrGZl86MYkItlQ6alUWx3U6m WD07kd4uVxqK4H6KRpXtxBvjsh5KcNhulQSwKyLTP3nO3vjZmB8Gsr7m9XKRWkp7aclA CWCGVgw3KK87V8ydvcvQ1yswJpLNMaHGkQ1iWWbTMAYYuk3VFikM8fTmx9HkK6t0KrL5 x9ANYHnAXNPFiOIXw+SBKhezGEIFsczbqk9EUHoM7SIfPKyoAoVlzNp2OyZQI0p2r9E9 dUIzJGOIf72Au+btuUR3XbcR4LsSeuyeOkqPELGPd5buVupTOjetZ/jTzlf9m4ljQulf XKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=7DVeeQvAqSpJQqKXKKg0moa4cUz32pD+/3IKgVu6jdQ=; b=JRy1wc/oIfVafNCailCj+fLTbex4RtPIKnAwDiySkJ0/iszwL5Dj57wCoCyUumKCu7 yvePCb0vov3qVUUACfMoPw8Wi2exPTceCSxvHFocn0DN36ruqbAMnG2um4xU8Y5EuatA VvieNKJT1iNuW/OJr6yfVSVhNatJub6eBICQNRhxjD++xoDYD/XgeJJAxQb+/EP7n6lS 58AENIu+sV+1p3ecNEqlfbSGiquukEQVCxqY0GWuBEtFtSQqdiNxJyaH/HAVp9PC8++P c83klHUC0EA46NJCZ1gVYwKcQ5luha5OEooCucF6VGy7lAVteX10RNhr8WFmf+85r9Yh dwtw== X-Gm-Message-State: APf1xPBEUJH9rHzSjnGbgiyfgr8HpXA2SXZyRePkfy1LeU2HLJmw6Tk0 SnmrwhpQRMutuDLOBTlgDMiMlfUe9gaii233xCeV4Q== X-Received: by 10.55.95.4 with SMTP id t4mr2218622qkb.102.1518278375513; Sat, 10 Feb 2018 07:59:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.153.45 with HTTP; Sat, 10 Feb 2018 07:59:14 -0800 (PST) From: Donglin Peng Date: Sat, 10 Feb 2018 23:59:14 +0800 Message-ID: Subject: [PATCH] seq_file: remove redundant assignment of index to m->index To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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