linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/mq-deadline: Fix unused-function compilation warning
@ 2021-09-01  6:47 Tianjia Zhang
  2021-09-18  2:23 ` Tianjia Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Tianjia Zhang @ 2021-09-01  6:47 UTC (permalink / raw)
  To: Jens Axboe, linux-block, linux-kernel; +Cc: Tianjia Zhang

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@linux.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;
-- 
2.19.1.3.ge56e4f7


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] block/mq-deadline: Fix unused-function compilation warning
  2021-09-01  6:47 [PATCH] block/mq-deadline: Fix unused-function compilation warning Tianjia Zhang
@ 2021-09-18  2:23 ` Tianjia Zhang
  2021-09-18 22:22   ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: Tianjia Zhang @ 2021-09-18  2:23 UTC (permalink / raw)
  To: Jens Axboe, linux-block, linux-kernel

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@linux.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;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block/mq-deadline: Fix unused-function compilation warning
  2021-09-18  2:23 ` Tianjia Zhang
@ 2021-09-18 22:22   ` Bart Van Assche
  2021-09-22  2:18     ` Tianjia Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2021-09-18 22:22 UTC (permalink / raw)
  To: Tianjia Zhang, Jens Axboe, linux-block, linux-kernel

On 9/17/21 19:23, Tianjia Zhang wrote:
> ping.

Please check Linus' master branch and Jens' for-next branch before posting
block layer patches. This patch looks like a duplicate of patch
https://lore.kernel.org/r/20210830091128.1854266-1-geert@linux-m68k.org,
applied as commit 55a51ea14094a1e7dd0d7f33237d246033dd39ab.

Bart.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block/mq-deadline: Fix unused-function compilation warning
  2021-09-18 22:22   ` Bart Van Assche
@ 2021-09-22  2:18     ` Tianjia Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Tianjia Zhang @ 2021-09-22  2:18 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe, linux-block, linux-kernel



On 9/19/21 6:22 AM, Bart Van Assche wrote:
> On 9/17/21 19:23, Tianjia Zhang wrote:
>> ping.
> 
> Please check Linus' master branch and Jens' for-next branch before posting
> block layer patches. This patch looks like a duplicate of patch
> https://lore.kernel.org/r/20210830091128.1854266-1-geert@linux-m68k.org,
> applied as commit 55a51ea14094a1e7dd0d7f33237d246033dd39ab.
> 
> Bart.

Sorry, please ignore this patch.

Best regards,
Tianjia

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-22  2:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  6:47 [PATCH] block/mq-deadline: Fix unused-function compilation warning Tianjia Zhang
2021-09-18  2:23 ` Tianjia Zhang
2021-09-18 22:22   ` Bart Van Assche
2021-09-22  2:18     ` Tianjia Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).