linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mq-deadline: Fix build error for !BLK_DEBUG_FS
@ 2021-09-06  3:09 Huacai Chen
  2021-09-06  3:12 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Huacai Chen @ 2021-09-06  3:09 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, linux-doc, Xuefeng Li, Huacai Chen, Jiaxun Yang,
	Huacai Chen

Function dd_queued() is only used in dd_queued_show(), but dd_queued_
show() is only defined for BLK_DEBUG_FS enabled. However, in the commit
3fe617ccafd6f5bb3 ("Enable '-Werror' by default for all kernel builds")
Werror is enabled by default, which cause a build error if DEBUG_FS is
not enabled.

So we move dd_queued() in the CONFIG_BLK_DEBUG_FS block to fix it.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 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..7f3c3932b723 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 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.27.0


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

end of thread, other threads:[~2021-09-06  3:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06  3:09 [PATCH] mq-deadline: Fix build error for !BLK_DEBUG_FS Huacai Chen
2021-09-06  3:12 ` Jens Axboe

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).