Linux block layer
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Bart Van Assche <bvanassche@acm.org>,
	Keith Busch <kbusch@kernel.org>
Subject: [PATCH 3/3] block: Fix queue_iostats_passthrough_show()
Date: Thu, 12 Dec 2024 13:29:41 -0800	[thread overview]
Message-ID: <20241212212941.1268662-4-bvanassche@acm.org> (raw)
In-Reply-To: <20241212212941.1268662-1-bvanassche@acm.org>

Make queue_iostats_passthrough_show() report 0/1 in sysfs instead of 0/4.

This patch fixes the following sparse warning:
block/blk-sysfs.c:266:31: warning: incorrect type in argument 1 (different base types)
block/blk-sysfs.c:266:31:    expected unsigned long var
block/blk-sysfs.c:266:31:    got restricted blk_flags_t

Cc: Keith Busch <kbusch@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Fixes: 110234da18ab ("block: enable passthrough command statistics")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 4241aea84161..767598e719ab 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -263,7 +263,7 @@ static ssize_t queue_nr_zones_show(struct gendisk *disk, char *page)
 
 static ssize_t queue_iostats_passthrough_show(struct gendisk *disk, char *page)
 {
-	return queue_var_show(blk_queue_passthrough_stat(disk->queue), page);
+	return queue_var_show(!!blk_queue_passthrough_stat(disk->queue), page);
 }
 
 static ssize_t queue_iostats_passthrough_store(struct gendisk *disk,

  parent reply	other threads:[~2024-12-12 21:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 21:29 [PATCH 0/3] Three small block layer patches Bart Van Assche
2024-12-12 21:29 ` [PATCH 1/3] mq-deadline: Remove a local variable Bart Van Assche
2024-12-13  4:44   ` Christoph Hellwig
2024-12-13  5:36   ` Nitesh Shetty
2024-12-13  7:26   ` Johannes Thumshirn
2024-12-12 21:29 ` [PATCH 2/3] blk-mq: Clean up blk_mq_requeue_work() Bart Van Assche
2024-12-13  4:44   ` Christoph Hellwig
2024-12-13  5:34   ` Nitesh Shetty
2024-12-13  7:26   ` Johannes Thumshirn
2024-12-12 21:29 ` Bart Van Assche [this message]
2024-12-13  4:46   ` [PATCH 3/3] block: Fix queue_iostats_passthrough_show() Christoph Hellwig
2024-12-13 16:26     ` Bart Van Assche
2024-12-16 15:56       ` Christoph Hellwig
2024-12-13 15:09 ` [PATCH 0/3] Three small block layer patches Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241212212941.1268662-4-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox