Received: by 2002:a25:d80d:0:0:0:0:0 with SMTP id p13csp113794ybg; Sat, 23 May 2020 08:52:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcXaTSzAl9R3Al07lMmbQPoj2tT/Pu2y6wLerjZFU4lCxd6k3s6HzHBjeeg9iK/Fcnuc/I X-Received: by 2002:a17:906:dbc9:: with SMTP id yc9mr12908207ejb.157.1590249124016; Sat, 23 May 2020 08:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590249124; cv=none; d=google.com; s=arc-20160816; b=nVpIz/Sj997IhzgYLe6Nuzc8ZoLIpcQHb6oMtKmyu+aI6XGrvZX3rRpnZLHagKKL3A KjccCBYKrO3yXttiv1Hhh5AHfzL3Cpnb5EIj2ztpgrrXSBtqrMXD8S88FUWqhR9YjCwJ wXJYv0yupWhmfiRKEJ3oYLKX7xeAJjdpD9grztJSkGTZs1+C6n5rzXQNCgOSNTl/ESZQ F8//jtdOifegVpzQzCf+kkZJ6wjb/2Bkq+0h4msb/nlheUH2p5W5GL8IjytZymkMmqV1 u9B7R01fgQoTrV6ZEhEnYG6VpVIzXmXJJCyjzf4y/HlN4Gic5Ym96TzjRxOpTVHIy28L msVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+mvctUy91IWcg4jckZ10jndkvPR8FzL6g68HcXaaASk=; b=PdZgMD+y3K4abcLoEEUMU5vH+XVEMxPdDvfy6XXsddmpZk4RqqY49vIhA2ZrSBulxM obmOIX6C70eXneoAnl0nJP+Bgb0OmgBegK7N7pdo017bWYk5+MWI6f43Ujp89NiUBc0K EnzljiRNdVLZ3+vHodlWMrjoPnE+s9t8LAvwizydf7SBDmR5U4AOk6oKq1ukzUpCMtQ7 GKzwPiLRUquduorucdBkkaGQ/hqfSk89u3TZpH3h1APfQya1nd/vLQjg2odBWNFa0v08 axAizqPt2mq6zyS0gH8sU2F8oFEk5B/4zSt3y94niz7nlNuBuTANAtfvbu0Djw6JvnyK 1gCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bRlClyHR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id dn4si6327952edb.398.2020.05.23.08.51.40; Sat, 23 May 2020 08:52:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bRlClyHR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727117AbgEWPtq (ORCPT + 99 others); Sat, 23 May 2020 11:49:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726650AbgEWPtp (ORCPT ); Sat, 23 May 2020 11:49:45 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3726C061A0E; Sat, 23 May 2020 08:49:45 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id x13so6584657pfn.11; Sat, 23 May 2020 08:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+mvctUy91IWcg4jckZ10jndkvPR8FzL6g68HcXaaASk=; b=bRlClyHRxNVF3xZpJltSKBJ7Rzcbm5VeSCke5DOHrjwJ5zDbWjHMKL66++sGRnoOwk Jpj9Di5V6GAa2hZUfNsIr7XNkin081bpYXRA2aRrzHPvgVryPDgwNxzVQyNEw7KdYNJA VYYNCvJmNvsYV1c1m1bgYHy7FzrnpUp6NQOzsTpS9yu59rRAP2vFCHMiLJzr8zTbcm0M YICByfXtMEcwntE++EdouXW88H194T79aiBh3Zw+hwwyWKuIIPhmn7SwBdzK3aTobokC kT9WZJTB4eVBgbV9yWUxklHkP1brXvmFjCwXYcB6jYlnmPGeKHNdnkRqrnmp15g14gTX 18Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+mvctUy91IWcg4jckZ10jndkvPR8FzL6g68HcXaaASk=; b=Q5fLaOs4D3sXf91u5FZqsCQfxliBAR2/Ir6MTooetdRWsZBbt4HWmm0fICx3JhWF10 gMloyMY9tnYEEr2t+Y7FBMGpW87+m2ihTw7d0/U4uRZWo21hQvGh9twSGW9uwkglmdiz CJJ3/kEdHAQm/aWdjPWdG201Q/j/N2bK7kJwseKCo6BqBEbMIaxGKw8RPme51Oax9mxo aNIwurS28huqL/v+G8sBu+B2ZUvXA17MptINWyhU2IKbLURUzurLykuoAQq0XMM4fnBP Wy/QVj+LTsj7YO8H/x/yLEP12cp90AZsgn1QAgh9HS752DoyqzHOur+Ubw69v3NOJ16n pYBg== X-Gm-Message-State: AOAM533dMfT3aB3TWJl+IWvuEY4nUjzSOE9vTFV04oqZCNXK3cczKZSM ijqgGcKkcIGV6WyOmt3KavTlmIdq X-Received: by 2002:a63:7d4e:: with SMTP id m14mr19416328pgn.391.1590248985504; Sat, 23 May 2020 08:49:45 -0700 (PDT) Received: from Smcdef-MBP.lan ([103.136.220.68]) by smtp.gmail.com with ESMTPSA id p19sm8773968pfn.216.2020.05.23.08.49.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 May 2020 08:49:44 -0700 (PDT) From: Kaitao Cheng To: adobriyan@gmail.com Cc: pilgrimtao@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, songmuchun@bytedance.com Subject: [PATCH] proc/fd: Remove the initialization of variables in seq_show() Date: Sat, 23 May 2020 23:49:31 +0800 Message-Id: <20200523154931.29255-1-pilgrimtao@gmail.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The variables{files, file} will definitely be assigned, so we don't need to initialize them. Signed-off-by: Kaitao Cheng --- fs/proc/fd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 81882a13212d..6f95baf44e37 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -19,9 +19,9 @@ static int seq_show(struct seq_file *m, void *v) { - struct files_struct *files = NULL; + struct files_struct *files; int f_flags = 0, ret = -ENOENT; - struct file *file = NULL; + struct file *file; struct task_struct *task; task = get_proc_task(m->private); -- 2.20.1