[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <90507369-7beb-5337-5bb3-f5e2798dee2f@linux.alibaba.com>
Date: Sat, 18 Sep 2021 10:23:47 +0800
From: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
To: Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block/mq-deadline: Fix unused-function compilation
warning
ping.
On 9/1/21 2:47 PM, Tianjia Zhang wrote:
> If CONFIG_BLK_DEBUG_FS is not defined, the following compilation warning
> will be reported:
>
> block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function]
> static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
>
> Move the function dd_queued() to the scope of this config and mark it
> inline.
>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
> ---
> block/mq-deadline.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> index 3c3693c34f06..084314ee878d 100644
> --- a/block/mq-deadline.c
> +++ b/block/mq-deadline.c
> @@ -270,12 +270,6 @@ deadline_move_request(struct deadline_data *dd, struct dd_per_prio *per_prio,
> deadline_remove_request(rq->q, per_prio, rq);
> }
>
> -/* Number of requests queued for a given priority level. */
> -static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
> -{
> - return dd_sum(dd, inserted, prio) - dd_sum(dd, completed, prio);
> -}
> -
> /*
> * deadline_check_fifo returns 0 if there are no expired requests on the fifo,
> * 1 otherwise. Requires !list_empty(&dd->fifo_list[data_dir])
> @@ -953,6 +947,12 @@ static int dd_async_depth_show(void *data, struct seq_file *m)
> return 0;
> }
>
> +/* Number of requests queued for a given priority level. */
> +static inline u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
> +{
> + return dd_sum(dd, inserted, prio) - dd_sum(dd, completed, prio);
> +}
> +
> static int dd_queued_show(void *data, struct seq_file *m)
> {
> struct request_queue *q = data;
>
Powered by blists - more mailing lists