From: Bart Van Assche <bvanassche@acm.org> mainline inclusion from mainline-v6.13-rc3 commit a6fe7b70513fbf11ffa5e85f7b6ba444497a5a3d category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/10302 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- 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> Link: https://lore.kernel.org/r/20241212212941.1268662-4-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk> Conflicts: block/blk-sysfs.c [6.6's blk_queue_passthrough_stat() uses test_bit() and already returns 0/1, so the !! is not required for correctness; it is kept to match the mainline fix.] Signed-off-by: Zizhi Wo <wozizhi@huawei.com> --- 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 3384e6793c0c..4e4fe61c58ff 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -359,11 +359,11 @@ static ssize_t queue_max_active_zones_show(struct request_queue *q, char *page) } static ssize_t queue_iostats_passthrough_show(struct request_queue *q, char *page) { - return queue_var_show(blk_queue_passthrough_stat(q), page); + return queue_var_show(!!blk_queue_passthrough_stat(q), page); } static ssize_t queue_iostats_passthrough_store(struct request_queue *q, const char *page, size_t count) { -- 2.52.0