From: Vihas Makwana <makvihas@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Michael Straube <straube.linux@gmail.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
Pavel Skripkin <paskripkin@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Vihas Makwana <makvihas@gmail.com>
Subject: [PATCH 2/3] staging: r8188eu: drop redundant if check in check_fwstate
Date: Tue, 5 Apr 2022 18:12:39 +0530 [thread overview]
Message-ID: <20220405124239.3372-3-makvihas@gmail.com> (raw)
In-Reply-To: <20220405124239.3372-1-makvihas@gmail.com>
The if check is redundant. Drop it and simplify the funciton.
Also, drop clr_fwstate(), clr_fwstate_ex(), up_scanned_network() and
down_scanned_network() as they are not used anywhere.
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
---
drivers/staging/r8188eu/include/rtw_mlme.h | 43 +---------------------
1 file changed, 1 insertion(+), 42 deletions(-)
diff --git a/drivers/staging/r8188eu/include/rtw_mlme.h b/drivers/staging/r8188eu/include/rtw_mlme.h
index 37d217aaf..3b6f70ad8 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme.h
@@ -453,15 +453,7 @@ static inline u8 *get_bssid(struct mlme_priv *pmlmepriv)
static inline bool check_fwstate(struct mlme_priv *pmlmepriv, int state)
{
- if (pmlmepriv->fw_state & state)
- return true;
-
- return false;
-}
-
-static inline int get_fwstate(struct mlme_priv *pmlmepriv)
-{
- return pmlmepriv->fw_state;
+ return pmlmepriv->fw_state & state;
}
/*
@@ -487,39 +479,6 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state)
pmlmepriv->bScanInProcess = false;
}
-/*
- * No Limit on the calling context,
- * therefore set it to be the critical section...
- */
-static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state)
-{
- spin_lock_bh(&pmlmepriv->lock);
- if (check_fwstate(pmlmepriv, state))
- pmlmepriv->fw_state ^= state;
- spin_unlock_bh(&pmlmepriv->lock);
-}
-
-static inline void clr_fwstate_ex(struct mlme_priv *pmlmepriv, int state)
-{
- spin_lock_bh(&pmlmepriv->lock);
- _clr_fwstate_(pmlmepriv, state);
- spin_unlock_bh(&pmlmepriv->lock);
-}
-
-static inline void up_scanned_network(struct mlme_priv *pmlmepriv)
-{
- spin_lock_bh(&pmlmepriv->lock);
- pmlmepriv->num_of_scanned++;
- spin_unlock_bh(&pmlmepriv->lock);
-}
-
-static inline void down_scanned_network(struct mlme_priv *pmlmepriv)
-{
- spin_lock_bh(&pmlmepriv->lock);
- pmlmepriv->num_of_scanned--;
- spin_unlock_bh(&pmlmepriv->lock);
-}
-
static inline void set_scanned_network_val(struct mlme_priv *pmlmepriv, int val)
{
spin_lock_bh(&pmlmepriv->lock);
--
2.30.2
next prev parent reply other threads:[~2022-04-06 0:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 12:42 [PATCH 0/3] staging: r8188eu: some refactoring and cleanup Vihas Makwana
2022-04-05 12:42 ` [PATCH 1/3] staging: r8188eu: drop redundant if check in IS_MCAST Vihas Makwana
2022-04-05 12:42 ` Vihas Makwana [this message]
2022-04-05 14:13 ` [PATCH 2/3] staging: r8188eu: drop redundant if check in check_fwstate Greg Kroah-Hartman
2022-04-05 12:42 ` [PATCH 3/3] staging: r8188eu: simplify rtw_inc_and_chk_continual_urb_error Vihas Makwana
2022-04-05 14:14 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220405124239.3372-3-makvihas@gmail.com \
--to=makvihas@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paskripkin@gmail.com \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox