linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: remove unneeded return value of bio_check_ro()
@ 2022-09-05 10:27 Miaohe Lin
  2022-09-05 17:45 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2022-09-05 10:27 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, linmiaohe

bio_check_ro() always return false now. Remove this unneeded return value
and cleanup the sole caller. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 block/blk-core.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index a0d1104c5590..fe6b27e3a513 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -487,18 +487,15 @@ static int __init fail_make_request_debugfs(void)
 late_initcall(fail_make_request_debugfs);
 #endif /* CONFIG_FAIL_MAKE_REQUEST */
 
-static inline bool bio_check_ro(struct bio *bio)
+static inline void bio_check_ro(struct bio *bio)
 {
 	if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) {
 		if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
-			return false;
+			return;
 		pr_warn("Trying to write to read-only block-device %pg\n",
 			bio->bi_bdev);
 		/* Older lvm-tools actually trigger this */
-		return false;
 	}
-
-	return false;
 }
 
 static noinline int should_fail_bio(struct bio *bio)
@@ -722,8 +719,7 @@ void submit_bio_noacct(struct bio *bio)
 
 	if (should_fail_bio(bio))
 		goto end_io;
-	if (unlikely(bio_check_ro(bio)))
-		goto end_io;
+	bio_check_ro(bio);
 	if (!bio_flagged(bio, BIO_REMAPPED)) {
 		if (unlikely(bio_check_eod(bio)))
 			goto end_io;
-- 
2.23.0


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

* Re: [PATCH] block: remove unneeded return value of bio_check_ro()
  2022-09-05 10:27 [PATCH] block: remove unneeded return value of bio_check_ro() Miaohe Lin
@ 2022-09-05 17:45 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-09-05 17:45 UTC (permalink / raw)
  To: Miaohe Lin; +Cc: linux-block, linux-kernel

On Mon, 5 Sep 2022 18:27:54 +0800, Miaohe Lin wrote:
> bio_check_ro() always return false now. Remove this unneeded return value
> and cleanup the sole caller. No functional change intended.
> 
> 

Applied, thanks!

[1/1] block: remove unneeded return value of bio_check_ro()
      commit: bdb7d420c6f6d2618d4c907cd7742c3195c425e2

Best regards,
-- 
Jens Axboe



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

end of thread, other threads:[~2022-09-05 17:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 10:27 [PATCH] block: remove unneeded return value of bio_check_ro() Miaohe Lin
2022-09-05 17:45 ` 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).