Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5072371rwj; Tue, 20 Dec 2022 20:06:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXuFyLhRZtXymuBmVboqomJPTV6ujx8sBIhn6uYfnyEqm+JM3F1ELX5PxdJabDcboRGgOv6B X-Received: by 2002:a05:6402:685:b0:46b:4011:9863 with SMTP id f5-20020a056402068500b0046b40119863mr148369edy.39.1671595568613; Tue, 20 Dec 2022 20:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671595568; cv=none; d=google.com; s=arc-20160816; b=zwGkqDYSQpy0a6e9fwx4OujJQNlZsFiRmxQSC6aHim8w9Fjl3Umm7LLUa17XH+l6Um vgCRuxXAQdB3Zhq11nZNV6vxSmM1G7e295qcw8K+34h3tT63PVI8uq7XTfRgniQS97Wi 1PExeNgzGyig//UMZMRg/M5Z/YM5RRb5kCrp5Csc8jOVXpTPzhaXzuLzdCMSrvekr9eC tdg1Kjsm7w5iiUBgPIjaISt+DA0/YsoQGji7TCbK6F6gfBbrMsyoCsOQt+32/os7zFZG CUU+fgA9mQIuTprS3LtqqnQPSXQwiIuEM9m2X57hF9+UGx07iEaDcDoW3IU1Zd8zlV9W DAJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=pRThylxyyTSkKs8GO04Xd2MtQVniueQEZ2/AOtGCGJI=; b=XuDCxvrlUI07La8PbIRTS4f3pCHKzaYkgUiD8XX/dEvi9B5ILPvS2okrCiv2kJ1C4l TGRcWn79skFKCjUufA2UZPIgRdt/1OWQP9k807v70PD8tMP/UDJ7ciMHNmWaBCISaA2L 33bptN280dV4HfM8SY/YZczURryOXcqPKYYMzPcFZd46p6F1U5V7vLZZbMNwWsuXtdfM 9OZ6DbUT0xicpM3WoYSnYJptnOck1IocX+fp11H9wJq7DJT04H5iz2zN3cJolQaerI2Y xwht6KDs2YpRWi8MQL5W3zBX0FcVWvrvVs/I7YsumO0wg4MjlG9lHke3q1RBVihDt+B6 7zmw== 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 td3-20020a1709078c8300b007d7c0cbf1e4si11968654ejc.698.2022.12.20.20.05.50; Tue, 20 Dec 2022 20:06:08 -0800 (PST) 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 S234383AbiLUDWH (ORCPT + 69 others); Tue, 20 Dec 2022 22:22:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiLUDWB (ORCPT ); Tue, 20 Dec 2022 22:22:01 -0500 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E83A713DCE; Tue, 20 Dec 2022 19:21:59 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 0C7761E80CAE; Wed, 21 Dec 2022 11:16:56 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gVOmohsQp0sq; Wed, 21 Dec 2022 11:16:53 +0800 (CST) Received: from localhost.localdomain.localdomain (unknown [219.141.250.2]) (Authenticated sender: xupengfei@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 32ADF1E80CA0; Wed, 21 Dec 2022 11:16:53 +0800 (CST) From: XU pengfei To: keescook@chromium.org, akpm@linux-foundation.org, brauner@kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, XU pengfei Subject: [PATCH 1/1] hfsplus: Remove unnecessary variable initialization Date: Wed, 21 Dec 2022 11:21:20 +0800 Message-Id: <20221221032119.10037-1-xupengfei@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham 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 Variables are assigned first and then used. Initialization is not required. Signed-off-by: XU pengfei --- fs/hfsplus/xattr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c index 49891b12c415..7c502df7ccac 100644 --- a/fs/hfsplus/xattr.c +++ b/fs/hfsplus/xattr.c @@ -257,7 +257,7 @@ static int hfsplus_create_attributes_file(struct super_block *sb) int __hfsplus_setxattr(struct inode *inode, const char *name, const void *value, size_t size, int flags) { - int err = 0; + int err; struct hfs_find_data cat_fd; hfsplus_cat_entry entry; u16 cat_entry_flags, cat_entry_type; @@ -494,7 +494,7 @@ ssize_t __hfsplus_getxattr(struct inode *inode, const char *name, __be32 xattr_record_type; u32 record_type; u16 record_length = 0; - ssize_t res = 0; + ssize_t res; if ((!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode)) || @@ -606,7 +606,7 @@ static inline int can_list(const char *xattr_name) static ssize_t hfsplus_listxattr_finder_info(struct dentry *dentry, char *buffer, size_t size) { - ssize_t res = 0; + ssize_t res; struct inode *inode = d_inode(dentry); struct hfs_find_data fd; u16 entry_type; @@ -674,10 +674,10 @@ static ssize_t hfsplus_listxattr_finder_info(struct dentry *dentry, ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size) { ssize_t err; - ssize_t res = 0; + ssize_t res; struct inode *inode = d_inode(dentry); struct hfs_find_data fd; - u16 key_len = 0; + u16 key_len; struct hfsplus_attr_key attr_key; char *strbuf; int xattr_name_len; @@ -766,12 +766,12 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size) static int hfsplus_removexattr(struct inode *inode, const char *name) { - int err = 0; + int err; struct hfs_find_data cat_fd; u16 flags; u16 cat_entry_type; - int is_xattr_acl_deleted = 0; - int is_all_xattrs_deleted = 0; + int is_xattr_acl_deleted; + int is_all_xattrs_deleted; if (!HFSPLUS_SB(inode->i_sb)->attr_tree) return -EOPNOTSUPP; -- 2.18.2