Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp321649rdb; Sun, 14 Jan 2024 19:56:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCHpgx1TFGYEXW06ADj1Jlzs0HiGWMe9RCE0kVou/CNr2Epectsj+q0q4vi75BIqO88GA2 X-Received: by 2002:a37:ad11:0:b0:783:21ef:e4 with SMTP id f17-20020a37ad11000000b0078321ef00e4mr5237739qkm.73.1705291005303; Sun, 14 Jan 2024 19:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705291004; cv=none; d=google.com; s=arc-20160816; b=IzBbyPXgl6vMmiAVkqFE8AFOZL8TrO0y7TIjiY1sZ0hkEYx5xyS6c6krOGmbo6r3PU +XJNMhsotydZYRkGS0RFv+ONjyE46hgs4U/nV8lAgKUu5LAW200FH/Wgaf/r0pUtmWYl YIB0qFJR6xxLlPdu8uTiYOXcxtrx8vNI6W9eYXW8DF3xqsF3B1Jy2JJ5e5jaNTMQjAca LhbLmJZiBFqdrxXBUFfNJFANlBOxSK6aOIV3DvNHe0Orpjp48ZJ3ts/P80NHJ8Gyxo2t +p1HnmgJcEtLjOjCV5xkeRHlNq89tnTXK/fdgA4siLhrUqQkj7CwMwXYF1AIVfnurzyS iz5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=srK+ezPNvvfdBiDpCQLcL9w4mZG2Cg9icrzRFkXFW1g=; fh=7yu4c+Y5M7IxEQ4qmc5Q5gLDMN9xnC91lFTUwZ+nzgY=; b=hrwgqBys1FH43tae1TfEJfdFrboiV/Bu37zjYlph+8zBtdhgOzp7lMRfwUlwYieTDv 5cjctmEIygnC5MAcyl0tbmYclYfKAmvh+Zf4+JFE365os217z2QMZpd1CbS+XNoorkN4 f3FpuKmREXDFMjC6o0LrIumzoL1gI0iN1vK/fIZ81X85KpdLKkIH/4g4FzNMUTYskkp3 bRedR8bnlqiamIFzWiohUOEzNe/yptQTi8k7g5auNJPNifZdgT2LFINrX06b4S59pwPU 9mkF9jlIooRrQiNlE1csU9+dTsey/bwYyfrs6MXil/UskSybMOe/kvBMzNJk7Qy/v8+C HLfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25611-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25611-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id pi2-20020a17090b1e4200b0028e20dd99cfsi5100707pjb.82.2024.01.14.19.56.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 19:56:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25611-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25611-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25611-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C27BFB20D7C for ; Mon, 15 Jan 2024 03:56:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 963D62572; Mon, 15 Jan 2024 03:56:29 +0000 (UTC) Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id 2C63920F4; Mon, 15 Jan 2024 03:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 161F46019B694; Mon, 15 Jan 2024 11:56:18 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Li zeming Subject: [PATCH] proc: proc_sysctl: Optimize proc_sys_fill_cache() variable Date: Mon, 15 Jan 2024 11:56:14 +0800 Message-Id: <20240115035614.26187-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The ino and type variables are assigned values before use, and they do not need to be assigned values when defined. Signed-off-by: Li zeming --- fs/proc/proc_sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index c88854df0b624..cdda684551599 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -683,8 +683,8 @@ static bool proc_sys_fill_cache(struct file *file, struct dentry *child, *dir = file->f_path.dentry; struct inode *inode; struct qstr qname; - ino_t ino = 0; - unsigned type = DT_UNKNOWN; + ino_t ino; + unsigned type; qname.name = table->procname; qname.len = strlen(table->procname); -- 2.18.2