Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp709226rdb; Fri, 1 Sep 2023 01:41:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHG9nwyoBiuJbNtoDHtZQOds4NswJyapIuiVLY6QIUx6EmRjuT9Qdv3xOMXXtNyk5eqSil0 X-Received: by 2002:a17:902:e54c:b0:1bd:a22a:d406 with SMTP id n12-20020a170902e54c00b001bda22ad406mr2312225plf.21.1693557697907; Fri, 01 Sep 2023 01:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693557697; cv=none; d=google.com; s=arc-20160816; b=DJGjtvO2yTB4/tTBlCw+H7y58iIvSFlhY8TDHo97I7JY7I7MskerDLUXbIfwVZ16/n RG/hSZSYfGCElqwhvG02RNK7r1soJjAPf9Kxsywp27piOkjYcNtp9MBwTE9auSVxmV+9 Lqe+1EHf1qqn06Cd5Mk7Jb8Ox0lRp5Tuyqlng2UzJzuG2O3waTXcXZgZxNLG9LF/Gle7 9fh/PV3t8Fk4KOIF/hVhBrMNhtGzz7MdEXPLk0WGdBgUvhQHPvDGRbCwVNZ+KdsnkVMi Cj2NFCRYTZCz6/6WpLAh5F2+ijkHdSXAkv7DtwWvr7CTLUh0FZJqTQZAchuPZb0lGeYA DFUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=d2ILLAcdDyqMqSdrouOJwvcCXxeIr/wNol0mGMEdP1I=; fh=xHIYJx91mAbcg9lQeIGeYiw5tnNImkLqJpzzPuo5l1g=; b=uwCqtOgDgZgj8F76sbdtjD9g2HBA3dLXxKrdGcUzL8+b91Z+YpuF1uVqTdDv64Rt7+ S/1cmlmt8oNvupq9LixmxhtD70CPyf1UohorjtHqg+uFlc+gxmPPXXEy3TEcs0U/D5dM WxKx61SxLw27iVX9ouSw/E1eaCZ/aW8dqajt3Jp+zI9ZUol4CRFABHJxHNpUvryc9Him DDUDpZJj5nrnJXB2gbgL49nDWIKqtWMGFhqGIAJcdY6R/pBmzexSm/ssykVJmSjkA3Jg SfdeePD8QuTQOlNw0w98j2exI06LlF1BmJGgy0WQMARqzr+43MXVUA1uDKq7S5/WmDkZ Qdsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a17090332c100b001bdff09dcccsi2580821plr.139.2023.09.01.01.41.23; Fri, 01 Sep 2023 01:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345049AbjIABvg (ORCPT + 99 others); Thu, 31 Aug 2023 21:51:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348123AbjIABvd (ORCPT ); Thu, 31 Aug 2023 21:51:33 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 939D310F2; Thu, 31 Aug 2023 18:51:11 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 0628260338E84; Fri, 1 Sep 2023 09:51:07 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] =?UTF-8?q?net/socket:=20Remove=20unnecessary=20=E2=80=980?= =?UTF-8?q?=E2=80=99=20values=20from=20used?= Date: Sun, 3 Sep 2023 02:22:28 +0800 Message-Id: <20230902182228.3124-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org used is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming --- net/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/socket.c b/net/socket.c index 2b0e54b2405c..743e54eba06f 100644 --- a/net/socket.c +++ b/net/socket.c @@ -569,12 +569,12 @@ static ssize_t sockfs_listxattr(struct dentry *dentry, char *buffer, size_t size) { ssize_t len; - ssize_t used = 0; + ssize_t used; len = security_inode_listsecurity(d_inode(dentry), buffer, size); if (len < 0) return len; - used += len; + used = len; if (buffer) { if (size < used) return -ERANGE; -- 2.18.2