Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2526706imm; Sun, 5 Aug 2018 06:18:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDKtXFX3AlUbdqL0PA5wiP82H22jvs1W3LwxErz3z3iRi/JzF0HRUYAj0aNRgTZpxiC5wP X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr10107875pla.285.1533475105180; Sun, 05 Aug 2018 06:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533475105; cv=none; d=google.com; s=arc-20160816; b=YjY64+t7tcSV6RkIF0wPTP0I7F7QxqsH4pnDm75Mkkm3GIcAThdAB5ojDUmIPRaUzd xn/QOo7l8TdA+vjXRARl9E6KFS1t+TMUlSbcUUTut5+vuSImzN9LZPKb/WtZjm9NASZB iw5eLA77TJQ/IyTW4oTY7BFe0oW/uSrgpMeb4l5PZv0D1261QE+ufmh8/qEeg96RtPxg KMrWvNOSixyvQeWs+lAaG4unH/Efmn6YclamXUl0KGhkAcpGPJbpY4Og8C6Bzr1B/TcY 5dlv3wTjI++QZ6TDLUm4Wpyzn8x2qJHK3+xCFhHUWNnt0ToqwQp0uRgNRTBmcxlgfZED MGQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=ImQiaFh309F4QuyFM8iNho3eZvMkvVqp4eWFJg3QA6o=; b=TkVPPEgyuScxBLLPQW8DikoDVx1mN00TmnATMgi3vFgk3iDDg84bOL1E6yF4lr29io ur88gOIlA9oXXkqZ3IEoPArgEMaWTDU3a6R5UMu9LT6S8ArUSR32pt8FU1l8a6Yj09Z+ n/KGXum0xcX/5W1HDNETAwrBJ7dYstpbJoWeME+tX1UANnmx8phcrO9Ci67Tayt5zK4T 8P7LQ7oYZ0A6HCSpX9zaF/3CoDRWtcbR2PsbaRI2PN99pehWixl48Ffzs35cvuHa0w1/ KV07mcuoOe0VIO7aaKSv3pYuQGgpfdMnMsefW0dfbS/kxA1FnJfgDyavcZzR7oEyeRrq v7Gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8-v6si7876474plh.492.2018.08.05.06.17.58; Sun, 05 Aug 2018 06:18:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbeHEPVF (ORCPT + 99 others); Sun, 5 Aug 2018 11:21:05 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:37480 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726191AbeHEPVE (ORCPT ); Sun, 5 Aug 2018 11:21:04 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A118B13BA0047; Sun, 5 Aug 2018 21:16:28 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.399.0; Sun, 5 Aug 2018 21:16:26 +0800 From: zhong jiang To: , , CC: , , , Subject: [PATCH v2] btrfs/extent_map: Remove unneeded variable "ret" Date: Sun, 5 Aug 2018 21:04:47 +0800 Message-ID: <1533474287-15049-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ret is not used after initalization, and we do not care about the return value. So make it void function. Signed-off-by: zhong jiang --- fs/btrfs/extent_map.c | 10 ++-------- fs/btrfs/extent_map.h | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 6648d55..da4e4f3 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -273,10 +273,9 @@ static void try_merge_map(struct extent_map_tree *tree, struct extent_map *em) * to the generation that actually added the file item to the inode so we know * we need to sync this extent when we call fsync(). */ -int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, +void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen) { - int ret = 0; struct extent_map *em; bool prealloc = false; @@ -308,8 +307,6 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, free_extent_map(em); out: write_unlock(&tree->lock); - return ret; - } void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em) @@ -428,16 +425,13 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree, * Removes @em from @tree. No reference counts are dropped, and no checks * are done to see if the range is in use */ -int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em) +void remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em) { - int ret = 0; - WARN_ON(test_bit(EXTENT_FLAG_PINNED, &em->flags)); rb_erase(&em->rb_node, &tree->map); if (!test_bit(EXTENT_FLAG_LOGGING, &em->flags)) list_del_init(&em->list); RB_CLEAR_NODE(&em->rb_node); - return ret; } void replace_extent_mapping(struct extent_map_tree *tree, diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index 25d985e..c80649b 100644 --- a/fs/btrfs/extent_map.h +++ b/fs/btrfs/extent_map.h @@ -78,7 +78,7 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, u64 start, u64 len); int add_extent_mapping(struct extent_map_tree *tree, struct extent_map *em, int modified); -int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em); +void remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em); void replace_extent_mapping(struct extent_map_tree *tree, struct extent_map *cur, struct extent_map *new, @@ -88,7 +88,7 @@ void replace_extent_mapping(struct extent_map_tree *tree, void free_extent_map(struct extent_map *em); int __init extent_map_init(void); void __cold extent_map_exit(void); -int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen); +void unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len, u64 gen); void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em); struct extent_map *search_extent_mapping(struct extent_map_tree *tree, u64 start, u64 len); -- 1.7.12.4