* [PATCH] xfs: Remove unused function
@ 2023-11-03 7:30 Jiapeng Chong
2023-11-07 19:26 ` Bill O'Donnell
0 siblings, 1 reply; 4+ messages in thread
From: Jiapeng Chong @ 2023-11-03 7:30 UTC (permalink / raw)
To: chandan.babu; +Cc: djwong, linux-xfs, linux-kernel, Jiapeng Chong, Abaci Robot
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(-)
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: Remove unused function
2023-11-03 7:30 [PATCH] xfs: Remove unused function Jiapeng Chong
@ 2023-11-07 19:26 ` Bill O'Donnell
2023-11-07 20:44 ` Darrick J. Wong
0 siblings, 1 reply; 4+ messages in thread
From: Bill O'Donnell @ 2023-11-07 19:26 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: chandan.babu, djwong, linux-xfs, linux-kernel, Abaci Robot
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: Remove unused function
2023-11-07 19:26 ` Bill O'Donnell
@ 2023-11-07 20:44 ` Darrick J. Wong
2023-11-11 15:39 ` Eric Sandeen
0 siblings, 1 reply; 4+ messages in thread
From: Darrick J. Wong @ 2023-11-07 20:44 UTC (permalink / raw)
To: Jiapeng Chong
Cc: Bill O'Donnell, chandan.babu, linux-xfs, linux-kernel,
Abaci Robot
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
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] xfs: Remove unused function
2023-11-07 20:44 ` Darrick J. Wong
@ 2023-11-11 15:39 ` Eric Sandeen
0 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2023-11-11 15:39 UTC (permalink / raw)
To: Darrick J. Wong, Jiapeng Chong
Cc: Bill O'Donnell, chandan.babu, linux-xfs, linux-kernel,
Abaci Robot
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
>>>
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-11 15:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-03 7:30 [PATCH] xfs: Remove unused function Jiapeng Chong
2023-11-07 19:26 ` Bill O'Donnell
2023-11-07 20:44 ` Darrick J. Wong
2023-11-11 15:39 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox