Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1096704pxb; Wed, 6 Apr 2022 08:38:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsED8RHuW+RrazhpVfQqlEm/8Ui6Ai5cIoh9RbU1e2/4ZZzxteiFP1a1+Xha7N7leFcYfv X-Received: by 2002:a17:90a:f285:b0:1ca:11e4:62a2 with SMTP id fs5-20020a17090af28500b001ca11e462a2mr10622999pjb.211.1649259486777; Wed, 06 Apr 2022 08:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649259486; cv=none; d=google.com; s=arc-20160816; b=AKAuqebVSOhsaG/Z7BtYwFQ+uFqXbDpKc66ITtUfjAGK/WLbvemG7vI2kXFIGHqPf5 yMLHpGG3U46yMixWYY6b6ZtjsSlV03cKEMzRm1PIfgCQfb+b5KUkge6Qbs+12YqzFaoi /kbufhNX+CLO0bdzb2MQQpyxhbFsiZe72SdYpL32FlVfJef9cJbxf6XRIqM25TbGMtQx xLJi9nBGdy/J+eQxSOnTxeUqaUQ+5xJuY5JY/zqH6cw1BldiNnTx35EHb3D2yBmLqCid SrhwhqNogBSgjMDUWYiaI3WS35/flPpMcbW6s9j3VDQ12vQrorboopkvhuz+lzffyKbY 7Juw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=QpQISEJkMsGGUwWRkm895SJQ98zg+L5bbS31/XzrGiA=; b=nNIT4+k5s9HRNYCMB4TIvuiNgvaDsbYipjqfu3GANCc0MwMdy8t8KLy/YGznAPFnlx /HXTWN65G/PjOxtyJPjclQHUKIHo2uDDIGDnD0oF23RYkIqcWCTTwxeTdqqtwtYXTSB6 IbD9HuU2K8tOpiWUA6RF5pqXFjA5IHYsY56QNtsoO3kje5FYX2/1vfbHGKjjKjIyKZuN ukSWc2h2c/7o2YY7UGpQZffb/v5oI448Lx49utfzqhJZlcIMYYOPUi6cWNlVruz9U4fR 8lstIllgGkI0i7PWNJ2t1jepxHSZcgjgLFyqOtR9sOeEtdL5maFkAyw2kMuWd8kJ2WFF IQjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="V/6a3hS7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z24-20020a63e118000000b003816043eedbsi16692685pgh.208.2022.04.06.08.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:38:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="V/6a3hS7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C35CE2D312D; Wed, 6 Apr 2022 06:52:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233846AbiDFNxx (ORCPT + 99 others); Wed, 6 Apr 2022 09:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233702AbiDFNxk (ORCPT ); Wed, 6 Apr 2022 09:53:40 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21C14482518; Wed, 6 Apr 2022 02:04:16 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id 10so3190844qtz.11; Wed, 06 Apr 2022 02:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QpQISEJkMsGGUwWRkm895SJQ98zg+L5bbS31/XzrGiA=; b=V/6a3hS7tQXXpoy3SEUCEWutQNX53bEKd8bYeS10mTop+OOgF6uyYIIWO2Y5qiJSwA ZZzHpdNr7A/CUPLIEv3WQNOInS18DXZ5VdUQYSMCYyIkj3vK3vNw/8cPq+twLPh24NZH 381QADyI0AW/n15t5v21gGYxQrVUgGAQ/Ve1OW7byz/x78tsANCUkbyjU6oYEQKZRp26 gYetu6u+ketH/fhXx4/jQj6sVxr470FhQxOGdn3drH40eH+2/vnxYU5Z6Tg2HH2rsuZC VuvtomEGcHAaFC3hNTchBNELrvaA5Zd/fJly/1cJV/Ik8ESQeYWiMmgMAHU8bQ11b4Af GBRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QpQISEJkMsGGUwWRkm895SJQ98zg+L5bbS31/XzrGiA=; b=5rgw2WxBPgjroEDdWsiR/AITUoDajFy4xN/hKEjjHnKqonKIJyo4UbrMSlurmz7j6B 4XgEuAXJggjI5Pdh18uvrnEJfupCTk/CnLxB9MwIz9jrz12yNjQ2i2ZAnLtfSd8SQD+i wnj74tS+lfkF5hHB/xAAByA2dcyHGYjzvONjrp74TU46uPYK/1WHtniLqTPEcZSdlNP1 t6eWcLJC7YGIzaU2QG/bKRXD3Yn/cOz5QdpNIVbk4iAdyE41FOeCWfoq30RNwZl//zNX 2Yih1jUeWpRldUEIICAMok+EvJ9bLxxN9ncYOGhfddTCwTSDNAMY1BKR7O1H85+XN2et a3rg== X-Gm-Message-State: AOAM530K44oyV3GO8OgL/70wP7p2Jq4ZDM2rxSRAHD5OHGhSpmPzqsxd ePRll/258GsSmao3kdWUPv8x1t0kGfU= X-Received: by 2002:a05:620a:16b7:b0:67d:3abc:e4d2 with SMTP id s23-20020a05620a16b700b0067d3abce4d2mr4733235qkj.702.1649235851020; Wed, 06 Apr 2022 02:04:11 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id s21-20020a05620a16b500b0067b1205878esm9161645qkj.7.2022.04.06.02.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 02:04:10 -0700 (PDT) From: cgel.zte@gmail.com X-Google-Original-From: lv.ruyi@zte.com.cn To: clm@fb.com, josef@toxicpanda.com Cc: dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Lv Ruyi , Zeal Robot Subject: [PATCH] Btrfs: remove redundant judgment Date: Wed, 6 Apr 2022 09:04:04 +0000 Message-Id: <20220406090404.2488787-1-lv.ruyi@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Lv Ruyi iput() has already handled null and non-null parameter. so there is no need to use if(). Reported-by: Zeal Robot Signed-off-by: Lv Ruyi --- fs/btrfs/tree-log.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 273998153fcc..c46696896f03 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -894,8 +894,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, btrfs_update_inode_bytes(BTRFS_I(inode), nbytes, drop_args.bytes_found); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); out: - if (inode) - iput(inode); + iput(inode); return ret; } -- 2.25.1