From 88d54d6e15df476110e38b390862b7c8defb63d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Tue, 17 Dec 2019 16:14:44 +0000 Subject: [PATCH] staging: wfx: avoid double warning when no more tx policy are available MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Currently, number of available tx retry policies is checked two times. Only one is sufficient. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20191217161318.31402-14-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wfx/data_tx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index b13d7341f8bba..a1853056ebf1b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -169,7 +169,8 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, wfx_tx_policy_build(wvif, &wanted, rates); spin_lock_bh(&cache->lock); - if (WARN_ON(list_empty(&cache->free))) { + if (list_empty(&cache->free)) { + WARN(1, "unable to get a valid Tx policy"); spin_unlock_bh(&cache->lock); return WFX_INVALID_RATE_ID; } -- 2.30.2