linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning
@ 2021-08-30  9:11 Geert Uytterhoeven
  2021-08-30 23:22 ` Bart Van Assche
  2021-09-02 12:35 ` Jens Axboe
  0 siblings, 2 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-08-30  9:11 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, 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"")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
v2:
  - Fix prefix in one-line summary.
---
 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 36920670dccc35f3..c2c724d4e668ebea 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])
@@ -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;
-- 
2.25.1


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

* Re: [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning
  2021-08-30  9:11 [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning Geert Uytterhoeven
@ 2021-08-30 23:22 ` Bart Van Assche
  2021-09-02 12:35 ` Jens Axboe
  1 sibling, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2021-08-30 23:22 UTC (permalink / raw)
  To: Geert Uytterhoeven, Jens Axboe; +Cc: linux-block, linux-kernel

On 8/30/21 2:11 AM, Geert Uytterhoeven wrote:
> 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"")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

The Fixes tag probably should be changed into the following:

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

Anyway:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning
  2021-08-30  9:11 [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning Geert Uytterhoeven
  2021-08-30 23:22 ` Bart Van Assche
@ 2021-09-02 12:35 ` Jens Axboe
  2021-09-06  2:56   ` Stephen Rothwell
  1 sibling, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2021-09-02 12:35 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-block, linux-kernel

On 8/30/21 3:11 AM, Geert Uytterhoeven wrote:
> 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.

-- 
Jens Axboe


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

* Re: [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning
  2021-09-02 12:35 ` Jens Axboe
@ 2021-09-06  2:56   ` Stephen Rothwell
  2021-09-06  3:04     ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2021-09-06  2:56 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Geert Uytterhoeven, linux-block, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Hi Jens,

On Thu, 2 Sep 2021 06:35:47 -0600 Jens Axboe <axboe@kernel.dk> wrote:
>
> On 8/30/21 3:11 AM, Geert Uytterhoeven wrote:
> > 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.

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

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning
  2021-09-06  2:56   ` Stephen Rothwell
@ 2021-09-06  3:04     ` Jens Axboe
  2021-09-06  6:56       ` Stephen Rothwell
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2021-09-06  3:04 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Geert Uytterhoeven, linux-block, linux-kernel

On 9/5/21 8:56 PM, Stephen Rothwell wrote:
> Hi Jens,
> 
> On Thu, 2 Sep 2021 06:35:47 -0600 Jens Axboe <axboe@kernel.dk> wrote:
>>
>> On 8/30/21 3:11 AM, Geert Uytterhoeven wrote:
>>> 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.
> 
> 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.

-- 
Jens Axboe


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

* Re: [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning
  2021-09-06  3:04     ` Jens Axboe
@ 2021-09-06  6:56       ` Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2021-09-06  6:56 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Geert Uytterhoeven, linux-block, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

Hi Jens,

On Sun, 5 Sep 2021 21:04:17 -0600 Jens Axboe <axboe@kernel.dk> wrote:
>
> Sure, it's actually the only branch I haven't sent off yet today. Will
> do so now.

Excellent, thanks.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30  9:11 [PATCH] block/mq-deadline: Move dd_queued() to fix defined but not used warning Geert Uytterhoeven
2021-08-30 23:22 ` Bart Van Assche
2021-09-02 12:35 ` Jens Axboe
2021-09-06  2:56   ` Stephen Rothwell
2021-09-06  3:04     ` Jens Axboe
2021-09-06  6:56       ` Stephen Rothwell

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