Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* blk: delete the redundant NULL judgment in put_io_context()
@ 2020-07-31  2:18 brookxu
  0 siblings, 0 replies; only message in thread
From: brookxu @ 2020-07-31  2:18 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

The context of calling put_io_context() will determine whether the ioc
is NULL or the ioc is obtained from icq, which can ensure that the ioc
is not NULL, so the repeated judgment here may be redundant.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
 block/blk-ioc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 9df50fb..b34eae5 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -138,9 +138,6 @@ void put_io_context(struct io_context *ioc)
     unsigned long flags;
     bool free_ioc = false;
 
-    if (ioc == NULL)
-        return;
-
     BUG_ON(atomic_long_read(&ioc->refcount) <= 0);
 
     /*
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  2:18 blk: delete the redundant NULL judgment in put_io_context() brookxu

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git