Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2289960rwd; Wed, 14 Jun 2023 00:15:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pykZiu/gkxXGF1ctmxQsopnbaFkcUrcPauiFoLY66++bXxoyr0gNnAu8Lr4q1CKQIayfu X-Received: by 2002:a19:920a:0:b0:4ee:dafa:cb00 with SMTP id u10-20020a19920a000000b004eedafacb00mr7142379lfd.60.1686726921975; Wed, 14 Jun 2023 00:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686726921; cv=none; d=google.com; s=arc-20160816; b=ajV8zBIp/Uiw1INWV+4OQjQam/85L2yk7Rnr5bUgzm8cSbzvpKhB5g1M+dmZQzbohH +sEWzEvfjWruK2aukD2hNMXRjCpB4PAu39QjuY2db+Sma3p/2ne/1hpsb7dNDN2JiOb/ PvyUeNmUBa7m9R8a+EO6rpVIGGytU7oyW4058/DqdT2zpfuyCjCPA4KL9I/f7VY72eFh 6CkZsf7kaGVpo3DxGu646gigkqwpa3ZrrKO08jbofU7soEpcqoFSIsgkckZ0/SpxiO98 eYJoG313OryYVxH9rB+0DngH4jouKVyDexqulfJkN9WYhTvPTxUBSGcd8Ouxkykf5sp0 WLXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=DsJ03+6JTU8gpuXgIe2VmaeioAc9uroMNEVa4/QxEDk=; b=YeJJPTOrSaGUoHhAttVZaRtdIGG6QJpVA4xzZo6bhwkFk7TiVcF1/xUYwwZ2Q5PeWT Jpgae40VnW94RiLqFne5AjbVlZXVbHuNdJ52sqSC2C48UsyFxKGy44RrlnTwQSboOS0P 2yeEahn8xpj8UIiqiKpE+6zQrxX+XAsazhIQposGEOsmXoCL/hH64uD/5uFugwHd5pmM OCbZK2zvtBocDjXb+kygw0X2bzLbweP0Ur2k2zxxGRelNB/l57FLV08fCncLnDxp2IbL QSIMf9ZBOEXMhi12LqqZK92m+D5NzHbAxgxN3sXGTpFcxfwiZOS143mheMx/XNwXl57l m2Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=nNfkiFfq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d23-20020a05640208d700b005048bfe57f1si8396539edz.28.2023.06.14.00.14.57; Wed, 14 Jun 2023 00:15:21 -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; dkim=pass header.i=@gmx.com header.s=s31663417 header.b=nNfkiFfq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235180AbjFNHKg (ORCPT + 99 others); Wed, 14 Jun 2023 03:10:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243296AbjFNHKQ (ORCPT ); Wed, 14 Jun 2023 03:10:16 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10733129; Wed, 14 Jun 2023 00:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.com; s=s31663417; t=1686726592; x=1687331392; i=quwenruo.btrfs@gmx.com; bh=83EYxqpMyqxQQV7Rs8Hav4PgEkUJaX3hMn9+1RNS0Vo=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=nNfkiFfqDS3zxa72cvl4bUkiytn7DUcY+hXoEK8zuUHS5IiFJ/PQzUB8S8/LTYoqkDeavLP g/qsJlZKnK3UYzmsvgiQ5wjU6N4GvS9AGogo6TTcskKjiFe8Z0oZwtFYsZ4oHm+M4VCknE5aA B8mcFn4qu4/vqZ0/gwMCKNEqTBOvUCF56Q/ruuypP3k9LCeCx0fy977ejfCDhoPV4eRq78vxu HMClczKLc2flJqKY1PAnpgaHW8Vfw/cieKER6oS1UFtawYZBKs6KJRqQATR5jARFrIXTpiOni Oia/3rt3w1+m0QEQpPCSQ2eyDYXx0aZMxw24y7FxmsMTNY/WbaNw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [0.0.0.0] ([149.28.201.231]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mjj87-1ph7HY3WPr-00lAf9; Wed, 14 Jun 2023 09:09:52 +0200 Message-ID: Date: Wed, 14 Jun 2023 15:09:44 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] btrfs: remove unneeded variable from unpin_extent_cache() Content-Language: en-US To: baomingtong001@208suo.com, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230614065736.22353-1-luojianhong@cdjrlc.com> From: Qu Wenruo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:OdS6CIgxPAKHwy/uAySt5xeqtgOpzZ6J87UXQyVcnvYluD1NgCo J3OHvRlW+hMBUu1igApykGuKKXrhE1zh9uNUyNZMa/zHr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+cF6WkUKYiNpcEMpJaw/c+dAl5QNc8/O7Ftq2xrwC4RSkvIu/1TxHmK/mj 245ZW3GOeTm1At7rlUkwwL4FylY= X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 2023/6/14 14:59, baomingtong001@208suo.com wrote: > fix the following coccicheck warning: > > fs/btrfs/extent_map.c:298:5-8: Unneeded variable: "ret". Return "0". > > Signed-off-by: Mingtong Bao You can take it one step further by making the function return void. Thanks, Qu > --- > =C2=A0fs/btrfs/extent_map.c | 3 +-- > =C2=A01 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c > index 0cdb3e86f29b..f3e9aaeb9956 100644 > --- a/fs/btrfs/extent_map.c > +++ b/fs/btrfs/extent_map.c > @@ -295,7 +295,6 @@ static void try_merge_map(struct extent_map_tree > *tree, struct extent_map *em) > =C2=A0int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u= 64 len, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 u64 gen) > =C2=A0{ > -=C2=A0=C2=A0=C2=A0 int ret =3D 0; > =C2=A0=C2=A0=C2=A0=C2=A0 struct extent_map *em; > =C2=A0=C2=A0=C2=A0=C2=A0 bool prealloc =3D false; > > @@ -327,7 +326,7 @@ int unpin_extent_cache(struct extent_map_tree *tree, > u64 start, u64 len, > =C2=A0=C2=A0=C2=A0=C2=A0 free_extent_map(em); > =C2=A0out: > =C2=A0=C2=A0=C2=A0=C2=A0 write_unlock(&tree->lock); > -=C2=A0=C2=A0=C2=A0 return ret; > +=C2=A0=C2=A0=C2=A0 return 0; > > =C2=A0}