Re: [PATCH 13/55] staging: wfx: avoid double warning when no more tx policy are available
On Friday 3 January 2020 10:21:16 CET Dan Carpenter wrote: > On Mon, Dec 16, 2019 at 05:03:40PM +, Jérôme Pouiller wrote: > > From: Jérôme Pouiller > > > > Currently, number of available tx retry policies is checked two times. > > Only one is sufficient. > > > > Signed-off-by: Jérôme Pouiller > > --- > > 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 32e269becd75..c9dea627661f 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, , rates); > > > > spin_lock_bh(>lock); > > - if (WARN_ON(list_empty(>free))) { > > + if (list_empty(>free)) { > > + WARN(1, "unable to get a valid Tx policy"); > > spin_unlock_bh(>lock); > > return WFX_INVALID_RATE_ID; > > This warning is more clear than the original which is good, but that's > not what the commit message says. How does this fix a double warning? Err... Indeed, it don't. From wfx_tx_get_rate_id(): rate_id = wfx_tx_policy_get(wvif, ...); if (rate_id == WFX_INVALID_RATE_ID) dev_warn(wvif->wdev->dev, "unable to get a valid Tx policy"); I will fix that in my next PR. -- Jérôme Pouiller ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 13/55] staging: wfx: avoid double warning when no more tx policy are available
On Mon, Dec 16, 2019 at 05:03:40PM +, Jérôme Pouiller wrote: > From: Jérôme Pouiller > > Currently, number of available tx retry policies is checked two times. > Only one is sufficient. > > Signed-off-by: Jérôme Pouiller > --- > 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 32e269becd75..c9dea627661f 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, , rates); > > spin_lock_bh(>lock); > - if (WARN_ON(list_empty(>free))) { > + if (list_empty(>free)) { > + WARN(1, "unable to get a valid Tx policy"); > spin_unlock_bh(>lock); > return WFX_INVALID_RATE_ID; This warning is more clear than the original which is good, but that's not what the commit message says. How does this fix a double warning? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/55] staging: wfx: avoid double warning when no more tx policy are available
From: Jérôme Pouiller Currently, number of available tx retry policies is checked two times. Only one is sufficient. Signed-off-by: Jérôme Pouiller --- 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 32e269becd75..c9dea627661f 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, , rates); spin_lock_bh(>lock); - if (WARN_ON(list_empty(>free))) { + if (list_empty(>free)) { + WARN(1, "unable to get a valid Tx policy"); spin_unlock_bh(>lock); return WFX_INVALID_RATE_ID; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel