xfs: Remove unused function
PATCH 1/1 xfs: Remove unused function
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'.
--- fs/xfs/scrub/bitmap.c | 4 ---- 1 file changed, 4 deletions(-)
fs/xfs/scrub/bitmap.c +0 -4
@@ -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)
Signature · 1 line
2.20.1.7.g153144c
Quoted 8 lines · Jiapeng Chong
The function are defined in the
bitmap.cfile, 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 <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>
Makes sense.
Quoted 22 lines
--- fs/xfs/scrub/bitmap.c | 4 ---- 1 file changed, 4 deletions(-)fs/xfs/scrub/bitmap.c +0
-4@@ -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)Signature · 1 line
2.20.1.7.g153144c
Quoted 4 lines · Bill O'Donnell
Quoted 3 lines · Jiapeng Chong
The function are defined in the
bitmap.cfile, but not called elsewhere, so delete the unused function.
Quoted 8 lines
Quoted 5 lines
fs/xfs/scrub/bitmap.c:55:1: warning: unused function 'xbitmap_tree_iter_next'.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>Makes sense.
Reviewed-by Bill O'Donnell <[email protected]>
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
Quoted 25 lines
Quoted 24 lines
--- fs/xfs/scrub/bitmap.c | 4 ---- 1 file changed, 4 deletions(-)fs/xfs/scrub/bitmap.c +0
-4@@ -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)Signature · 1 line
2.20.1.7.g153144c
Quoted 14 lines · Darrick J. Wong
Quoted 4 lines · Bill O'Donnell
Quoted 3 lines · Jiapeng Chong
The function are defined in the
bitmap.cfile, but not called elsewhere, so delete the unused function.Quoted 8 lines
Quoted 5 lines
fs/xfs/scrub/bitmap.c:55:1: warning: unused function 'xbitmap_tree_iter_next'.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>Makes sense.
Reviewed-by Bill O'Donnell <[email protected]>
Quoted 6 lines
I disagree -- I added redundant forward declarations here so I wouldn't have to go digging through the 150LOC definition of
INTERVAL_TREE_DEFINEto figure out what helper functions were actually being defined by the macro. They'll trigger compiler errors if the definition ofINTERVAL_TREE_DEFINEever 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
Quoted 28 lines
--D
Quoted 25 lines
Quoted 24 lines
--- fs/xfs/scrub/bitmap.c | 4 ---- 1 file changed, 4 deletions(-)fs/xfs/scrub/bitmap.c +0
-4@@ -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)Signature · 1 line
2.20.1.7.g153144c