2021-04-15 08:40:57

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] block: remove unused function

Fix the following clang warning:

block/blk-zoned.c:55:24: warning: unused function 'blk_zone_start'
[-Wunused-function].

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
---
block/blk-zoned.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index c0276b42..250cb76 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -52,14 +52,6 @@ const char *blk_zone_cond_str(enum blk_zone_cond zone_cond)
}
EXPORT_SYMBOL_GPL(blk_zone_cond_str);

-static inline sector_t blk_zone_start(struct request_queue *q,
- sector_t sector)
-{
- sector_t zone_mask = blk_queue_zone_sectors(q) - 1;
-
- return sector & ~zone_mask;
-}
-
/*
* Return true if a request is a write requests that needs zone write locking.
*/
--
1.8.3.1


2021-04-15 15:39:12

by Bart Van Assche

[permalink] [raw]
Subject: Re: [PATCH] block: remove unused function

On 4/15/21 1:39 AM, Jiapeng Chong wrote:
> Fix the following clang warning:
>
> block/blk-zoned.c:55:24: warning: unused function 'blk_zone_start'
> [-Wunused-function].
>
> Reported-by: Abaci Robot <[email protected]>
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> block/blk-zoned.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index c0276b42..250cb76 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -52,14 +52,6 @@ const char *blk_zone_cond_str(enum blk_zone_cond zone_cond)
> }
> EXPORT_SYMBOL_GPL(blk_zone_cond_str);
>
> -static inline sector_t blk_zone_start(struct request_queue *q,
> - sector_t sector)
> -{
> - sector_t zone_mask = blk_queue_zone_sectors(q) - 1;
> -
> - return sector & ~zone_mask;
> -}

A similar patch is already in Jens' for-5.13/block branch. See also
commit 540ad3f3da25 ("blk-zoned: Remove the definition of
blk_zone_start()").

Bart.