diff mbox series

[4/7] block: remove the NULL ioc check in put_io_context

Message ID 20211130124636.2505904-5-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/7] block: remove the nr_task field from struct io_context | expand

Commit Message

Christoph Hellwig Nov. 30, 2021, 12:46 p.m. UTC
No caller passes in a NULL pointer, so remove the check.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-ioc.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jan Kara Nov. 30, 2021, 2:59 p.m. UTC | #1
On Tue 30-11-21 13:46:33, Christoph Hellwig wrote:
> No caller passes in a NULL pointer, so remove the check.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  block/blk-ioc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/block/blk-ioc.c b/block/blk-ioc.c
> index 0380e33930e31..04f3d2b0ca7db 100644
> --- a/block/blk-ioc.c
> +++ b/block/blk-ioc.c
> @@ -155,9 +155,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);
>  
>  	/*
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 0380e33930e31..04f3d2b0ca7db 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -155,9 +155,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);
 
 	/*