Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2224729rwl; Sun, 26 Mar 2023 18:45:11 -0700 (PDT) X-Google-Smtp-Source: AKy350bHeubBH1DbXoyz1R3XbNPeMKnl0JIwhGXtsfnYV6QEF7fNr1uljgS0meDiU1VW/zqWzegG X-Received: by 2002:a17:906:b0d4:b0:932:e141:29be with SMTP id bk20-20020a170906b0d400b00932e14129bemr9179286ejb.75.1679881510792; Sun, 26 Mar 2023 18:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679881510; cv=none; d=google.com; s=arc-20160816; b=cJn1T7fAFX5a3teEjJI5c1zesQ/YMZfGlooVeQmBuay6ucDnx7s3e/4+3f17Q+jEsb NCJzsIqm4HTGpAbMaRJIfy9JswN4FBNWAHnZboPL9At3sJAnHclBDTas13mqmfZj+OVl mPwg6V2gjzwyALX33Cf/dY5ubnNCrjPS0XNjEaO8d/eFv+PKA2eVvihMayxChEklWqrt l6OoW3gn8SL3XE6pQc9+BYM6GUg84p4wcy+e3/DrWb7D3cq+GvB8PXNcgtKSVm6gGP53 giSak9AUDeJKFOmLL0i0vMquBLfyoXdA0zYbFwaQaVbfuckEZaEeerLbmkZ0tEkj1KHF ADRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=y7wfznm2KxPaDOUZeHQ8ecmwG+vFRvRUmCpu2GVCo+M=; b=xqyHUkjSzb1EyyYmKJVDyIvys/4i/mdKdT/myJTyL34pgCXr2sdKGMOv54vH/0o/MD vv5M34DAh/Ofj8weT/515v/fElySosa1KtketrYWUXkB5Oo2SLtmeFV3I/XF/e+nwUJw cSwkCeSkSo49zeoSIde+wsZIwaPOnFz1JS9YbJdoDm9uRlIx5d3NBEm8W0lCzHrHpn4M XpoFa06HSGWHT/yhH2wGAhsvwdU8TCnaSKqdjqfSQfwtp8wuMiNqKtF1WcSTDMFwUTOO Z61BEWxYqe3lgsSPMvrFVvgkvk4JDkeGNa+AZGKbSsOQiPRJZgybOWt4juN7YGOYZAa5 cDfg== 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 lc17-20020a170906f91100b009314e27809esi28542059ejb.116.2023.03.26.18.44.47; Sun, 26 Mar 2023 18:45:10 -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 S231671AbjC0BhM (ORCPT + 99 others); Sun, 26 Mar 2023 21:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbjC0BhL (ORCPT ); Sun, 26 Mar 2023 21:37:11 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ACBB4696; Sun, 26 Mar 2023 18:37:09 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4PlFmK04KHz4f3jMd; Mon, 27 Mar 2023 09:37:05 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP3 (Coremail) with SMTP id _Ch0CgCnUyFB8yBkwDiEFg--.45250S3; Mon, 27 Mar 2023 09:37:06 +0800 (CST) Subject: Re: [PATCH] md/raid5: remove unused working_disks variable To: Tom Rix , song@kernel.org, nathan@kernel.org, ndesaulniers@google.com Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, "yukuai (C)" References: <20230326125637.1352895-1-trix@redhat.com> From: Yu Kuai Message-ID: Date: Mon, 27 Mar 2023 09:37:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20230326125637.1352895-1-trix@redhat.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: _Ch0CgCnUyFB8yBkwDiEFg--.45250S3 X-Coremail-Antispam: 1UD129KBjvJXoW7Zw4rWF1fWF4DuF4UCrWxZwb_yoW8Jw4fpa 10v3W5ur4UXFW5Ka9rA3y7CFyFqanFy3y8GF9xu3WfXay5XrWDKw4rXry5WryDJFWSy3ya vF1UKr4DGw1fKrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUyEb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x 0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG 6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFV Cjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxk0xIA0c2IEe2xFo4CEbIxvr21l42xK82IYc2Ij 64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x 8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE 2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42 xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIE c7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU1zuWJUUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.0 required=5.0 tests=NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 Hi, ?? 2023/03/26 20:56, Tom Rix ะด??: > clang with W=1 reports > drivers/md/raid5.c:7719:6: error: variable 'working_disks' > set but not used [-Werror,-Wunused-but-set-variable] > int working_disks = 0; > ^ > This variable is not used so remove it. Other than some nits below, this patch looks good to me, feel free to add: Reviewed-by: Yu Kuai Please also mention that commit 908f4fbd2657 ("md/raid5: be more thorough in calculating 'degraded' value.") remove the last reference. > > Signed-off-by: Tom Rix > --- > drivers/md/raid5.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c > index 7b820b81d8c2..2b1e78c46817 100644 > --- a/drivers/md/raid5.c > +++ b/drivers/md/raid5.c > @@ -7716,7 +7716,6 @@ static void raid5_set_io_opt(struct r5conf *conf) > static int raid5_run(struct mddev *mddev) > { > struct r5conf *conf; > - int working_disks = 0; > int dirty_parity_disks = 0; > struct md_rdev *rdev; > struct md_rdev *journal_dev = NULL; > @@ -7913,7 +7912,6 @@ static int raid5_run(struct mddev *mddev) > goto abort; > } > if (test_bit(In_sync, &rdev->flags)) { > - working_disks++; Please remove the braces as well, Thanks, Kuai > continue; > } > /* This disc is not fully in-sync. However if it >