From patchwork Thu Jan 19 05:57:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 45601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp165662wrn; Wed, 18 Jan 2023 22:08:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtXILxHRcjqbvb/EAOHjQ1EgT+4CwIdAvIlFmQ51TQrXFn08xFromHzsIAUdzqyikPme2Vk X-Received: by 2002:aa7:dccd:0:b0:49e:1d4f:a9dd with SMTP id w13-20020aa7dccd000000b0049e1d4fa9ddmr10029593edu.39.1674108503323; Wed, 18 Jan 2023 22:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674108503; cv=none; d=google.com; s=arc-20160816; b=HLVWsaqbf61J0uhGAkAb6Iwp872K2xbYiU7PAMMWYTIlrdyrDR239DpCU4nU6+wWNY pf26mXMQBqZD7Epm7QZccu7m7SFdjkJXanbNoGJyX+TJZWquErE/OiZMt3SLD8EoEzVs Uw/RcOTYmaLskYm5Qd7cs3rDb4YZ1wEU18tn6KHjsfp/ixDdvJz8aliajWVV3w+MqLp6 tAWzFmRV1KheaN128FmcnM3F1mv3wB8sNWSTeEwqISKqfEboqX7yZlAk19g0lXKGt0rQ gARGjcoTafY8cJhzwlg3Q/BCOmGC6qB5vp1Vm9XgXbB5Vc5G5nzWmLTNNttcdYOkBD/w a6Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=poFPb+fMSmiwQtgPmMiRnX9fRewJdu0w/ehhodtzDmo=; b=HyNJZwwDFaEQ+lTXoKOnpJRmLYskSKNbxl8/bvlE5utRTedQwfDB6CSKhPEfxKQUVp ZTYyTYZe+9bzzpTwgZ+6R1a2EoS4zTB92vwC+vrjtdh5aaw0BoPMm0igwE4fAewqfej2 NrY/WXyBTW6Vc+op5tCna020HxWwreTD/fpemfDxX6b2ugcfdRTE2E6tBl37EEOdmEbQ uZDEAMsH7QQHkaWG4A2VPNgTesHNWsOvRvH0Hx2w8GLBXPI8qUIaWHUFSf98pLs3emSP DqCRBTI1nW7VysZg2/PwNysMlTNcsi84AojGMg5wkH2n4YcM4XxmOYeO7l8KGuoZTBBu MNIA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a05640242c900b0048ee2e45defsi50042351edc.288.2023.01.18.22.07.58; Wed, 18 Jan 2023 22:08:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjASF5X (ORCPT + 99 others); Thu, 19 Jan 2023 00:57:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbjASF5U (ORCPT ); Thu, 19 Jan 2023 00:57:20 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0558010B; Wed, 18 Jan 2023 21:57:18 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NyBjS4srnz4xVnD; Thu, 19 Jan 2023 13:57:16 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 30J5vBpv048128; Thu, 19 Jan 2023 13:57:11 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 19 Jan 2023 13:57:13 +0800 (CST) Date: Thu, 19 Jan 2023 13:57:13 +0800 (CST) X-Zmail-TransId: 2af963c8dbb9ffffffffd31ce984 X-Mailer: Zmail v1.0 Message-ID: <202301191357131455025@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , Subject: =?utf-8?q?=5BPATCH=5D_btrfs=3A_scrub=3A_Remove_compilation_errors_w?= =?utf-8?q?hen=C2=A0-Werror=3Dmaybe-uninitialized?= X-MAIL: mse-fl1.zte.com.cn 30J5vBpv048128 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 63C8DBBC.000 by FangMail milter! X-FangMail-Envelope: 1674107836/4NyBjS4srnz4xVnD/63C8DBBC.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C8DBBC.000/4NyBjS4srnz4xVnD X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SPF_PERMERROR,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755429998156596234?= X-GMAIL-MSGID: =?utf-8?q?1755429998156596234?= From: ye xingchen fs/btrfs/scrub.c: In function 'scrub_raid56_data_stripe_for_parity.isa.0': fs/btrfs/scrub.c:3297:9 error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] fs/btrfs/scrub.c: In function 'scrub_simple_mirror': fs/btrfs/scrub.c:3530:9 error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] Initialize 'ret' to aviod compilation errors. Signed-off-by: ye xingchen --- fs/btrfs/scrub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index a5d026041be4..d0ddf930cb79 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -3198,7 +3198,7 @@ static int scrub_raid56_data_stripe_for_parity(struct scrub_ctx *sctx, struct btrfs_root *extent_root = btrfs_extent_root(fs_info, logical); struct btrfs_root *csum_root = btrfs_csum_root(fs_info, logical); u64 cur_logical = logical; - int ret; + int ret = 0; ASSERT(map->type & BTRFS_BLOCK_GROUP_RAID56_MASK); @@ -3424,7 +3424,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx, const u32 max_length = SZ_64K; struct btrfs_path path = { 0 }; u64 cur_logical = logical_start; - int ret; + int ret = 0; /* The range must be inside the bg */ ASSERT(logical_start >= bg->start && logical_end <= bg->start + bg->length);