net/core: remove useless type conversion to bool
Subsystems (3)
PATCH 1/1 net/core: remove useless type conversion to bool
(ret == 0) is bool value, the type conversion to true/false value is not needed.
Signed-off-by Bernard Zhao <[email protected]>
--- net/core/page_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/page_pool.c +1 -1
@@ -398,7 +398,7 @@ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)else ret =ptr_ring_produce_bh (&pool->ring, page); -return (ret ==0 ) ? true : false; +return (ret ==0 ); }/* Only allow direct recycling in special circumstances, into the
Signature · 1 line
2.33.1
Quoted 24 lines · Bernard Zhao
(ret == 0) is bool value, the type conversion to true/false value is not needed.
Signed-off-by Bernard Zhao <[email protected]>--- net/core/page_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/core/page_pool.c +1
-1@@ -398,7 +398,7 @@ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)else ret =ptr_ring_produce_bh (&pool->ring, page); -return (ret ==0 ) ? true : false; +return (ret ==0 ); }/* Only allow direct recycling in special circumstances, into the Signature · 1 line
2.33.1
Reviewed-by Ilias Apalodimas <[email protected]>
Quoted 2 lines · Bernard Zhao
(ret == 0) is bool value, the type conversion to true/false value is not needed.
[]
net/core/page_pool.c
Quoted 1 line
net/core/page_pool.c +0
-0
[]
net/core/page_pool.c static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page) · line 401
Quoted 6 lines
net/core/page_pool.c +1
-1@@ -398,7 +398,7 @@ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)else ret =ptr_ring_produce_bh (&pool->ring, page); -return (ret ==0 ) ? true : false; +return (ret ==0 );
This doesn't need the parentheses either.
Maybe:
return !ret; or return ret == 0;
?