Message ID | 20231103073040.649-1-jiapeng.chong@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp856016vqu; Fri, 3 Nov 2023 00:31:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFL4yeQVeE+5RcM0cSnvqk/fDAe/MLq85+xsWE4nnOcrdnEsQvS4irlLKZ7LzIEldQGQh/F X-Received: by 2002:a05:6300:8005:b0:181:1cfa:4120 with SMTP id an5-20020a056300800500b001811cfa4120mr8657615pzc.46.1698996676236; Fri, 03 Nov 2023 00:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698996676; cv=none; d=google.com; s=arc-20160816; b=1AZfjT5xq4oWvIQbdeKQd8XH8ewvFGc0RnmL61WyZAnX5edLje7uiBZpO6G61cQkD6 emj+7XJiWkQpqOujAS4gLFwW+cbra29FQPcXeUekG4IZp9imY9rW9vnOWcsBmm2aq+Z/ PExVmUTkQdD1c15sOmx6Yc9eSt4hAByPwWbmVRAVuP8X+U314b8QgiSy9WNGWYQaVN6x zix86u5p5ovKoJ0IuvxaWdGe1GIyMjHkAEHjQ2IhCIqYK/CTofDX2ltpxBK5FDJDZqvs oS5EwCfmA21JGnXJmitCYC1wy0guz4ktB7+v4nzJkfWHVNk8rkdnQLv8cwOY2XKW0hca jEhQ== 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; bh=UnFDHrca5Q9c6bLo/IjaWn9sQyANZR76PEcMGSOr7Sk=; fh=cZtyEWTgpzFVXbOOld0RkBK1pUY4vSfNQezocmSHgjY=; b=heDi6D3OofsGXJpRxF8dovZdBIHC9E5zsvcY52WIT9W6uTcD3GLon5gEOsYzsqIbyl EL6L8dxt5kPoI84LxQ5Ssd0v7aDqbIQBz+8pN29lSUTPhst3SgpGOCtjlndq0jsdavTE jwT4AeRmC5qK2lKDAyJGWkv9aY9hUHHm+YZCUSAIjF44b+UQLMaf3Z8zZXWpaYEcaxg7 8P0MJMN+jCX6ioXGugpfPcir0B0LerSgug/F42YLYedO1OBHtFBtWfLB6kZWVnSKQFzK S8AkiIpNuq2RilFTu2m/wIehsL1kTOmgYKDeXMya9Fdh0PzhQntBvyPNfMiKlQpzVnbZ qW/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bj25-20020a056a02019900b005b966a6960csi1116342pgb.786.2023.11.03.00.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 00:31:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DE7488350FE3; Fri, 3 Nov 2023 00:31:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346197AbjKCHbD (ORCPT <rfc822;lhua1029@gmail.com> + 36 others); Fri, 3 Nov 2023 03:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233204AbjKCHbB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Nov 2023 03:31:01 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2246CD4E; Fri, 3 Nov 2023 00:30:53 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VvYSqY0_1698996640; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VvYSqY0_1698996640) by smtp.aliyun-inc.com; Fri, 03 Nov 2023 15:30:49 +0800 From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> To: chandan.babu@oracle.com Cc: djwong@kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH] xfs: Remove unused function Date: Fri, 3 Nov 2023 15:30:40 +0800 Message-Id: <20231103073040.649-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 00:31:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781527138959272388 X-GMAIL-MSGID: 1781527138959272388 |
Series |
xfs: Remove unused function
|
|
Commit Message
Jiapeng Chong
Nov. 3, 2023, 7:30 a.m. UTC
The function are defined in the bitmap.c file, but not called
elsewhere, so delete the unused function.
fs/xfs/scrub/bitmap.c:55:1: warning: unused function 'xbitmap_tree_iter_next'.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7137
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
fs/xfs/scrub/bitmap.c | 4 ----
1 file changed, 4 deletions(-)
Comments
On Fri, Nov 03, 2023 at 03:30:40PM +0800, Jiapeng Chong wrote: > The function are defined in the bitmap.c file, but not called > elsewhere, so delete the unused function. > > fs/xfs/scrub/bitmap.c:55:1: warning: unused function 'xbitmap_tree_iter_next'. > > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7137 > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Makes sense. Reviewed-by: Bill O'Donnell <bodonnel@redhat.com> > --- > fs/xfs/scrub/bitmap.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/fs/xfs/scrub/bitmap.c b/fs/xfs/scrub/bitmap.c > index e0c89a9a0ca0..ba4b18e40faa 100644 > --- a/fs/xfs/scrub/bitmap.c > +++ b/fs/xfs/scrub/bitmap.c > @@ -48,10 +48,6 @@ static inline struct xbitmap_node * > xbitmap_tree_iter_first(struct rb_root_cached *root, uint64_t start, > uint64_t last); > > -static inline struct xbitmap_node * > -xbitmap_tree_iter_next(struct xbitmap_node *node, uint64_t start, > - uint64_t last); > - > INTERVAL_TREE_DEFINE(struct xbitmap_node, bn_rbnode, uint64_t, > __bn_subtree_last, START, LAST, static inline, xbitmap_tree) > > -- > 2.20.1.7.g153144c >
On Tue, Nov 07, 2023 at 01:26:46PM -0600, Bill O'Donnell wrote: > On Fri, Nov 03, 2023 at 03:30:40PM +0800, Jiapeng Chong wrote: > > The function are defined in the bitmap.c file, but not called > > elsewhere, so delete the unused function. > > > > fs/xfs/scrub/bitmap.c:55:1: warning: unused function 'xbitmap_tree_iter_next'. > > > > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7137 > > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> > > Makes sense. > Reviewed-by: Bill O'Donnell <bodonnel@redhat.com> I disagree -- I added redundant forward declarations here so I wouldn't have to go digging through the 150LOC definition of INTERVAL_TREE_DEFINE to figure out what helper functions were actually being defined by the macro. They'll trigger compiler errors if the definition of INTERVAL_TREE_DEFINE ever drifts away from my understanding of it at the time I wrote the code. --D > > > > --- > > fs/xfs/scrub/bitmap.c | 4 ---- > > 1 file changed, 4 deletions(-) > > > > diff --git a/fs/xfs/scrub/bitmap.c b/fs/xfs/scrub/bitmap.c > > index e0c89a9a0ca0..ba4b18e40faa 100644 > > --- a/fs/xfs/scrub/bitmap.c > > +++ b/fs/xfs/scrub/bitmap.c > > @@ -48,10 +48,6 @@ static inline struct xbitmap_node * > > xbitmap_tree_iter_first(struct rb_root_cached *root, uint64_t start, > > uint64_t last); > > > > -static inline struct xbitmap_node * > > -xbitmap_tree_iter_next(struct xbitmap_node *node, uint64_t start, > > - uint64_t last); > > - > > INTERVAL_TREE_DEFINE(struct xbitmap_node, bn_rbnode, uint64_t, > > __bn_subtree_last, START, LAST, static inline, xbitmap_tree) > > > > -- > > 2.20.1.7.g153144c > > >
On 11/7/23 2:44 PM, Darrick J. Wong wrote: > On Tue, Nov 07, 2023 at 01:26:46PM -0600, Bill O'Donnell wrote: >> On Fri, Nov 03, 2023 at 03:30:40PM +0800, Jiapeng Chong wrote: >>> The function are defined in the bitmap.c file, but not called >>> elsewhere, so delete the unused function. >>> >>> fs/xfs/scrub/bitmap.c:55:1: warning: unused function 'xbitmap_tree_iter_next'. >>> >>> Reported-by: Abaci Robot <abaci@linux.alibaba.com> >>> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7137 >>> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> >> >> Makes sense. >> Reviewed-by: Bill O'Donnell <bodonnel@redhat.com> > > I disagree -- I added redundant forward declarations here so I wouldn't > have to go digging through the 150LOC definition of INTERVAL_TREE_DEFINE > to figure out what helper functions were actually being defined by the > macro. They'll trigger compiler errors if the definition of > INTERVAL_TREE_DEFINE ever drifts away from my understanding of it at the > time I wrote the code. And the comment above those declarations say as much, but Jiapeng Chong seems to be getting a legitimate warning as a result, and AFAICT xbitmap_tree_iter_next really isn't used in the codebase. Maybe it's worth commenting it out or #ifdefing it, while leaving it around for reference as you intended? (I'm sympathetic to the macro-generated function hell, for sure.) -Eric > --D > >> >> >>> --- >>> fs/xfs/scrub/bitmap.c | 4 ---- >>> 1 file changed, 4 deletions(-) >>> >>> diff --git a/fs/xfs/scrub/bitmap.c b/fs/xfs/scrub/bitmap.c >>> index e0c89a9a0ca0..ba4b18e40faa 100644 >>> --- a/fs/xfs/scrub/bitmap.c >>> +++ b/fs/xfs/scrub/bitmap.c >>> @@ -48,10 +48,6 @@ static inline struct xbitmap_node * >>> xbitmap_tree_iter_first(struct rb_root_cached *root, uint64_t start, >>> uint64_t last); >>> >>> -static inline struct xbitmap_node * >>> -xbitmap_tree_iter_next(struct xbitmap_node *node, uint64_t start, >>> - uint64_t last); >>> - >>> INTERVAL_TREE_DEFINE(struct xbitmap_node, bn_rbnode, uint64_t, >>> __bn_subtree_last, START, LAST, static inline, xbitmap_tree) >>> >>> -- >>> 2.20.1.7.g153144c >>> >> >
diff --git a/fs/xfs/scrub/bitmap.c b/fs/xfs/scrub/bitmap.c index e0c89a9a0ca0..ba4b18e40faa 100644 --- a/fs/xfs/scrub/bitmap.c +++ b/fs/xfs/scrub/bitmap.c @@ -48,10 +48,6 @@ static inline struct xbitmap_node * xbitmap_tree_iter_first(struct rb_root_cached *root, uint64_t start, uint64_t last); -static inline struct xbitmap_node * -xbitmap_tree_iter_next(struct xbitmap_node *node, uint64_t start, - uint64_t last); - INTERVAL_TREE_DEFINE(struct xbitmap_node, bn_rbnode, uint64_t, __bn_subtree_last, START, LAST, static inline, xbitmap_tree)