linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: use force attribute for blk_status_t casts
@ 2022-05-14 10:03 Vasily Averin
  2022-05-14 21:24 ` Jens Axboe
  2022-05-16  6:53 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Vasily Averin @ 2022-05-14 10:03 UTC (permalink / raw)
  To: Jens Axboe, linux-block; +Cc: kernel, linux-kernel

Fixes sparse warnings:
block/blk-mq.c:1163:36: sparse:
 warning: cast from restricted blk_status_t
block/blk-mq.c:1251:17: sparse:
 warning: cast to restricted blk_status_t

Signed-off-by: Vasily Averin <vvs@openvz.org>
---
 block/blk-mq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 84d749511f55..1b887f2d4a19 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1160,7 +1160,7 @@ static void blk_end_sync_rq(struct request *rq, blk_status_t error)
 {
 	struct completion *waiting = rq->end_io_data;
 
-	rq->end_io_data = (void *)(uintptr_t)error;
+	rq->end_io_data = (void *)(__force uintptr_t)error;
 
 	/*
 	 * complete last, if this is a stack request the process (and thus
@@ -1248,7 +1248,7 @@ blk_status_t blk_execute_rq(struct request *rq, bool at_head)
 	else
 		wait_for_completion_io(&wait);
 
-	return (blk_status_t)(uintptr_t)rq->end_io_data;
+	return (__force blk_status_t)(uintptr_t)rq->end_io_data;
 }
 EXPORT_SYMBOL(blk_execute_rq);
 
-- 
2.31.1


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

end of thread, other threads:[~2022-05-19  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-14 10:03 [PATCH] blk-mq: use force attribute for blk_status_t casts Vasily Averin
2022-05-14 21:24 ` Jens Axboe
2022-05-16  6:53 ` Christoph Hellwig
2022-05-18 12:45   ` [PATCH v2] blk-mq: fix incorrect " Vasily Averin
2022-05-18 20:35     ` Chaitanya Kulkarni
2022-05-19  7:53     ` Christoph Hellwig

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