lkml.org 
[lkml]   [2021]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net/core: remove useless type conversion to bool
From
Date
On Thu, 2021-11-18 at 17:54 -0800, Bernard Zhao wrote:
> (ret == 0) is bool value, the type conversion to true/false value
> is not needed.
[]
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
[]
> @@ -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;
?


\
 
 \ /
  Last update: 2021-11-19 10:59    [W:2.308 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site