Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4777255rwb; Tue, 20 Sep 2022 20:50:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UY5vRv013RU6q3SQcgCIVCCmWYbADrZzGS/4ZwbCkoj3Ea27afUW9isqP1Qlti+mRVBya X-Received: by 2002:a62:e80c:0:b0:54a:817b:a6ac with SMTP id c12-20020a62e80c000000b0054a817ba6acmr26414326pfi.59.1663732229537; Tue, 20 Sep 2022 20:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663732229; cv=none; d=google.com; s=arc-20160816; b=Flp3ghdZ7C9pzk8r7PvGJcJ3Z7r35Gv86Pt3qFTzBJkTi3XyU5TcS0nZr6S9ModrTZ PNStazys4ZnjmxmrXZpJUyfBqpIYXb+wbK+iNu3p+YS98CB5Axrdi2R7rf07Am9zyXPP 2RrE6T2SGDK404se8RrRtwLBmrOELWJIE1P62elukW+lC9H+cT7Df9w/SOX0xg2OUy8j HQ2ekAbEmD4dKtPihB0HQ270m3R3IHQVPbcDnJATPsGNuapvtlWVuqzAeu2Y2lPTcjss 53EilJ5oLxO3TQLAFCPX7i0Sf5mikhvIT5YerVWjsKf7hR2uAAoVfXhRCRefte56jA9e W6KA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zuUTrKEQfr4sTAkgNNcxkQQm8I/DlTKY/sYvpN04CR0=; b=ThnIkJcDIuNt8NPHHRAM37m0ySmTK1ebDRoGRtnAT8V70UDvTNG+iisdGz5xMCAOPk ZAGqvvJ+2/VG0bvsBx7pPcjfS8IQvWx6AhnDziTY9CJwx9DQpYw0A+M2w0nEM9ISzB1I az7z6St8Lma+C4L06cWXzFaGxrJyrWe+z18Wj/qGW0EkPdCLlIZn7oFsObubdUfsEzBX a7QEUvGr76S7F02xHIKi3eJL05QtO1E2xtmluLQH9Aq93tCogAIuZuXp7iGJoNTLu6d5 KqNZV7jmxr237Zhqlbbi79VWbyszCDVHGt7eePKR/R3Zo57xTu0UEJAWqBhP8Syj3VpE RTyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UQ0NYQxy; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r199-20020a632bd0000000b0043885b1592bsi1496189pgr.735.2022.09.20.20.50.18; Tue, 20 Sep 2022 20:50:29 -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=@gmail.com header.s=20210112 header.b=UQ0NYQxy; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230204AbiIUDsT (ORCPT + 99 others); Tue, 20 Sep 2022 23:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbiIUDsL (ORCPT ); Tue, 20 Sep 2022 23:48:11 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 686187C30B; Tue, 20 Sep 2022 20:48:10 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id x1so4394178plv.5; Tue, 20 Sep 2022 20:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=zuUTrKEQfr4sTAkgNNcxkQQm8I/DlTKY/sYvpN04CR0=; b=UQ0NYQxyERDLPcyJTHUVOAlubjXits94UXZaEE8wQN5td+CsnsaZPwiMBon6QtK4YI lmpzLrH2r3Xg6zlv36JgVKynEauD/hPI8QWUwSLVpQ5CXDaBF9pHK2Beqat0ZPYKLPCx 2l09Fcrr3//pD6/aV6YFZ7Qad5NT5XfGnSQntyYOV//0qNGbvSEI2Ds54km2Abrc07pX VkisyPGoXZHLRWNaripFL1ZMNVDAzjJVnqvsSCgdADYfau4TySmIkX1O1LRx73WNXNrC w6UWGb4Ri4u8xJQUMSbd/EnQO85UBjyhFgaGDy+TLPrrBtPKmvh3K34AH8oKZMqtQWiR 9b1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=zuUTrKEQfr4sTAkgNNcxkQQm8I/DlTKY/sYvpN04CR0=; b=qC8Lnta2skrMeFa0xhLpIrxVQ8OvJPGDlIeygcyvfcr9+Pbdy4MZXrv8eugGVXeRkh c8bdLLYZlP9PbSxXk7EoJyD/IhD59XyBrXzxTlVDqvGmWHEpeok/3cVR+N+IwkSPLT3J 6KFTnJQC+/cQxxTS6eclcbK4CDD3FiQ8bx2ANB/JUcUcy2VWTAMoZZQ2+SpsjYqLPx6J I93HWtv4Ib07WHLLOe25cX4G0U3meV62ozDLfecMOmE+djS/wpjyddNFb+nl5BrlQv2P Gjkd79KvSeSiF6Bh3nYM/pMZ9OGJ93Ge/mwp9xequReYg7/bGTTMgOmLnBBqy5T5+zt4 FuOw== X-Gm-Message-State: ACrzQf3aoCFDngOHKy3eH52BVvlDaL0FICoHcS9RuNaRriiQGQo82Rrn u9dms9UridBa7sKoQUDseHbFcRlQ+lk= X-Received: by 2002:a17:902:d482:b0:178:1585:40b6 with SMTP id c2-20020a170902d48200b00178158540b6mr2842044plg.134.1663732089814; Tue, 20 Sep 2022 20:48:09 -0700 (PDT) Received: from carrot.. (i118-19-12-172.s42.a014.ap.plala.or.jp. [118.19.12.172]) by smtp.gmail.com with ESMTPSA id n10-20020a170902e54a00b00176ca74c58bsm686016plf.245.2022.09.20.20.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 20:48:08 -0700 (PDT) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs , LKML Subject: [PATCH 1/2] nilfs2: delete unnecessary checks before brelse() Date: Wed, 21 Sep 2022 12:48:02 +0900 Message-Id: <20220921034803.2476-2-konishi.ryusuke@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220921034803.2476-1-konishi.ryusuke@gmail.com> References: <20220921034803.2476-1-konishi.ryusuke@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 From: Minghao Chi The brelse() inline function tests whether its argument is NULL and then returns immediately. Thus remove the tests which are not needed around the shown calls. Link: https://lkml.kernel.org/r/20220819081700.96279-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Ryusuke Konishi --- fs/nilfs2/btree.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c index 9f4d9432d38a..b9d15c3df3cc 100644 --- a/fs/nilfs2/btree.c +++ b/fs/nilfs2/btree.c @@ -1668,8 +1668,7 @@ static int nilfs_btree_check_delete(struct nilfs_bmap *btree, __u64 key) maxkey = nilfs_btree_node_get_key(node, nchildren - 1); nextmaxkey = (nchildren > 1) ? nilfs_btree_node_get_key(node, nchildren - 2) : 0; - if (bh != NULL) - brelse(bh); + brelse(bh); return (maxkey == key) && (nextmaxkey < NILFS_BMAP_LARGE_LOW); } @@ -1717,8 +1716,7 @@ static int nilfs_btree_gather_data(struct nilfs_bmap *btree, ptrs[i] = le64_to_cpu(dptrs[i]); } - if (bh != NULL) - brelse(bh); + brelse(bh); return nitems; } -- 2.34.1