linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: include dd_queued{,_show} into proper BLK_DEBUG_FS guard
@ 2021-09-06 16:38 Julio Faracco
  2021-09-06 16:44 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Julio Faracco @ 2021-09-06 16:38 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

This commit fixes a compilation issue to an unused function if
BLK_DEBUG_FS setting is not enabled. This usually happens in tiny
kernels with several debug options disabled. For further details,
see the message below:

../block/mq-deadline.c:274:12: error: ‘dd_queued’ defined but not used [-Werror=unused-function]
  274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
      |            ^~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Julio Faracco <jfaracco@redhat.com>
---
 block/mq-deadline.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index 3c3693c34f06..07319ac49a1b 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,13 @@ static int dd_async_depth_show(void *data, struct seq_file *m)
 	return 0;
 }
 
+#ifdef CONFIG_BLK_DEBUG_FS
+/* 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;
@@ -963,6 +964,7 @@ static int dd_queued_show(void *data, struct seq_file *m)
 		   dd_queued(dd, DD_IDLE_PRIO));
 	return 0;
 }
+#endif
 
 /* Number of requests owned by the block driver for a given priority. */
 static u32 dd_owned_by_driver(struct deadline_data *dd, enum dd_prio prio)
-- 
2.31.1


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

* Re: [PATCH] block: include dd_queued{,_show} into proper BLK_DEBUG_FS guard
  2021-09-06 16:38 [PATCH] block: include dd_queued{,_show} into proper BLK_DEBUG_FS guard Julio Faracco
@ 2021-09-06 16:44 ` Jens Axboe
  2021-09-06 17:36   ` Julio Faracco
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2021-09-06 16:44 UTC (permalink / raw)
  To: Julio Faracco; +Cc: linux-block, linux-kernel

On 9/6/21 10:38 AM, Julio Faracco wrote:
> This commit fixes a compilation issue to an unused function if
> BLK_DEBUG_FS setting is not enabled. This usually happens in tiny
> kernels with several debug options disabled. For further details,
> see the message below:
> 
> ../block/mq-deadline.c:274:12: error: ‘dd_queued’ defined but not used [-Werror=unused-function]
>   274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
>       |            ^~~~~~~~~
> cc1: all warnings being treated as errors

This is like the 10th one of these... The patch has been queued up for
about a week, if you check linux-next or the block tree. It's going
upstream soon, in fact it was already sent in yesterday.

-- 
Jens Axboe


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

* Re: [PATCH] block: include dd_queued{,_show} into proper BLK_DEBUG_FS guard
  2021-09-06 16:44 ` Jens Axboe
@ 2021-09-06 17:36   ` Julio Faracco
  2021-09-06 17:39     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Julio Faracco @ 2021-09-06 17:36 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel

Thanks Jens.

On Mon, Sep 6, 2021 at 1:44 PM Jens Axboe <axboe@kernel.dk> wrote:
>
> On 9/6/21 10:38 AM, Julio Faracco wrote:
> > This commit fixes a compilation issue to an unused function if
> > BLK_DEBUG_FS setting is not enabled. This usually happens in tiny
> > kernels with several debug options disabled. For further details,
> > see the message below:
> >
> > ../block/mq-deadline.c:274:12: error: ‘dd_queued’ defined but not used [-Werror=unused-function]
> >   274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
> >       |            ^~~~~~~~~
> > cc1: all warnings being treated as errors
>
> This is like the 10th one of these... The patch has been queued up for
> about a week, if you check linux-next or the block tree. It's going
> upstream soon, in fact it was already sent in yesterday.

I noticed after seeing the same patch earlier this morning, but it was
too late to undo.
Discard my patch, pls.

>
> --
> Jens Axboe
>

--
Julio Faracco


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

* Re: [PATCH] block: include dd_queued{,_show} into proper BLK_DEBUG_FS guard
  2021-09-06 17:36   ` Julio Faracco
@ 2021-09-06 17:39     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-09-06 17:39 UTC (permalink / raw)
  To: Julio Faracco; +Cc: linux-block, linux-kernel

On 9/6/21 11:36 AM, Julio Faracco wrote:
> Thanks Jens.
> 
> On Mon, Sep 6, 2021 at 1:44 PM Jens Axboe <axboe@kernel.dk> wrote:
>>
>> On 9/6/21 10:38 AM, Julio Faracco wrote:
>>> This commit fixes a compilation issue to an unused function if
>>> BLK_DEBUG_FS setting is not enabled. This usually happens in tiny
>>> kernels with several debug options disabled. For further details,
>>> see the message below:
>>>
>>> ../block/mq-deadline.c:274:12: error: ‘dd_queued’ defined but not used [-Werror=unused-function]
>>>   274 | static u32 dd_queued(struct deadline_data *dd, enum dd_prio prio)
>>>       |            ^~~~~~~~~
>>> cc1: all warnings being treated as errors
>>
>> This is like the 10th one of these... The patch has been queued up for
>> about a week, if you check linux-next or the block tree. It's going
>> upstream soon, in fact it was already sent in yesterday.
> 
> I noticed after seeing the same patch earlier this morning, but it was
> too late to undo.
> Discard my patch, pls.

No worries - fwiw, the fix is upstream now.

-- 
Jens Axboe


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 16:38 [PATCH] block: include dd_queued{,_show} into proper BLK_DEBUG_FS guard Julio Faracco
2021-09-06 16:44 ` Jens Axboe
2021-09-06 17:36   ` Julio Faracco
2021-09-06 17:39     ` 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).