Skip to contentSkip to conversation

block/mq-deadline: Fix unused-function compilation warning

PATCH In review Tianjia Zhang 2 participants 4 messages Sep 1, 2021 – Sep 22, 2021 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/mq-deadline: Fix unused-function compilation warning

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.

---
 block/mq-deadline.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
block/mq-deadline.c +6 -6
index 3c3693c34f06..084314ee878d 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])
@@ -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;
Signature · 1 line
2.19.1.3.ge56e4f7
#1 lore raw

ping.

Quoted 45 lines · 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.

---
  block/mq-deadline.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
block/mq-deadline.c +6 -6
index 3c3693c34f06..084314ee878d 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])
@@ -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;
#3 lore raw
Quoted 9 lines · Bart Van Assche
Quoted 1 line · Tianjia Zhang

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/[email protected],
applied as commit 55a51ea14094a1e7dd0d7f33237d246033dd39ab.

Bart.

Sorry, please ignore this patch.

Best regards,
Tianjia