Skip to contentSkip to conversation

block/mq-deadline: Move dd_queued() to fix defined but not used warning

PATCH Applied Geert Uytterhoeven 4 participants 6 messages Aug 30, 2021 – Sep 6, 2021 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/mq-deadline: Move dd_queued() to fix defined but not used warning

If CONFIG_BLK_DEBUG_FS=n:

block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function]
274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
| ^~~~~~~~~

Fix this by moving dd_queued() just before the sole function that calls it.

Fixes 7b05bf771084ff78 ("Revert "block/mq-deadline: Prioritize high-priority requests"")

---
v2:
- Fix prefix in one-line summary.

---
 block/mq-deadline.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
block/mq-deadline.c +6 -6
index 36920670dccc35f3..c2c724d4e668ebea 100644
@@ -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])
@@ -951,6 +945,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;
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Geert Uytterhoeven

If CONFIG_BLK_DEBUG_FS=n:

block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function]
274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
| ^~~~~~~~~

Fix this by moving dd_queued() just before the sole function that calls it.

Fixes 7b05bf771084ff78 ("Revert "block/mq-deadline: Prioritize high-priority requests"")

The Fixes tag probably should be changed into the following:

Fixes 38ba64d12d4c ("block/mq-deadline: Track I/O statistics")

Anyway:

maintainer Applied
#2 lore raw
In reply to Geert Uytterhoeven
Quoted 8 lines · Geert Uytterhoeven

If CONFIG_BLK_DEBUG_FS=n:

block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function]
274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
| ^~~~~~~~~

Fix this by moving dd_queued() just before the sole function that calls it.

Applied, thanks.

Signature · 1 line
Jens Axboe
#3 lore raw

Hi Jens,

Quoted 4 lines · On Thu, 2 Sep 2021 06:35:47 -0600 Jens Axboe <[email protected]> wrote:
Quoted 2 lines · Geert Uytterhoeven

If CONFIG_BLK_DEBUG_FS=n:

Quoted 8 lines
Quoted 6 lines

block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function]
274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
| ^~~~~~~~~

Fix this by moving dd_queued() just before the sole function that calls it.

Applied, thanks.

Can we get this to Linus ASAP as he has now made warnings fatal, so this is causing lots of build failures.

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#4 lore raw
Quoted 11 lines · Stephen Rothwell

Hi Jens,

Quoted 8 lines · On Thu, 2 Sep 2021 06:35:47 -0600 Jens Axboe <[email protected]> wrote:
Quoted 6 lines · Geert Uytterhoeven

If CONFIG_BLK_DEBUG_FS=n:

block/mq-deadline.c:274:12: warning: ‘dd_queued’ defined but not used [-Wunused-function]
274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
| ^~~~~~~~~

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Fix this by moving dd_queued() just before the sole function that calls it.

Applied, thanks.

Can we get this to Linus ASAP as he has now made warnings fatal, so this is causing lots of build failures.

Sure, it's actually the only branch I haven't sent off yet today. Will do so now.

Signature · 1 line
Jens Axboe
#5 lore raw

Hi Jens,

Quoted 3 lines · On Sun, 5 Sep 2021 21:04:17 -0600 Jens Axboe <[email protected]> wrote:

Sure, it's actually the only branch I haven't sent off yet today. Will do so now.

Excellent, thanks.

Signature · 2 lines
Cheers,
Stephen Rothwell