Commit 3e61103b authored by David Wei's avatar David Wei Committed by David S. Miller

page_pool: remove WARN_ON() with OR

Having an OR in WARN_ON() makes me sad because it's impossible to tell
which condition is true when triggered.

Split a WARN_ON() with an OR in page_pool_disable_direct_recycling().
Signed-off-by: default avatarDavid Wei <dw@davidwei.uk>
Reviewed-by: default avatarMina Almasry <almasrymina@google.com>
Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
Acked-by: default avatarJesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a9999732
......@@ -1027,8 +1027,8 @@ static void page_pool_disable_direct_recycling(struct page_pool *pool)
/* To avoid races with recycling and additional barriers make sure
* pool and NAPI are unlinked when NAPI is disabled.
*/
WARN_ON(!test_bit(NAPI_STATE_SCHED, &pool->p.napi->state) ||
READ_ONCE(pool->p.napi->list_owner) != -1);
WARN_ON(!test_bit(NAPI_STATE_SCHED, &pool->p.napi->state));
WARN_ON(READ_ONCE(pool->p.napi->list_owner) != -1);
WRITE_ONCE(pool->p.napi, NULL);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment