From patchwork Fri Aug 20 02:32:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CGEL X-Patchwork-Id: 12448261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 891E1C4338F for ; Fri, 20 Aug 2021 02:32:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CA3960EE4 for ; Fri, 20 Aug 2021 02:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237552AbhHTCdP (ORCPT ); Thu, 19 Aug 2021 22:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237269AbhHTCdO (ORCPT ); Thu, 19 Aug 2021 22:33:14 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4813C061575; Thu, 19 Aug 2021 19:32:37 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id jv8so4789866qvb.3; Thu, 19 Aug 2021 19:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=45Ie1z4VxtL1rF2JDkZOWOkx7F6LyrXzIAa5uB+jCfc=; b=Glmp0TXEWhNQ1phOM+WfBxzO9W4/akCWOXzUD0S5Kyh0YY4HdTMmXtfSFDZ2g9wNeF Q3lgWPsxH1XIct9TQO6jw7NIl3Y+G1cEuG3dMQ0rDWA1R1ETnk7D/sxvkA/7NletOKNy FbLA4q8fgKKJg8LMw8CHmb6AIHxX52Ova9OcoOYjX5hO/+53UtrMIiPieq2EcUGt5DWD oa5yUTYsNfWlrQ/GAFHtiouvhpYQN1qkboCAiRhL5elAEQKXEaU814XQZ2hVqGlR28d5 1ehkqPkiqjDtn18vBBlFMkY7jbGlL3jqLpLwL7UfIXHaxigkH3d41oefXOno0OOjCkLF XNqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=45Ie1z4VxtL1rF2JDkZOWOkx7F6LyrXzIAa5uB+jCfc=; b=Wxgq2s6ipgtZB6W+viX1xBlZzcj+OSYEJUlEMQGN6uh0EWjsOn4efrY6USbuWLUUC/ ItSOzWe4p6mNDLjpMMay8gwXXbGlSwxk5bCiGrm7OgwN+/CyA9lz0KFNMExbHOgIJmtE 72jROQpfRjoLVL5cVVrp78H4/pGgeNTLX++lKSGXRz7Xv4OIlGOi2DD9gc2Dn2SXPgrC IMi5+2jwipO2k6N9GPv+ubFFOWXRcrdWXa3yqMrpa1q7WeKPE0NBe5UWU8GT44HCkLWJ tJK0bjBo2/TI40w1zI3w+4yTIrYAcq25EhjO9Kmg45t9kIgW+cxxDRlPjkun0/Ya/ILc ngUA== X-Gm-Message-State: AOAM533Det2T8ZNT1ODWsihkzkgatVYsOEwQdqdThL9Pymu0zAMgnIj+ U06payaN+WCE784174rfbdw= X-Google-Smtp-Source: ABdhPJw1h1V3KuvLC9h+hn3rnYHag6Ai3spYchHZBRWK6YQUbDAQSoPXZxzkUv9jOV85/0TA9nS4ow== X-Received: by 2002:a0c:d801:: with SMTP id h1mr17750376qvj.60.1629426757218; Thu, 19 Aug 2021 19:32:37 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id bk3sm2256977qkb.103.2021.08.19.19.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 19:32:36 -0700 (PDT) From: jing yangyang X-Google-Original-From: jing yangyang To: Chris Mason Cc: Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, jing yangyang , Zeal Robot Subject: [PATCH linux-next] fs: btrfs: fix returnvar.cocci warnings Date: Thu, 19 Aug 2021 19:32:29 -0700 Message-Id: <20210820023229.11369-1-jing.yangyang@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Remove unneeded variables when "0" can be returned. Generated by: scripts/coccinelle/misc/returnvar.cocci Reported-by: Zeal Robot Signed-off-by: jing yangyang --- fs/btrfs/extent_map.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 4a8e02f..58860d7 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -296,7 +296,6 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em) int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen) { - int ret = 0; struct extent_map *em; bool prealloc = false; @@ -328,7 +327,7 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, free_extent_map(em); out: write_unlock(&tree->lock); - return ret; + return 0; }