diff mbox series

[1/2] brcmfmac: don't WARN when there are no requests

Message ID 20190925134458.1413790-1-adrian.ratiu@collabora.com (mailing list archive)
State Accepted
Commit 1524cbf3621576c639405e7aabeac415f9617c8d
Delegated to: Kalle Valo
Headers show
Series [1/2] brcmfmac: don't WARN when there are no requests | expand

Commit Message

Adrian Ratiu Sept. 25, 2019, 1:44 p.m. UTC
When n_reqs == 0 there is nothing to do so it doesn't make sense to
search for requests and issue a warning because none is found.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Kalle Valo Oct. 1, 2019, 9:14 a.m. UTC | #1
Adrian Ratiu <adrian.ratiu@collabora.com> wrote:

> When n_reqs == 0 there is nothing to do so it doesn't make sense to
> search for requests and issue a warning because none is found.
> 
> Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>

2 patches applied to wireless-drivers-next.git, thanks.

1524cbf36215 brcmfmac: don't WARN when there are no requests
e0ae4bac22ef brcmfmac: fix suspend/resume when power is cut off
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
index 14e530601ef3..fabfbb0b40b0 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
@@ -57,6 +57,10 @@  static int brcmf_pno_remove_request(struct brcmf_pno_info *pi, u64 reqid)
 
 	mutex_lock(&pi->req_lock);
 
+	/* Nothing to do if we have no requests */
+	if (pi->n_reqs == 0)
+		goto done;
+
 	/* find request */
 	for (i = 0; i < pi->n_reqs; i++) {
 		if (pi->reqs[i]->reqid == reqid)