From nobody Thu Apr 2 19:55:00 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EF69C6FA82 for ; Wed, 21 Sep 2022 03:48:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbiIUDsX (ORCPT ); Tue, 20 Sep 2022 23:48:23 -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-Google-Smtp-Source: AMsMyM6iAQlVotRUQUZQaswiJv6u3+w5s3DtVcydPlyR1T/6pUjy+073DQrTO740x4ig+LDmxUD2yg== 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D nilfs_btree_node_get_key(node, nchildren - 1); nextmaxkey =3D (nchildren > 1) ? nilfs_btree_node_get_key(node, nchildren - 2) : 0; - if (bh !=3D NULL) - brelse(bh); + brelse(bh); =20 return (maxkey =3D=3D key) && (nextmaxkey < NILFS_BMAP_LARGE_LOW); } @@ -1717,8 +1716,7 @@ static int nilfs_btree_gather_data(struct nilfs_bmap = *btree, ptrs[i] =3D le64_to_cpu(dptrs[i]); } =20 - if (bh !=3D NULL) - brelse(bh); + brelse(bh); =20 return nitems; } --=20 2.34.1 From nobody Thu Apr 2 19:55:00 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FBBCC6FA82 for ; Wed, 21 Sep 2022 03:48:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbiIUDs0 (ORCPT ); Tue, 20 Sep 2022 23:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbiIUDsN (ORCPT ); Tue, 20 Sep 2022 23:48:13 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C7C17C310; Tue, 20 Sep 2022 20:48:12 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id b21so4381163plz.7; Tue, 20 Sep 2022 20:48:12 -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=X35vTpMjT4JUzdTpTOGe0YDg/vRzJ/72gtqZZF6EwZw=; b=TIchTrk6LcgzDDQ8AFqJ4xvF0DQy/GH1PrTcZsl47HPjIW4N9bAhmZr0cKJSQP0mIe dcTPofMbsqgq+n23YaQjaNdyGt01wOU08IYY877KynrlWkBD3WO/dAsRdKNUjKbrk91t LJsSBb0hxLB16WK8K1jYGJ8jJKbi4gDSaYTCNHG/wUe08Zll//maFZxZm6S4TF+gUm5R dpDlOVt5JRDxyfvV+wvgMrm8DPVENKMZyJAJpnNgC+Fisz2bYebzUG9AwVRKlOkRex6B 0qSSV7ZyImEP9PdIWV6W5zVk7P/2XdVwgwdyojTKLRxu/dllobkB98ZbUiYU4TVb9Ur3 fKSg== 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=X35vTpMjT4JUzdTpTOGe0YDg/vRzJ/72gtqZZF6EwZw=; b=qlM/G9uKrsRnVQ2Wt2P6lamNvZrmV9K+mwMh9X9KbwQ9l3gpZppwReuX7F9TbFZuzA 8RRDFP4GWU2mU/TeBkgpiu8FytXhXjhheMYaWiR8SQErbNJ4susB+ADLGsSu/V9Kpps5 cSyVR39cYkvBoS/efH2jvctePKS25Fzz5JuUcx1co4mEsAa9Ip873gqo5Lo6ORycXAqM R5A2jBji+rt8Yi5tZ1gl81tYvm8Y8oej/XEo7L0LEcMN5hIO9yaMU8vfzfz5zXLeCULN D3tAUx86pTUl32lOiCp6xCSO+RO0x0aFbiv4G7Iis+Rqxj4wKtsJTihMfgBGH/QxcLBh 3yww== X-Gm-Message-State: ACrzQf2VA2QjEwE+3O0qbcyLmH2fKLAD1HSxnVPwAToRt99azsDOp0D1 xGq0J5QW11zcjuGFnjxfghKmWibfO8U= X-Google-Smtp-Source: AMsMyM6K9GqwvGT3+gDXIsQ7nZ2fMPOgroJtzYUUSxVGQV0M16/FcTofgYq3YjzGANtm73SGGuss3w== X-Received: by 2002:a17:902:c94f:b0:178:4423:af05 with SMTP id i15-20020a170902c94f00b001784423af05mr2827126pla.147.1663732091867; Tue, 20 Sep 2022 20:48:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 20:48:11 -0700 (PDT) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs , LKML Subject: [PATCH 2/2] nilfs2: Remove the unneeded result variable Date: Wed, 21 Sep 2022 12:48:03 +0900 Message-Id: <20220921034803.2476-3-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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: ye xingchen Return the value nilfs_segctor_sync() directly instead of storing it in another redundant variable. Link: https://lkml.kernel.org/r/20220831033403.302184-1-ye.xingchen@zte.com= .cn Reported-by: Zeal Robot Signed-off-by: ye xingchen Signed-off-by: Ryusuke Konishi --- fs/nilfs2/segment.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 0afe0832c754..9abae2c9120e 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -2235,7 +2235,6 @@ int nilfs_construct_segment(struct super_block *sb) struct the_nilfs *nilfs =3D sb->s_fs_info; struct nilfs_sc_info *sci =3D nilfs->ns_writer; struct nilfs_transaction_info *ti; - int err; =20 if (!sci) return -EROFS; @@ -2243,8 +2242,7 @@ int nilfs_construct_segment(struct super_block *sb) /* A call inside transactions causes a deadlock. */ BUG_ON((ti =3D current->journal_info) && ti->ti_magic =3D=3D NILFS_TI_MAG= IC); =20 - err =3D nilfs_segctor_sync(sci); - return err; + return nilfs_segctor_sync(sci); } =20 /** --=20 2.34.1