All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edmundo Carmona Antoranz <eantoranz@gmail.com>
To: gregkh@linuxfoundation.org, marcocesati@gmail.com,
	dan.carpenter@oracle.com, ross.schm.dev@gmail.com,
	fabioaiuto83@gmail.com, linux-staging@lists.linux.dev
Cc: kernel-janitors@vger.kernel.org,
	Edmundo Carmona Antoranz <eantoranz@gmail.com>
Subject: [PATCH -next 5/6] staging: rtl8723bs: mark some variables as __maybe_unused
Date: Fri, 26 Mar 2021 18:17:35 -0600	[thread overview]
Message-ID: <20210327001736.180881-5-eantoranz@gmail.com> (raw)
In-Reply-To: <20210327001736.180881-1-eantoranz@gmail.com>

The definition of a few macros used in the code to write debug
messages could be empty depending on the way code is compiled.
If this is the case, there are compiler warnings about variables
not being used. This patch markes them to be __maybe_unused to
avoid these warnings.

Removing these warnings:

drivers/staging/rtl8723bs/core/rtw_mlme.c:1282:12: warning: variable ‘retry’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1065:17: warning: variable ‘reassoc’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1799:30: warning: variable ‘reason_code’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:5411:21: warning: variable ‘psta’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:6317:15: warning: variable ‘evt_seq’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_recv.c:2501:6: warning: variable ‘num_signal_qual’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1793:11: warning: variable ‘start_seq’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:3719:32: warning: variable ‘ioted’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:3719:20: warning: variable ‘masked’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:3719:7: warning: variable ‘input_b’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:4290:46: warning: variable ‘lowest_rate’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:4290:34: warning: variable ‘hight_rate’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:4290:21: warning: variable ‘curr_tx_sgi’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:4290:7: warning: variable ‘curr_tx_rate’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:4289:20: warning: variable ‘rate_mask2’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:4289:8: warning: variable ‘rate_mask1’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/sdio_ops.c:170:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2924:7: warning: variable ‘ack’ set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:1199:6: warning: variable ‘reason’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c         |  2 +-
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c     | 11 +++++++----
 drivers/staging/rtl8723bs/core/rtw_recv.c         |  2 +-
 drivers/staging/rtl8723bs/core/rtw_wlan_util.c    |  3 ++-
 drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c |  7 ++++---
 drivers/staging/rtl8723bs/hal/sdio_ops.c          |  2 +-
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c |  2 +-
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c    |  2 +-
 8 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 83fbd415d766..5125a7ec0198 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1277,7 +1277,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
 /* define REJOIN */
 void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
 {
-	static u8 retry;
+	static u8 __maybe_unused retry;
 	struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
 	struct	sta_priv *pstapriv = &adapter->stapriv;
 	struct	mlme_priv *pmlmepriv = &(adapter->mlmepriv);
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 8aadcf72a7ba..4795d35bd99b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1062,7 +1062,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
 	u16 capab_info;
 	struct rtw_ieee802_11_elems elems;
 	struct sta_info *pstat;
-	unsigned char 	reassoc, *p, *pos, *wpa_ie;
+	unsigned char *p, *pos, *wpa_ie;
+	unsigned char __maybe_unused reassoc;
 	unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
 	int		i, ie_len, wpa_ie_len, left;
 	unsigned char 	supportRate[16];
@@ -1796,7 +1797,8 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra
 	struct recv_reorder_ctrl *preorder_ctrl;
 	unsigned char 	*frame_body;
 	unsigned char 	category, action;
-	unsigned short	tid, status, reason_code = 0;
+	unsigned short	tid, status;
+	unsigned short __maybe_unused reason_code = 0;
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
 	u8 *pframe = precv_frame->u.hdr.rx_data;
@@ -5408,7 +5410,7 @@ void _linked_info_dump(struct adapter *padapter)
 		} else if ((pmlmeinfo->state&0x03) == _HW_STATE_AP_) {
 			struct list_head	*phead, *plist;
 
-			struct sta_info *psta = NULL;
+			struct sta_info __maybe_unused *psta = NULL;
 			struct sta_priv *pstapriv = &padapter->stapriv;
 
 			spin_lock_bh(&pstapriv->asoc_list_lock);
@@ -6314,7 +6316,8 @@ u8 set_tx_beacon_cmd(struct adapter *padapter)
 
 u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
 {
-	u8 evt_code, evt_seq;
+	u8 evt_code;
+	u8 __maybe_unused evt_seq;
 	u16 evt_sz;
 	uint	*peventbuf;
 	void (*event_callback)(struct adapter *dev, u8 *pbuf);
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 608a59286505..9e6c229cae8d 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -2471,7 +2471,7 @@ static void rtw_signal_stat_timer_hdl(struct timer_list *t)
 	u8 avg_signal_strength = 0;
 	u8 avg_signal_qual = 0;
 	u32 num_signal_strength = 0;
-	u32 num_signal_qual = 0;
+	u32 __maybe_unused num_signal_qual = 0;
 	u8 _alpha = 5; /*  this value is based on converging_constant = 5000 and sampling_interval = 1000 */
 
 	if (adapter->recvpriv.is_signal_dbg) {
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 760b0ea4e9bd..39f423ee4cf1 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1787,7 +1787,8 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
 void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr)
 {
 	struct sta_info *psta;
-	u16 tid, start_seq, param;
+	u16 tid, param;
+	u16 __maybe_unused start_seq;
 	struct recv_reorder_ctrl *preorder_ctrl;
 	struct sta_priv *pstapriv = &padapter->stapriv;
 	struct ADDBA_request *preq = (struct ADDBA_request *)paddba_req;
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 0081fe0a431f..1b54d8527823 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -3716,7 +3716,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val)
 	case HW_VAR_BASIC_RATE:
 	{
 		struct mlme_ext_info *mlmext_info = &padapter->mlmeextpriv.mlmext_info;
-		u16 input_b = 0, masked = 0, ioted = 0, BrateCfg = 0;
+		u16 __maybe_unused input_b = 0, masked = 0, ioted = 0;
+		u16 BrateCfg = 0;
 		u16 rrsr_2g_force_mask = (RRSR_11M|RRSR_5_5M|RRSR_1M);
 		u16 rrsr_2g_allow_mask = (RRSR_24M|RRSR_12M|RRSR_6M|RRSR_CCK_RATES);
 
@@ -4286,8 +4287,8 @@ u8 GetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, v
 			u8 mac_id = *(u8 *)pval;
 			u32 cmd;
 			u32 ra_info1, ra_info2;
-			u32 rate_mask1, rate_mask2;
-			u8 curr_tx_rate, curr_tx_sgi, hight_rate, lowest_rate;
+			u32 __maybe_unused rate_mask1, rate_mask2;
+			u8 __maybe_unused curr_tx_rate, curr_tx_sgi, hight_rate, lowest_rate;
 
 			DBG_8192C("============ RA status check  Mac_id:%d ===================\n", mac_id);
 
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index a24a39e70454..39328217a9c6 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -167,7 +167,7 @@ static u32 sdio_read32(struct intf_hdl *intfhdl, u32 addr)
 	u32 ftaddr;
 	u8 shift;
 	u32 val;
-	s32 err;
+	s32 __maybe_unused err;
 	__le32 le_tmp;
 
 	adapter = intfhdl->padapter;
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 03a784558d79..c342fdebb6a7 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -2919,7 +2919,7 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b
 	struct pkt_attrib	*pattrib;
 	unsigned char *pframe;
 	int ret = _FAIL;
-	bool ack = true;
+	bool __maybe_unused ack = true;
 	struct ieee80211_hdr *pwlanhdr;
 	struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
 	struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 9909dece0b01..322a9393621e 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -1196,7 +1196,7 @@ static int rtw_wx_set_mlme(struct net_device *dev,
 			     union iwreq_data *wrqu, char *extra)
 {
 	int ret = 0;
-	u16 reason;
+	u16 __maybe_unused reason;
 	struct adapter *padapter = rtw_netdev_priv(dev);
 	struct iw_mlme *mlme = (struct iw_mlme *)extra;
 
-- 
2.30.2


  parent reply	other threads:[~2021-03-27  0:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27  0:17 [PATCH -next 1/6] staging: rtl8723bs: ieee80211: remove unused variable Edmundo Carmona Antoranz
2021-03-27  0:17 ` [PATCH -next 2/6] staging: rtl8723bs: mlme: remove unused variables Edmundo Carmona Antoranz
2021-03-28 12:33   ` Greg KH
2021-03-27  0:17 ` [PATCH -next 3/6] staging: rtl8723bs: hal: remove unused variable in HalBtc8723b1Ant.c Edmundo Carmona Antoranz
2021-03-27  0:17 ` [PATCH -next 4/6] staging: rtl8723bs: sdio_ops: removing unused variable Edmundo Carmona Antoranz
2021-03-27  0:17 ` Edmundo Carmona Antoranz [this message]
2021-03-27  8:17   ` [PATCH -next 5/6] staging: rtl8723bs: mark some variables as __maybe_unused Dan Carpenter
2021-03-27 14:44     ` Edmundo Carmona Antoranz
2021-03-27 14:44       ` Edmundo Carmona Antoranz
2021-03-27 16:27       ` Dan Carpenter
2021-03-27  0:17 ` [PATCH -next 6/6] staging: rtl8723bs: sta_mgt: return _FAIL if there is an error Edmundo Carmona Antoranz
2021-03-27  0:23   ` Edmundo Carmona Antoranz
2021-03-27  0:23     ` Edmundo Carmona Antoranz
2021-03-27  8:21   ` Dan Carpenter
2021-03-27  8:13 ` [PATCH -next 1/6] staging: rtl8723bs: ieee80211: remove unused variable Dan Carpenter
2021-03-28 12:32 ` Greg KH

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=20210327001736.180881-5-eantoranz@gmail.com \
    --to=eantoranz@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=marcocesati@gmail.com \
    --cc=ross.schm.dev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.