staging: stl8723bs: Various cleanups
v2 cover staging: stl8723bs: Various cleanups
Various cleanups for rtl8723bs driver, mostly targeting unused code and definitions.
Changes since v1:
* Include description in commit body as well
* Fix warnings introduced in patch 11.
Priit Laes (11):
staging: stl8723bs: Use common round_up macro
staging: rtl8723bs: Remove unused BIT32..BIT36 definitions
staging: rtl8723bs: Drop empty rtw_bug_check function
staging: rtl8723bs: Remove unused rtw_sprintf macro
staging: rtl8723bs: Drop unused _kfree(...) declaration.
staging: rtl8723bs: Get rid of unused _rtw_init_queue
staging: rtl8723bs: Drop unused NDEV-related formatting macros
staging: rtl8723bs: Drop workqueue wrapper functions
staging: rtl8273bs: Simplify regulatory initialization functions
staging: rtl8723bs: Clean up wrapper functions
staging: rtl8723bs: rtw_ieee80211: Reduce global symbols
drivers/staging/rtl8723bs/core/rtw_cmd.c | 90 ++++++++----------- .../staging/rtl8723bs/core/rtw_ieee80211.c | 41 ++++----- drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 --- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 6 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 3 - drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 1 - drivers/staging/rtl8723bs/core/rtw_xmit.c | 4 - .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +- drivers/staging/rtl8723bs/hal/sdio_ops.c | 8 +- drivers/staging/rtl8723bs/include/cmd_osdep.h | 7 +- drivers/staging/rtl8723bs/include/ieee80211.h | 30 ------- .../staging/rtl8723bs/include/osdep_service.h | 25 ------ .../rtl8723bs/include/osdep_service_linux.h | 18 ---- drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 27 +----- 14 files changed, 73 insertions(+), 203 deletions(-)
Signature · 1 line
2.53.0
PATCH v2 1/11 staging: stl8723bs: Use common round_up macro
Get rid of driver-specific _RND macro in favor of kernel one.
--- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +++--- drivers/staging/rtl8723bs/hal/sdio_ops.c | 4 ++-- drivers/staging/rtl8723bs/include/osdep_service.h | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3 -3
@@ -232,7 +232,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv/* check xmit_buf size enough or not */ txlen = txdesc_size +rtw_wlan_pkt_size (pxmitframe);if (!pxmitbuf || - ((_RND (pxmitbuf->len,8 ) + txlen) > max_xmit_len) || + ((round_up (pxmitbuf->len,8 ) + txlen) > max_xmit_len) || (k >= (rtw_hal_sdio_max_txoqt_free_space (padapter) -1 )) ) {if (pxmitbuf) {
@@ -303,8 +303,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv txlen = txdesc_size + pxmitframe->attrib.last_txcmdsz; pxmitframe->pg_num = (txlen +127 ) /128 ; pxmitbuf->pg_num += (txlen +127 ) /128 ; - pxmitbuf->ptail +=_RND (txlen,8 );/* round to 8 bytes alignment */ - pxmitbuf->len =_RND (pxmitbuf->len,8 ) + txlen; + pxmitbuf->ptail +=round_up (txlen,8 ); + pxmitbuf->len =round_up (pxmitbuf->len,8 ) + txlen; }if (k !=1 )
drivers/staging/rtl8723bs/hal/sdio_ops.c +2 -2
@@ -401,7 +401,7 @@ static u32 sdio_read_port(hal_sdio_get_cmd_addr_8723b (adapter, addr, hal->SdioRxFIFOCnt++, &addr);if (cnt > psdio->block_transfer_len) - cnt =_RND (cnt, psdio->block_transfer_len); + cnt =round_up (cnt, psdio->block_transfer_len); err =_sd_read (intfhdl, addr, cnt, mem);
@@ -448,7 +448,7 @@ static u32 sdio_write_port(hal_sdio_get_cmd_addr_8723b (adapter, addr, cnt >>2 , &addr);if (cnt > psdio->block_transfer_len) - cnt =_RND (cnt, psdio->block_transfer_len); + cnt =round_up (cnt, psdio->block_transfer_len); err =sd_write (intfhdl, addr, cnt, xmitbuf->pdata);
drivers/staging/rtl8723bs/include/osdep_service.h +0 -2
@@ -78,8 +78,6 @@ static inline int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *par } -#define _RND (sz, r) ((((sz)+((r)-1))/(r))*(r)) -extern void rtw_free_netdev (struct net_device *netdev);/* Macros for handling unaligned memory accesses */
Signature · 1 line
2.53.0
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
Subject has a typo. Please correct it.
How did you test this? The driver code appears largely AI-generated unless it has been validated on actual hardware, such as Pine64 Wi-Fi module or another board compatible with rtl8723bs considering these changes are not just indentation based.
Best,
Vivek
Quoted 68 lines · Priit Laes
Get rid of driver-specific
_RNDmacro in favor of kernel one.Signed-off-by Priit Laes <[email protected]>--- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +++--- drivers/staging/rtl8723bs/hal/sdio_ops.c | 4 ++-- drivers/staging/rtl8723bs/include/osdep_service.h | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-)drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3
-3@@ -232,7 +232,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv/* check xmit_buf size enough or not */ txlen = txdesc_size +rtw_wlan_pkt_size (pxmitframe);if (!pxmitbuf || - ((_RND (pxmitbuf->len,8 ) + txlen) > max_xmit_len) || + ((round_up (pxmitbuf->len,8 ) + txlen) > max_xmit_len) || (k >= (rtw_hal_sdio_max_txoqt_free_space (padapter) -1 )) ) {if (pxmitbuf) {@@ -303,8 +303,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv txlen = txdesc_size + pxmitframe->attrib.last_txcmdsz; pxmitframe->pg_num = (txlen +127 ) /128 ; pxmitbuf->pg_num += (txlen +127 ) /128 ; - pxmitbuf->ptail +=_RND (txlen,8 );/* round to 8 bytes alignment */ - pxmitbuf->len =_RND (pxmitbuf->len,8 ) + txlen; + pxmitbuf->ptail +=round_up (txlen,8 ); + pxmitbuf->len =round_up (pxmitbuf->len,8 ) + txlen; }if (k !=1 )drivers/staging/rtl8723bs/hal/sdio_ops.c +2
-2@@ -401,7 +401,7 @@ static u32 sdio_read_port(hal_sdio_get_cmd_addr_8723b (adapter, addr, hal->SdioRxFIFOCnt++, &addr);if (cnt > psdio->block_transfer_len) - cnt =_RND (cnt, psdio->block_transfer_len); + cnt =round_up (cnt, psdio->block_transfer_len); err =_sd_read (intfhdl, addr, cnt, mem);@@ -448,7 +448,7 @@ static u32 sdio_write_port(hal_sdio_get_cmd_addr_8723b (adapter, addr, cnt >>2 , &addr);if (cnt > psdio->block_transfer_len) - cnt =_RND (cnt, psdio->block_transfer_len); + cnt =round_up (cnt, psdio->block_transfer_len); err =sd_write (intfhdl, addr, cnt, xmitbuf->pdata);drivers/staging/rtl8723bs/include/osdep_service.h +0
-2@@ -78,8 +78,6 @@ static inline int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *par } -#define _RND (sz, r) ((((sz)+((r)-1))/(r))*(r)) -extern void rtw_free_netdev (struct net_device *netdev);/* Macros for handling unaligned memory accesses */
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
Quoted 7 lines · Vivek BalachandharTN
Subject has a typo. Please correct it.
How did you test this? The driver code appears largely AI-generated unless it has been validated on actual hardware, such as Pine64 Wi-Fi module or another board compatible with rtl8723bs considering these changes are not just indentation based.
The patch doesn't introduce any bugs.
#define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r))
This is the canonical way to implement a round up macro. It's how roundup() is implemented in the kernel.
The patch uses round_up() instead which is a faster version but it only works for power of 2 rounds. psdio->block_transfer_len is 512 so it's fine. I probably would prefer to use roundup() for that even though round_up() works as well.
We maybe should create a static checker rule to warn about using round_up() for non-power of 2 values:
KTODO: create a Smatch rule to use roundup() instead of round_up()
for user supplied values, or non-power of 2.
regards,
dan carpenter
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
Quoted 21 lines · Dan Carpenter
Quoted 7 lines · Vivek BalachandharTN
Subject has a typo. Please correct it.
How did you test this? The driver code appears largely AI-generated unless it has been validated on actual hardware, such as Pine64 Wi-Fi module or another board compatible with rtl8723bs considering these changes are not just indentation based.
The patch doesn't introduce any bugs.
#define
_RND(sz, r)((((sz)+((r)-1))/(r))*(r))This is the canonical way to implement a round up macro. It's how
roundup()is implemented in the kernel.The patch uses
round_up()instead which is a faster version but it only works for power of 2 rounds.psdio->block_transfer_lenis 512 so it's fine. I probably would prefer to useroundup()for that even thoughround_up()works as well.
Quoted 6 lines
We maybe should create a static checker rule to warn about using
round_up()for non-power of 2 values:KTODO: create a Smatch rule to use
roundup()instead ofround_up()
for user supplied values, or non-power of 2.
Firstly, thanks for the kind words, Dan.
It's kinda annoying how things have changed since the old days. Apparently if someone now attempts to improve the low-hanging fruit, it gets instantly accused of doing something awful...
Anyway, meanwhile I actually discovered some better versions of out-of-tree drivers for rtl8732bs based on existing rtw888 driver [1], [2], therefore I have no motivation left to fix up my "own brain slop".
And on more thing - whats the proper way to use get_maintainers.pl script with git send-email when sending patch series? Apparently I used it wrongly and managed to agitate lots of people in the process..
[1] https://github.com/jernejsk/linux-1/tree/8723b
[2] https://github.com/MocLG/rtw88-rtl8723bs
Päikest,
Priit
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
Quoted 35 lines · Priit Laes
Quoted 21 lines · Dan Carpenter
Quoted 7 lines · Vivek BalachandharTN
Subject has a typo. Please correct it.
How did you test this? The driver code appears largely AI-generated unless it has been validated on actual hardware, such as Pine64 Wi-Fi module or another board compatible with rtl8723bs considering these changes are not just indentation based.
The patch doesn't introduce any bugs.
#define
_RND(sz, r)((((sz)+((r)-1))/(r))*(r))This is the canonical way to implement a round up macro. It's how
roundup()is implemented in the kernel.The patch uses
round_up()instead which is a faster version but it only works for power of 2 rounds.psdio->block_transfer_lenis 512 so it's fine. I probably would prefer to useroundup()for that even thoughround_up()works as well.Quoted 6 lines
We maybe should create a static checker rule to warn about using
round_up()for non-power of 2 values:KTODO: create a Smatch rule to use
roundup()instead ofround_up()
for user supplied values, or non-power of 2.Firstly, thanks for the kind words, Dan.
It's kinda annoying how things have changed since the old days. Apparently if someone now attempts to improve the low-hanging fruit, it gets instantly accused of doing something awful...
Quoted 7 lines
Anyway, meanwhile I actually discovered some better versions of out-of-tree drivers for rtl8732bs based on existing rtw888 driver [1], [2], therefore I have no motivation left to fix up my "own brain slop".
And on more thing - whats the proper way to use get_maintainers.pl script with
git send-emailwhen sending patch series? Apparently I used it wrongly and managed to agitate lots of people in the process..
The outreachy tutorial suggests the arguments --separator , --nokeywords --nogit --nogit-fallback --norolestats
julia
Quoted 7 lines
[1] https://github.com/jernejsk/linux-1/tree/8723b
[2] https://github.com/MocLG/rtw88-rtl8723bsPäikest,
Priit
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
Quoted 1 line · Julia Lawall
On Mon, 23 Feb 2026, Priit Laes wrote:
...
Quoted 2 lines
The outreachy tutorial suggests the arguments --separator , --nokeywords --nogit --nogit-fallback --norolestats
Wondering if you have a new chapter to suggest b4 to be used for that. Maybe it's time to have two ways explained?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
Quoted 10 lines · Andy Shevchenko
Quoted 1 line · Julia Lawall
On Mon, 23 Feb 2026, Priit Laes wrote:
...
Quoted 2 lines
The outreachy tutorial suggests the arguments --separator , --nokeywords --nogit --nogit-fallback --norolestats
Wondering if you have a new chapter to suggest
b4to be used for that. Maybe it's time to have two ways explained?
If you have a few minutes to add an explanation, I would be happy to add it.
thanks,
julia
Quoted 7 lines
--
With Best Regards,
Andy Shevchenko
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
Quoted 3 lines · Julia Lawall
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Julia Lawall
On Mon, 23 Feb 2026, Priit Laes wrote:
...
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
The outreachy tutorial suggests the arguments --separator , --nokeywords --nogit --nogit-fallback --norolestats
Wondering if you have a new chapter to suggest
b4to be used for that. Maybe it's time to have two ways explained?If you have a few minutes to add an explanation, I would be happy to add it.
I would be glad to, if I was an advanced user of b4. It's still in my TODO list to play with it more (currently I have my own script to prepare and send patches).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v2 01/11] staging: stl8723bs: Use common round_up macro
In reply to Priit LaesQuoted 5 lines · Priit Laes
And on more thing - whats the proper way to use get_maintainers.pl script with
git send-emailwhen sending patch series? Apparently I used it wrongly and managed to agitate lots of people in the process..
I don't know how you got so many people on your CC list. When I try running get_maintainter on your patch this is what I get.
$ ./scripts/get_maintainer.pl --no-roles --no-rolestats ~/var/mail/tmp/patch Greg Kroah-Hartman <[email protected]> Minu Jin <[email protected]> Akiyoshi Kurita <[email protected]> Erick Karanja <[email protected]> SeungJu Cheon <[email protected]> Andy Shevchenko <[email protected]> Sun Jian <[email protected]> Thomas Gleixner <[email protected]> Yuvraj Singh Chauhan <[email protected]> [email protected] [email protected]
I normally don't add --nogit --nogit-fallback like Julia does but I sometimes remove people like Kees and Thomas by hand since I know they are included because of --git and aren't interested in tracking everything. On the other hand, people like Kees and Thomas are good at ignoring email they don't care about so I doubt they will get annoyed with you.
regards,
dan carpenter
PATCH v2 2/11 staging: rtl8723bs: Remove unused BIT32..BIT36 definitions
In reply to Priit LaesBIT32..BIT36 seem to be not used anywhere.
--- drivers/staging/rtl8723bs/include/osdep_service.h | 5 ----- 1 file changed, 5 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service.h +0 -5
@@ -46,11 +46,6 @@#define BIT29 0x20000000#define BIT30 0x40000000#define BIT31 0x80000000 -#define BIT32 0x0100000000 -#define BIT33 0x0200000000 -#define BIT34 0x0400000000 -#define BIT35 0x0800000000 -#define BIT36 0x1000000000extern int RTW_STATUS_CODE (int error_code);
Signature · 1 line
2.53.0
PATCH v2 3/11 staging: rtl8723bs: Drop empty rtw_bug_check function
In reply to Priit LaesThe rtw_bug_check was no-op returing true, so get rid of it and remove calls to it.
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 ---------- drivers/staging/rtl8723bs/include/osdep_service.h | 8 -------- 2 files changed, 18 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +0 -10
@@ -358,9 +358,6 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 feau16 s_cap, d_cap;__le16 tmps, tmpd; -if (rtw_bug_check (dst, src, &s_cap, &d_cap) == false) -return false; -memcpy ((u8 *)&tmps,rtw_get_capability_from_ie (src->ies),2 );memcpy ((u8 *)&tmpd,rtw_get_capability_from_ie (dst->ies),2 );
@@ -464,11 +461,6 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex {struct mlme_priv *pmlmepriv = &adapter->mlmepriv; -rtw_bug_check (&pmlmepriv->cur_network.network, - &pmlmepriv->cur_network.network, - &pmlmepriv->cur_network.network, - &pmlmepriv->cur_network.network); -if (check_fwstate (pmlmepriv, _FW_LINKED) && (is_same_network (&pmlmepriv->cur_network.network, pnetwork,0 ))) {update_network (&pmlmepriv->cur_network.network, pnetwork, adapter, true); rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fix_ie),
@@ -493,8 +485,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *tlist_for_each (plist, phead) { pnetwork = list_entry(plist, struct wlan_network, list); -rtw_bug_check (pnetwork, pnetwork, pnetwork, pnetwork); -if (is_same_network (&pnetwork->network, target, feature)) { target_find =1 ;break ;
drivers/staging/rtl8723bs/include/osdep_service.h +0 -8
@@ -65,14 +65,6 @@ static inline void flush_signals_thread(void)#define rtw_warn_on (condition) WARN_ON(condition) -static inline int rtw_bug_check (void *parg1,void *parg2,void *parg3,void *parg4) -{ -int ret = true; - -return ret; - -} -extern void rtw_free_netdev (struct net_device *netdev);/* Macros for handling unaligned memory accesses */
Signature · 1 line
2.53.0
PATCH v2 4/11 staging: rtl8723bs: Remove unused rtw_sprintf macro
In reply to Priit LaesRemove unused rtw_sprintf macro.
--- drivers/staging/rtl8723bs/include/osdep_service.h | 6 ------ 1 file changed, 6 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service.h +0 -6
@@ -85,10 +85,4 @@ bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf);void *rtw_cbuf_pop (struct rtw_cbuf *cbuf);struct rtw_cbuf *rtw_cbuf_alloc (u32 size); -/* String handler */ -/* -* Write formatted output to sized buffer -*/ -#define rtw_sprintf(buf, size, format, arg...) snprintf(buf, size, format, ##arg) -#endif
Signature · 1 line
2.53.0
PATCH v2 5/11 staging: rtl8723bs: Drop unused _kfree(...) declaration.
In reply to Priit LaesDrop unused _kfree() definition from header file.
--- drivers/staging/rtl8723bs/include/osdep_service.h | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service.h +0 -2
@@ -49,8 +49,6 @@extern int RTW_STATUS_CODE (int error_code); -void _kfree (u8 *pbuf,u32 sz); -int _rtw_netif_rx (struct net_device *ndev,struct sk_buff *skb);#define rtw_netif_rx (ndev, skb) _rtw_netif_rx(ndev, skb)
Signature · 1 line
2.53.0
PATCH v2 6/11 staging: rtl8723bs: Get rid of unused _rtw_init_queue
In reply to Priit LaesWhile _rtw_init_queue function was reworked ~4 years ago, there were still some leftovers in commented out code and also header file.
--- drivers/staging/rtl8723bs/core/rtw_recv.c | 3 --- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 1 - drivers/staging/rtl8723bs/core/rtw_xmit.c | 4 ---- drivers/staging/rtl8723bs/include/osdep_service.h | 2 -- 4 files changed, 10 deletions(-)
drivers/staging/rtl8723bs/core/rtw_recv.c +0 -3
@@ -21,9 +21,6 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)spin_lock_init (&psta_recvpriv->lock); -/* for (i = 0; i<MAX_RX_NUMBLKS; i++) */ -/* _rtw_init_queue(&psta_recvpriv->blk_strms[i]); */ -INIT_LIST_HEAD (&psta_recvpriv->defrag_q.queue);spin_lock_init (&psta_recvpriv->defrag_q.lock); }
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +0 -1
@@ -67,7 +67,6 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)spin_lock_init (&pstapriv->sta_hash_lock); -/* _rtw_init_queue(&pstapriv->asoc_q); */ pstapriv->asoc_sta_count =0 ;INIT_LIST_HEAD (&pstapriv->sleep_q.queue);spin_lock_init (&pstapriv->sleep_q.lock);
drivers/staging/rtl8723bs/core/rtw_xmit.c +0 -4
@@ -43,10 +43,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)init_completion (&pxmitpriv->xmit_comp);init_completion (&pxmitpriv->terminate_xmitthread_comp); -/* -* Please insert all the queue initialization using _rtw_init_queue below -*/ - pxmitpriv->adapter = padapter;INIT_LIST_HEAD (&pxmitpriv->be_pending.queue);
drivers/staging/rtl8723bs/include/osdep_service.h +0 -2
@@ -53,8 +53,6 @@ int _rtw_netif_rx(struct net_device *ndev, struct sk_buff *skb);#define rtw_netif_rx (ndev, skb) _rtw_netif_rx(ndev, skb) -extern void _rtw_init_queue (struct __queue *pqueue); -static inline void flush_signals_thread (void ) {if (signal_pending (current))
Signature · 1 line
2.53.0
PATCH v2 7/11 staging: rtl8723bs: Drop unused NDEV-related formatting macros
In reply to Priit LaesDrop unused NDEV_ARG, FUNC_NDEV_FMT and FUNC_NDEV_ARG macros.
--- drivers/staging/rtl8723bs/include/osdep_service_linux.h | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/rtl8723bs/include/osdep_service_linux.h +0 -3
@@ -98,10 +98,7 @@ static inline void rtw_netif_stop_queue(struct net_device *pnetdev)#define rtw_signal_process (pid, sig) kill_pid(find_vpid((pid)), (sig), 1) -#define NDEV_ARG (ndev) ndev->name#define ADPT_ARG (adapter) adapter->pnetdev->name -#define FUNC_NDEV_FMT "%s(%s)" -#define FUNC_NDEV_ARG (ndev) __func__, ndev->name#define FUNC_ADPT_FMT "%s(%s)"#define FUNC_ADPT_ARG (adapter) __func__, adapter->pnetdev->name
Signature · 1 line
2.53.0
PATCH v2 8/11 staging: rtl8723bs: Drop workqueue wrapper functions
In reply to Priit LaesReplace custom workqueue wrapper functions:
* _init_workitem -> INIT_WORK
* _cancel_workitem_sync -> cancel_work_sync
* _set_workitem -> schedule_work
--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 4 ++-- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 6 +++--- drivers/staging/rtl8723bs/hal/sdio_ops.c | 4 ++-- .../rtl8723bs/include/osdep_service_linux.h | 15 --------------- 4 files changed, 7 insertions(+), 22 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +2 -2
@@ -201,7 +201,7 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)atomic_set (&pevtpriv->event_seq,0 ); pevtpriv->evt_done_cnt =0 ; -_init_workitem (&pevtpriv->c2h_wk, c2h_wk_callback,NULL ); +INIT_WORK (&pevtpriv->c2h_wk, c2h_wk_callback); pevtpriv->c2h_wk_alive = false; pevtpriv->c2h_queue =rtw_cbuf_alloc (C2H_QUEUE_MAX_LEN +1 );if (!pevtpriv->c2h_queue)
@@ -212,7 +212,7 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)void _rtw_free_evt_priv (struct evt_priv *pevtpriv) { -_cancel_workitem_sync (&pevtpriv->c2h_wk); +cancel_work_sync (&pevtpriv->c2h_wk);while (pevtpriv->c2h_wk_alive)msleep (10 );
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +3 -3
@@ -670,7 +670,7 @@ static void pwr_rpwm_timeout_handler(struct timer_list *t)if ((pwrpriv->rpwm == pwrpriv->cpwm) || (pwrpriv->cpwm >=PS_STATE_S2 ))return ; -_set_workitem (&pwrpriv->rpwmtimeoutwi); +schedule_work (&pwrpriv->rpwmtimeoutwi); }static inline void register_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag)
@@ -971,11 +971,11 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)rtw_hal_set_hwreg (padapter,HW_VAR_SET_RPWM , (u8 *)(&pwrctrlpriv->rpwm)); -_init_workitem (&pwrctrlpriv->cpwm_event, cpwm_event_callback,NULL ); +INIT_WORK (&pwrctrlpriv->cpwm_event, cpwm_event_callback); pwrctrlpriv->brpwmtimeout = false; pwrctrlpriv->adapter = padapter; -_init_workitem (&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback,NULL ); +INIT_WORK (&pwrctrlpriv->rpwmtimeoutwi, rpwmtimeout_workitem_callback);timer_setup (&pwrctrlpriv->pwr_rpwm_timer, pwr_rpwm_timeout_handler,0 );timer_setup (&pwrctrlpriv->pwr_state_check_timer, pwr_state_check_handler,0 );
drivers/staging/rtl8723bs/hal/sdio_ops.c +2 -2
@@ -876,7 +876,7 @@ void sd_int_dpc(struct adapter *adapter)SdioLocalCmd52Read1Byte (adapter,SDIO_REG_HCPWM1_8723B ); -_set_workitem (&(pwrctl->cpwm_event)); +schedule_work (&(pwrctl->cpwm_event)); }if (hal->sdio_hisr &SDIO_HISR_TXERR ) {
@@ -912,7 +912,7 @@ void sd_int_dpc(struct adapter *adapter) }else {/* Error handling for malloc fail */ rtw_cbuf_push (adapter->evtpriv.c2h_queue,NULL ); -_set_workitem (&adapter->evtpriv.c2h_wk); +schedule_work (&adapter->evtpriv.c2h_wk); } }
drivers/staging/rtl8723bs/include/osdep_service_linux.h +0 -15
@@ -58,21 +58,6 @@ static inline void _set_timer(struct timer_list *ptimer, u32 delay_time)mod_timer (ptimer, (jiffies + (delay_time *HZ /1000 ))); } -static inline void _init_workitem (struct work_struct *pwork,void *pfunc,void *cntx) -{ -INIT_WORK (pwork, pfunc); -} - -static inline void _set_workitem (struct work_struct *pwork) -{ -schedule_work (pwork); -} - -static inline void _cancel_workitem_sync (struct work_struct *pwork) -{ -cancel_work_sync (pwork); -} -static inline int rtw_netif_queue_stopped (struct net_device *pnetdev) { return (netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 0)) &&
Signature · 1 line
2.53.0
PATCH v2 9/11 staging: rtl8273bs: Simplify regulatory initialization functions
In reply to Priit LaesSimplify code, by cutting out wrapper function in regulatory initialization code.
--- drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 27 +++----------------- 1 file changed, 4 insertions(+), 23 deletions(-)
drivers/staging/rtl8723bs/os_dep/wifi_regd.c +4 -23
@@ -91,40 +91,21 @@ static int _rtw_reg_notifier_apply(struct wiphy *wiphy,return 0 ; } -static const struct ieee80211_regdomain *_rtw_regdomain_select (struct -rtw_regulatory - *reg) -{ -return &rtw_regdom_rd; -} - -static void _rtw_regd_init_wiphy (struct rtw_regulatory *reg, -struct wiphy *wiphy, -void (*reg_notifier)(struct wiphy *wiphy, -struct -regulatory_request * - request)) +void rtw_regd_init (struct wiphy *wiphy, +void (*reg_notifier)(struct wiphy *wiphy, +struct regulatory_request *request)) { -const struct ieee80211_regdomain *regd; - wiphy->reg_notifier = reg_notifier; wiphy->regulatory_flags |=REGULATORY_CUSTOM_REG ; wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG ; wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS ; - regd =_rtw_regdomain_select (reg); -wiphy_apply_custom_regulatory (wiphy, regd); +wiphy_apply_custom_regulatory (wiphy, &rtw_regdom_rd);/* Hard code flags */ _rtw_reg_apply_flags (wiphy); -} -void rtw_regd_init (struct wiphy *wiphy, -void (*reg_notifier)(struct wiphy *wiphy, -struct regulatory_request *request)) -{ -_rtw_regd_init_wiphy (NULL , wiphy, reg_notifier); }void rtw_reg_notifier (struct wiphy *wiphy,struct regulatory_request *request)
Signature · 1 line
2.53.0
Re: [PATCH v2 09/11] staging: rtl8273bs: Simplify regulatory initialization functions
Quoted 5 lines · Priit Laes
Simplify code, by cutting out wrapper function in regulatory initialization code.
Signed-off-by Priit Laes <[email protected]>---
This would be easier to review if you did it in two patches:
[patch 1] delete _rtw_regdomain_select()
[patch 2] delete rtw_regd_init()
regards,
dan carpenter
PATCH v2 10/11 staging: rtl8723bs: Clean up wrapper functions
In reply to Priit LaesRemove wrapper functions in cmd queue handling.
--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 88 ++++++++----------- drivers/staging/rtl8723bs/include/cmd_osdep.h | 7 +- 2 files changed, 39 insertions(+), 56 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +38 -50
@@ -210,32 +210,6 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)return 0 ; } -void _rtw_free_evt_priv (struct evt_priv *pevtpriv) -{ -cancel_work_sync (&pevtpriv->c2h_wk); -while (pevtpriv->c2h_wk_alive) -msleep (10 ); - -while (!rtw_cbuf_empty (pevtpriv->c2h_queue)) { -void *c2h =rtw_cbuf_pop (pevtpriv->c2h_queue); - -if (c2h && c2h != (void *)pevtpriv) -kfree (c2h); - } -kfree (pevtpriv->c2h_queue); -} - -void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) -{ -if (pcmdpriv) { -kfree (pcmdpriv->cmd_allocated_buf); - -kfree (pcmdpriv->rsp_allocated_buf); - -mutex_destroy (&pcmdpriv->sctx_mutex); - } -} -/* * Calling Context: *
@@ -246,7 +220,7 @@ void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)* */ -int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) +static int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) {unsigned long irqL;
@@ -265,38 +239,35 @@ int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)return _SUCCESS; } -struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue) +void rtw_free_evt_priv (struct evt_priv *pevtpriv) { -unsigned long irqL; -struct cmd_obj *obj; - -/* spin_lock_bh(&(queue->lock)); */ -spin_lock_irqsave (&queue->lock, irqL); -if (list_empty (&queue->queue)) { - obj =NULL ; - }else { - obj = container_of(get_next(&queue->queue), struct cmd_obj, list); -list_del_init (&obj->list); - } +cancel_work_sync (&pevtpriv->c2h_wk); +while (pevtpriv->c2h_wk_alive) +msleep (10 ); -/* spin_unlock_bh(&(queue->lock)); */ -spin_unlock_irqrestore (&queue->lock, irqL); +while (!rtw_cbuf_empty (pevtpriv->c2h_queue)) { +void *c2h =rtw_cbuf_pop (pevtpriv->c2h_queue); -return obj; -} +if (c2h && c2h != (void *)pevtpriv) +kfree (c2h); + } +kfree (pevtpriv->c2h_queue); -void rtw_free_evt_priv (struct evt_priv *pevtpriv) -{ -_rtw_free_evt_priv (pevtpriv); }void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) { -_rtw_free_cmd_priv (pcmdpriv); +if (pcmdpriv) { +kfree (pcmdpriv->cmd_allocated_buf); + +kfree (pcmdpriv->rsp_allocated_buf); + +mutex_destroy (&pcmdpriv->sctx_mutex); + } + } -int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj); -int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj) +static int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj) {u8 bAllow = false;/* set to true to allow enqueuing cmd when hw_init_completed is false */
@@ -337,7 +308,24 @@ int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)struct cmd_obj *rtw_dequeue_cmd (struct cmd_priv *pcmdpriv) { -return _rtw_dequeue_cmd (&pcmdpriv->cmd_queue); +unsigned long irqL; +struct cmd_obj *obj; +struct __queue *queue = &pcmdpriv->cmd_queue; + +/* spin_lock_bh(&(queue->lock)); */ +spin_lock_irqsave (&queue->lock, irqL); +if (list_empty (&queue->queue)) { + obj =NULL ; + }else { + obj = container_of(get_next(&queue->queue), struct cmd_obj, list); +list_del_init (&obj->list); + } + +/* spin_unlock_bh(&(queue->lock)); */ +spin_unlock_irqrestore (&queue->lock, irqL); + +return obj; + }void rtw_free_cmd_obj (struct cmd_obj *pcmd)
drivers/staging/rtl8723bs/include/cmd_osdep.h +1 -6
@@ -7,12 +7,7 @@#ifndef __CMD_OSDEP_H_#define __CMD_OSDEP_H_ - -int rtw_init_cmd_priv (struct cmd_priv *pcmdpriv); +int rtw_init_cmd_priv (struct cmd_priv *pcmdpriv);int rtw_init_evt_priv (struct evt_priv *pevtpriv); -extern void _rtw_free_evt_priv (struct evt_priv *pevtpriv); -extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv); -int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj); -extern struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue);#endif
Signature · 1 line
2.53.0
Re: [PATCH v2 10/11] staging: rtl8723bs: Clean up wrapper functions
This change doesn’t really “remove wrapper functions” so much as it moves the wrapper bodies into the public APIs, and inlines |_rtw_dequeue_cmd()| into |rtw_dequeue_cmd()|.
Minor: the |if (pcmdpriv)| guard in |rtw_free_cmd_priv()| looks unnecessary if callers guarantee non-NULL. If you keep it, please point to call sites that can pass NULL (or drop the check).
Best, Vivek
Quoted 156 lines · Priit Laes
Remove wrapper functions in cmd queue handling.
Signed-off-by Priit Laes <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 88 ++++++++----------- drivers/staging/rtl8723bs/include/cmd_osdep.h | 7 +- 2 files changed, 39 insertions(+), 56 deletions(-)drivers/staging/rtl8723bs/core/rtw_cmd.c +38
-50@@ -210,32 +210,6 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)return 0 ; } -void _rtw_free_evt_priv (struct evt_priv *pevtpriv) -{ -cancel_work_sync (&pevtpriv->c2h_wk); -while (pevtpriv->c2h_wk_alive) -msleep (10 ); - -while (!rtw_cbuf_empty (pevtpriv->c2h_queue)) { -void *c2h =rtw_cbuf_pop (pevtpriv->c2h_queue); - -if (c2h && c2h != (void *)pevtpriv) -kfree (c2h); - } -kfree (pevtpriv->c2h_queue); -} - -void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) -{ -if (pcmdpriv) { -kfree (pcmdpriv->cmd_allocated_buf); - -kfree (pcmdpriv->rsp_allocated_buf); - -mutex_destroy (&pcmdpriv->sctx_mutex); - } -} -/* * Calling Context: * @@ -246,7 +220,7 @@ void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)* */ -int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) +static int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj) {unsigned long irqL;@@ -265,38 +239,35 @@ int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)return _SUCCESS; } -struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue) +void rtw_free_evt_priv (struct evt_priv *pevtpriv) { -unsigned long irqL; -struct cmd_obj *obj; - -/* spin_lock_bh(&(queue->lock)); */ -spin_lock_irqsave (&queue->lock, irqL); -if (list_empty (&queue->queue)) { - obj =NULL ; - }else { - obj = container_of(get_next(&queue->queue), struct cmd_obj, list); -list_del_init (&obj->list); - } +cancel_work_sync (&pevtpriv->c2h_wk); +while (pevtpriv->c2h_wk_alive) +msleep (10 ); -/* spin_unlock_bh(&(queue->lock)); */ -spin_unlock_irqrestore (&queue->lock, irqL); +while (!rtw_cbuf_empty (pevtpriv->c2h_queue)) { +void *c2h =rtw_cbuf_pop (pevtpriv->c2h_queue); -return obj; -} +if (c2h && c2h != (void *)pevtpriv) +kfree (c2h); + } +kfree (pevtpriv->c2h_queue); -void rtw_free_evt_priv (struct evt_priv *pevtpriv) -{ -_rtw_free_evt_priv (pevtpriv); }void rtw_free_cmd_priv (struct cmd_priv *pcmdpriv) { -_rtw_free_cmd_priv (pcmdpriv); +if (pcmdpriv) { +kfree (pcmdpriv->cmd_allocated_buf); + +kfree (pcmdpriv->rsp_allocated_buf); + +mutex_destroy (&pcmdpriv->sctx_mutex); + } + } -int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj); -int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj) +static int rtw_cmd_filter (struct cmd_priv *pcmdpriv,struct cmd_obj *cmd_obj) {u8 bAllow = false;/* set to true to allow enqueuing cmd when hw_init_completed is false */ @@ -337,7 +308,24 @@ int rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)struct cmd_obj *rtw_dequeue_cmd (struct cmd_priv *pcmdpriv) { -return _rtw_dequeue_cmd (&pcmdpriv->cmd_queue); +unsigned long irqL; +struct cmd_obj *obj; +struct __queue *queue = &pcmdpriv->cmd_queue; + +/* spin_lock_bh(&(queue->lock)); */ +spin_lock_irqsave (&queue->lock, irqL); +if (list_empty (&queue->queue)) { + obj =NULL ; + }else { + obj = container_of(get_next(&queue->queue), struct cmd_obj, list); +list_del_init (&obj->list); + } + +/* spin_unlock_bh(&(queue->lock)); */ +spin_unlock_irqrestore (&queue->lock, irqL); + +return obj; + }void rtw_free_cmd_obj (struct cmd_obj *pcmd)drivers/staging/rtl8723bs/include/cmd_osdep.h +1
-6@@ -7,12 +7,7 @@#ifndef __CMD_OSDEP_H_#define __CMD_OSDEP_H_ - -int rtw_init_cmd_priv (struct cmd_priv *pcmdpriv); +int rtw_init_cmd_priv (struct cmd_priv *pcmdpriv);int rtw_init_evt_priv (struct evt_priv *pevtpriv); -extern void _rtw_free_evt_priv (struct evt_priv *pevtpriv); -extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv); -int _rtw_enqueue_cmd (struct __queue *queue,struct cmd_obj *obj); -extern struct cmd_obj *_rtw_dequeue_cmd (struct __queue *queue);#endif
Re: [PATCH v2 10/11] staging: rtl8723bs: Clean up wrapper functions
In reply to Priit LaesQuoted 4 lines · Priit Laes
Remove wrapper functions in cmd queue handling.
Signed-off-by Priit Laes <[email protected]>---
Again, this would be easier to review if it were split into multiple patches.
[patch 1] delete commented out code [patch 2] move _rtw_free_evt_priv() [patch 3] move _rtw_free_cmd_priv() [patch 4] move _rtw_dequeue_cmd()
regards,
dan carpenter
A message that is not in the archive (sent off-list or not yet received): CAPsOcukZNc3oR=FmAjCdC6NrUV=1CaggQNGPoC2oxuH_P2R0hQ@mail.gmail.com
Re: [PATCH v2 10/11] staging: rtl8723bs: Clean up wrapper functions
Quoted 2 lines · Karthikey Kadati
This looks like AI-generated nonsense. Please stop wasting the community's time.
Please, do not top-post (top-reply).
Quoted 3 lines · Priit Laes,
Quoted 2 lines
Remove wrapper functions in cmd queue handling.
If so, this breaks AI/tools guidelines in the Linux kernel and must be NAKed, but how do you prove that this is AI?
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH v2 11/11 staging: rtl8723bs: rtw_ieee80211: Reduce global symbols
In reply to Priit LaesMark internally used symbols/functions as static and drop some unused ones.
WPA_CIPHER_SUITE_WRAP/RSN_CIPHER_SUITE_WRAP are left as commented, as these might be actually useful for understanding the code.
Changes since v1:
* Comment out unused variables WPA_CIPHER_SUITE_WRAP/RSN_CIPHER_SUITE_WRAP
--- .../staging/rtl8723bs/core/rtw_ieee80211.c | 41 +++++++++---------- drivers/staging/rtl8723bs/include/ieee80211.h | 30 -------------- 2 files changed, 19 insertions(+), 52 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +19 -22
@@ -11,26 +11,23 @@#include <linux/unaligned.h> u8 RTW_WPA_OUI_TYPE [] = {0x00 ,0x50 ,0xf2 ,1 }; -u16 RTW_WPA_VERSION =1 ; -u8 WPA_AUTH_KEY_MGMT_NONE [] = {0x00 ,0x50 ,0xf2 ,0 }; -u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X [] = {0x00 ,0x50 ,0xf2 ,1 }; -u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X [] = {0x00 ,0x50 ,0xf2 ,2 }; -u8 WPA_CIPHER_SUITE_NONE [] = {0x00 ,0x50 ,0xf2 ,0 }; -u8 WPA_CIPHER_SUITE_WEP40 [] = {0x00 ,0x50 ,0xf2 ,1 }; -u8 WPA_CIPHER_SUITE_TKIP [] = {0x00 ,0x50 ,0xf2 ,2 }; -u8 WPA_CIPHER_SUITE_WRAP [] = {0x00 ,0x50 ,0xf2 ,3 }; -u8 WPA_CIPHER_SUITE_CCMP [] = {0x00 ,0x50 ,0xf2 ,4 }; -u8 WPA_CIPHER_SUITE_WEP104 [] = {0x00 ,0x50 ,0xf2 ,5 }; - -u16 RSN_VERSION_BSD =1 ; -u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X [] = {0x00 ,0x0f ,0xac ,1 }; -u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X [] = {0x00 ,0x0f ,0xac ,2 }; -u8 RSN_CIPHER_SUITE_NONE [] = {0x00 ,0x0f ,0xac ,0 }; -u8 RSN_CIPHER_SUITE_WEP40 [] = {0x00 ,0x0f ,0xac ,1 }; -u8 RSN_CIPHER_SUITE_TKIP [] = {0x00 ,0x0f ,0xac ,2 }; -u8 RSN_CIPHER_SUITE_WRAP [] = {0x00 ,0x0f ,0xac ,3 }; -u8 RSN_CIPHER_SUITE_CCMP [] = {0x00 ,0x0f ,0xac ,4 }; -u8 RSN_CIPHER_SUITE_WEP104 [] = {0x00 ,0x0f ,0xac ,5 }; + +#define WPA_SELECTOR_LEN 4 +static const u8 WPA_CIPHER_SUITE_NONE [] = {0x00 ,0x50 ,0xf2 ,0 }; +static const u8 WPA_CIPHER_SUITE_WEP40 [] = {0x00 ,0x50 ,0xf2 ,1 }; +static const u8 WPA_CIPHER_SUITE_TKIP [] = {0x00 ,0x50 ,0xf2 ,2 }; +// static const u8 WPA_CIPHER_SUITE_WRAP[] = { 0x00, 0x50, 0xf2, 3 }; +static const u8 WPA_CIPHER_SUITE_CCMP [] = {0x00 ,0x50 ,0xf2 ,4 }; +static const u8 WPA_CIPHER_SUITE_WEP104 [] = {0x00 ,0x50 ,0xf2 ,5 }; + +#define RSN_SELECTOR_LEN 4 +static const u8 RSN_CIPHER_SUITE_NONE [] = {0x00 ,0x0f ,0xac ,0 }; +static const u8 RSN_CIPHER_SUITE_WEP40 [] = {0x00 ,0x0f ,0xac ,1 }; +static const u8 RSN_CIPHER_SUITE_TKIP [] = {0x00 ,0x0f ,0xac ,2 }; +// static const u8 RSN_CIPHER_SUITE_WRAP[] = { 0x00, 0x0f, 0xac, 3 }; +static const u8 RSN_CIPHER_SUITE_CCMP [] = {0x00 ,0x0f ,0xac ,4 }; +static const u8 RSN_CIPHER_SUITE_WEP104 [] = {0x00 ,0x0f ,0xac ,5 }; +/* */ /* for adhoc-master to generate ie and provide supported-rate to fw */ /* */
@@ -406,7 +403,7 @@ unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)return rtw_get_ie (pie,WLAN_EID_RSN , rsn_ie_len, limit); } -int rtw_get_wpa_cipher_suite (u8 *s) +static int rtw_get_wpa_cipher_suite (u8 *s) {if (!memcmp (s,WPA_CIPHER_SUITE_NONE ,WPA_SELECTOR_LEN ))return WPA_CIPHER_NONE ;
@@ -422,7 +419,7 @@ int rtw_get_wpa_cipher_suite(u8 *s)return 0 ; } -int rtw_get_wpa2_cipher_suite (u8 *s) +static int rtw_get_wpa2_cipher_suite (u8 *s) {if (!memcmp (s,RSN_CIPHER_SUITE_NONE ,RSN_SELECTOR_LEN ))return WPA_CIPHER_NONE ;
drivers/staging/rtl8723bs/include/ieee80211.h +0 -30
@@ -94,35 +94,7 @@ enum {#define WPA_CIPHER_TKIP BIT(3)#define WPA_CIPHER_CCMP BIT(4) - - -#define WPA_SELECTOR_LEN 4 -extern u8 RTW_WPA_OUI_TYPE []; -extern u16 RTW_WPA_VERSION ; -extern u8 WPA_AUTH_KEY_MGMT_NONE []; -extern u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X []; -extern u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X []; -extern u8 WPA_CIPHER_SUITE_NONE []; -extern u8 WPA_CIPHER_SUITE_WEP40 []; -extern u8 WPA_CIPHER_SUITE_TKIP []; -extern u8 WPA_CIPHER_SUITE_WRAP []; -extern u8 WPA_CIPHER_SUITE_CCMP []; -extern u8 WPA_CIPHER_SUITE_WEP104 []; - -#define RSN_HEADER_LEN 4 -#define RSN_SELECTOR_LEN 4 - -extern u16 RSN_VERSION_BSD ; -extern u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X []; -extern u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X []; -extern u8 RSN_CIPHER_SUITE_NONE []; -extern u8 RSN_CIPHER_SUITE_WEP40 []; -extern u8 RSN_CIPHER_SUITE_TKIP []; -extern u8 RSN_CIPHER_SUITE_WRAP []; -extern u8 RSN_CIPHER_SUITE_CCMP []; -extern u8 RSN_CIPHER_SUITE_WEP104 []; -enum {RATEID_IDX_BGN_40M_2SS =0 ,
@@ -740,8 +712,6 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode);unsigned char *rtw_get_wpa_ie (unsigned char *pie,int *wpa_ie_len,int limit);unsigned char *rtw_get_wpa2_ie (unsigned char *pie,int *rsn_ie_len,int limit); -int rtw_get_wpa_cipher_suite (u8 *s); -int rtw_get_wpa2_cipher_suite (u8 *s);int rtw_get_wapi_ie (u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len);int rtw_parse_wpa_ie (u8 *wpa_ie,int wpa_ie_len,int *group_cipher,int *pairwise_cipher,int *is_8021x);int rtw_parse_wpa2_ie (u8 *wpa_ie,int wpa_ie_len,int *group_cipher,int *pairwise_cipher,int *is_8021x);
Signature · 1 line
2.53.0
Re: [PATCH v2 11/11] staging: rtl8723bs: rtw_ieee80211: Reduce global symbols
Quoted 7 lines · Priit Laes
Mark internally used symbols/functions as static and drop some unused ones.
WPA_CIPHER_SUITE_WRAP/RSN_CIPHER_SUITE_WRAP are left as commented, as these might be actually useful for understanding the code.Changes since v1:
* Comment out unused variables WPA_CIPHER_SUITE_WRAP/RSN_CIPHER_SUITE_WRAP
Put this under the --- cut off line
Quoted 3 lines
Signed-off-by Priit Laes <[email protected]>---
^^^
Here.
But really we're not going to allow commented out code. Just delete it. There are reasons why people would merge dead code, such as for example, in some cases code needs legal approval and it's easier to get everything approved at once even when it's not needed immediately. But here we're not going to allow it.
This would be easier to review as separate patches:
[patch 1] Delete dead code.
[patch 2] make functions static
[patch 3] move the arrays and make them static const
regards,
dan carpenter