* [PATCH v2 0/3] Fix some style issues
@ 2017-06-13 5:49 Aviya Erenfeld
2017-06-13 5:50 ` [PATCH v2 1/3] staging: rtl8188eu: Remove redundant parenthesis Aviya Erenfeld
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Aviya Erenfeld @ 2017-06-13 5:49 UTC (permalink / raw)
To: gregkh, goudapatilk, insafonov; +Cc: devel, linux-kernel
Fix some of the issues that checkpatch complains on like redundant
parenthesis, redundant blank lines and lines over 80 chars.
Aviya Erenfeld (3):
staging: rtl8188eu: Remove redundant parenthesis
staging: rtl8188eu: Remove unneeded blank lines
staging: rtl8188eu: Shorten lines over 80 chars
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 88 ++++++++++++++++------------
1 file changed, 50 insertions(+), 38 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/3] staging: rtl8188eu: Remove redundant parenthesis
2017-06-13 5:49 [PATCH v2 0/3] Fix some style issues Aviya Erenfeld
@ 2017-06-13 5:50 ` Aviya Erenfeld
2017-06-13 9:22 ` Greg KH
2017-06-13 5:51 ` [PATCH v2 2/3] staging: rtl8188eu: Remove unneeded blank lines Aviya Erenfeld
2017-06-13 5:52 ` [PATCH v2 3/3] staging: rtl8188eu: Shorten lines over 80 chars Aviya Erenfeld
2 siblings, 1 reply; 6+ messages in thread
From: Aviya Erenfeld @ 2017-06-13 5:50 UTC (permalink / raw)
To: gregkh, goudapatilk, insafonov; +Cc: devel, linux-kernel
Remove redundant parenthesis
Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
---
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index 2ecfb11..c6a7df5 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -91,7 +91,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
for (i = 0; i < NUM_STA; i++) {
_rtw_init_stainfo(psta);
- INIT_LIST_HEAD(&(pstapriv->sta_hash[i]));
+ INIT_LIST_HEAD(&pstapriv->sta_hash[i]);
list_add_tail(&psta->list, get_list_head(&pstapriv->free_sta_queue));
@@ -149,7 +149,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
/* delete all reordering_ctrl_timer */
spin_lock_bh(&pstapriv->sta_hash_lock);
for (index = 0; index < NUM_STA; index++) {
- phead = &(pstapriv->sta_hash[index]);
+ phead = &pstapriv->sta_hash[index];
plist = phead->next;
while (phead != plist) {
@@ -278,19 +278,19 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
- list_del_init(&(pstaxmitpriv->vo_q.tx_pending));
+ list_del_init(&pstaxmitpriv->vo_q.tx_pending);
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
- list_del_init(&(pstaxmitpriv->vi_q.tx_pending));
+ list_del_init(&pstaxmitpriv->vi_q.tx_pending);
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
- list_del_init(&(pstaxmitpriv->bk_q.tx_pending));
+ list_del_init(&pstaxmitpriv->bk_q.tx_pending);
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
- list_del_init(&(pstaxmitpriv->be_q.tx_pending));
+ list_del_init(&pstaxmitpriv->be_q.tx_pending);
spin_unlock_bh(&pxmitpriv->lock);
@@ -331,7 +331,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
plist = plist->next;
- list_del_init(&(prframe->list));
+ list_del_init(&prframe->list);
rtw_free_recvframe(prframe, pfree_recv_queue);
}
@@ -375,7 +375,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
#endif /* CONFIG_88EU_AP_MODE */
- spin_lock_bh(&(pfree_sta_queue->lock));
+ spin_lock_bh(&pfree_sta_queue->lock);
list_add_tail(&psta->list, get_list_head(pfree_sta_queue));
spin_unlock_bh(&pfree_sta_queue->lock);
@@ -401,7 +401,7 @@ void rtw_free_all_stainfo(struct adapter *padapter)
spin_lock_bh(&pstapriv->sta_hash_lock);
for (index = 0; index < NUM_STA; index++) {
- phead = &(pstapriv->sta_hash[index]);
+ phead = &pstapriv->sta_hash[index];
plist = phead->next;
while (phead != plist) {
@@ -438,7 +438,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
spin_lock_bh(&pstapriv->sta_hash_lock);
- phead = &(pstapriv->sta_hash[index]);
+ phead = &pstapriv->sta_hash[index];
plist = phead->next;
while (phead != plist) {
@@ -497,7 +497,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
struct __queue *pacl_node_q = &pacl_list->acl_node_q;
- spin_lock_bh(&(pacl_node_q->lock));
+ spin_lock_bh(&pacl_node_q->lock);
phead = get_list_head(pacl_node_q);
plist = phead->next;
while (phead != plist) {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] staging: rtl8188eu: Remove unneeded blank lines
2017-06-13 5:49 [PATCH v2 0/3] Fix some style issues Aviya Erenfeld
2017-06-13 5:50 ` [PATCH v2 1/3] staging: rtl8188eu: Remove redundant parenthesis Aviya Erenfeld
@ 2017-06-13 5:51 ` Aviya Erenfeld
2017-06-13 5:52 ` [PATCH v2 3/3] staging: rtl8188eu: Shorten lines over 80 chars Aviya Erenfeld
2 siblings, 0 replies; 6+ messages in thread
From: Aviya Erenfeld @ 2017-06-13 5:51 UTC (permalink / raw)
To: gregkh, goudapatilk, insafonov; +Cc: devel, linux-kernel
Remove unneeded blank lines
Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
---
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index c6a7df5..cd348ca 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -61,7 +61,6 @@ static void _rtw_init_stainfo(struct sta_info *psta)
psta->keep_alive_trycnt = 0;
#endif /* CONFIG_88EU_AP_MODE */
-
}
u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
@@ -69,7 +68,6 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
struct sta_info *psta;
s32 i;
-
pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4);
if (!pstapriv->pallocated_stainfo_buf)
@@ -116,7 +114,6 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
pstapriv->max_num_sta = NUM_STA;
#endif
-
return _SUCCESS;
}
@@ -263,7 +260,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct sta_priv *pstapriv = &padapter->stapriv;
-
if (!psta)
goto exit;
@@ -381,7 +377,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
exit:
-
return _SUCCESS;
}
@@ -394,7 +389,6 @@ void rtw_free_all_stainfo(struct adapter *padapter)
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *pbcmc_stainfo = rtw_get_bcmc_stainfo(padapter);
-
if (pstapriv->asoc_sta_count == 1)
return;
@@ -425,7 +419,6 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
u8 *addr;
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
if (!hwaddr)
return NULL;
@@ -463,7 +456,6 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
unsigned char bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
struct sta_priv *pstapriv = &padapter->stapriv;
-
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
if (!psta) {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 3/3] staging: rtl8188eu: Shorten lines over 80 chars
2017-06-13 5:49 [PATCH v2 0/3] Fix some style issues Aviya Erenfeld
2017-06-13 5:50 ` [PATCH v2 1/3] staging: rtl8188eu: Remove redundant parenthesis Aviya Erenfeld
2017-06-13 5:51 ` [PATCH v2 2/3] staging: rtl8188eu: Remove unneeded blank lines Aviya Erenfeld
@ 2017-06-13 5:52 ` Aviya Erenfeld
2017-06-13 6:03 ` Joe Perches
2 siblings, 1 reply; 6+ messages in thread
From: Aviya Erenfeld @ 2017-06-13 5:52 UTC (permalink / raw)
To: gregkh, goudapatilk, insafonov; +Cc: devel, linux-kernel
Shorten lines over 80 chars
Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
---
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 58 +++++++++++++++++++---------
1 file changed, 39 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
index cd348ca..c924c9e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
@@ -68,7 +68,8 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
struct sta_info *psta;
s32 i;
- pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4);
+ pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) *
+ NUM_STA + 4);
if (!pstapriv->pallocated_stainfo_buf)
return _FAIL;
@@ -91,7 +92,8 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
INIT_LIST_HEAD(&pstapriv->sta_hash[i]);
- list_add_tail(&psta->list, get_list_head(&pstapriv->free_sta_queue));
+ list_add_tail(&psta->list,
+ get_list_head(&pstapriv->free_sta_queue));
psta++;
}
@@ -119,20 +121,25 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
{
- int offset = (((u8 *)sta) - stapriv->pstainfo_buf)/sizeof(struct sta_info);
+ int offset = (((u8 *)sta) - stapriv->pstainfo_buf) /
+ sizeof(struct sta_info);
if (!stainfo_offset_valid(offset))
- DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
+ DBG_88E("%s invalid offset(%d), out of range!!!",
+ __func__, offset);
return offset;
}
-inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
+inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv,
+ int offset)
{
if (!stainfo_offset_valid(offset))
- DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
+ DBG_88E("%s invalid offset(%d), out of range!!!",
+ __func__, offset);
- return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
+ return (struct sta_info *)(stapriv->pstainfo_buf +
+ offset * sizeof(struct sta_info));
}
u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
@@ -157,7 +164,8 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
plist = plist->next;
for (i = 0; i < 16; i++) {
- preorder_ctrl = &psta->recvreorder_ctrl[i];
+ preorder_ctrl =
+ &psta->recvreorder_ctrl[i];
del_timer_sync(&preorder_ctrl->reordering_ctrl_timer);
}
}
@@ -194,9 +202,11 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
_rtw_init_stainfo(psta);
memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
index = wifi_mac_hash(hwaddr);
- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, ("rtw_alloc_stainfo: index=%x", index));
+ RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_,
+ ("rtw_alloc_stainfo: index=%x", index));
if (index >= NUM_STA) {
- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("ERROR => rtw_alloc_stainfo: index >= NUM_STA"));
+ RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_,
+ ("ERROR => rtw_alloc_stainfo: index >= NUM_STA"));
psta = NULL;
goto exit;
}
@@ -208,12 +218,16 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
spin_unlock_bh(&pstapriv->sta_hash_lock);
/* Commented by Albert 2009/08/13 */
-/* For the SMC router, the sequence number of first packet of WPS handshake will be 0. */
-/* In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable. */
-/* So, we initialize the tid_rxseq variable as the 0xffff. */
+/* For the SMC router, the sequence number of first packet of WPS handshake
+ * will be 0.
+ * In this case, this packet will be dropped by recv_decache function if we use
+ * the 0x00 as the default value for tid_rxseq variable.
+ * So, we initialize the tid_rxseq variable as the 0xffff.
+ */
for (i = 0; i < 16; i++)
- memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
+ memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i],
+ &wRxSeqInitialValue, 2);
RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_,
("alloc number_%d stainfo with hwaddr = %pM\n",
@@ -304,18 +318,22 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
del_timer_sync(&psta->addba_retry_timer);
- /* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
+ /* for A-MPDU Rx reordering buffer control,
+ * cancel reordering_ctrl_timer
+ */
for (i = 0; i < 16; i++) {
struct list_head *phead, *plist;
struct recv_frame *prframe;
struct __queue *ppending_recvframe_queue;
- struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
+ struct __queue *pfree_recv_queue =
+ &padapter->recvpriv.free_recv_queue;
preorder_ctrl = &psta->recvreorder_ctrl[i];
del_timer_sync(&preorder_ctrl->reordering_ctrl_timer);
- ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
+ ppending_recvframe_queue =
+ &preorder_ctrl->pending_recvframe_queue;
spin_lock_bh(&ppending_recvframe_queue->lock);
@@ -453,14 +471,16 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
{
struct sta_info *psta;
u32 res = _SUCCESS;
- unsigned char bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+ unsigned char bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff};
struct sta_priv *pstapriv = &padapter->stapriv;
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
if (!psta) {
res = _FAIL;
- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail"));
+ RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_,
+ ("rtw_alloc_stainfo fail"));
goto exit;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 3/3] staging: rtl8188eu: Shorten lines over 80 chars
2017-06-13 5:52 ` [PATCH v2 3/3] staging: rtl8188eu: Shorten lines over 80 chars Aviya Erenfeld
@ 2017-06-13 6:03 ` Joe Perches
0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2017-06-13 6:03 UTC (permalink / raw)
To: Aviya Erenfeld, gregkh, goudapatilk, insafonov; +Cc: devel, linux-kernel
On Tue, 2017-06-13 at 08:52 +0300, Aviya Erenfeld wrote:
> Shorten lines over 80 chars
Most of these changes are not useful.
Style nits if 80 columns are _really_ desired.
> diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
[]
> @@ -157,7 +164,8 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
> plist = plist->next;
>
> for (i = 0; i < 16; i++) {
> - preorder_ctrl = &psta->recvreorder_ctrl[i];
> + preorder_ctrl =
> + &psta->recvreorder_ctrl[i];
> del_timer_sync(&preorder_ctrl->reordering_ctrl_timer);
This is harder to read.
> @@ -453,14 +471,16 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
> {
> struct sta_info *psta;
> u32 res = _SUCCESS;
> - unsigned char bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> + unsigned char bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff,
> + 0xff};
More common would be
unsigned char bcast_addr[ETH_ALEN] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
Better still would be to use static const.
Best would be to see if bcast_addr is needed at all.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/3] staging: rtl8188eu: Remove redundant parenthesis
2017-06-13 5:50 ` [PATCH v2 1/3] staging: rtl8188eu: Remove redundant parenthesis Aviya Erenfeld
@ 2017-06-13 9:22 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2017-06-13 9:22 UTC (permalink / raw)
To: Aviya Erenfeld; +Cc: goudapatilk, insafonov, devel, linux-kernel
On Tue, Jun 13, 2017 at 08:50:38AM +0300, Aviya Erenfeld wrote:
> Remove redundant parenthesis
>
> Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
> ---
> drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
> index 2ecfb11..c6a7df5 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c
> @@ -91,7 +91,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
> for (i = 0; i < NUM_STA; i++) {
> _rtw_init_stainfo(psta);
>
> - INIT_LIST_HEAD(&(pstapriv->sta_hash[i]));
> + INIT_LIST_HEAD(&pstapriv->sta_hash[i]);
What complaines about these? Does checkpatch? Or something else?
It makes sense why they were added, don't you think so? It makes the
code easier to understand in some places.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-06-13 9:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 5:49 [PATCH v2 0/3] Fix some style issues Aviya Erenfeld
2017-06-13 5:50 ` [PATCH v2 1/3] staging: rtl8188eu: Remove redundant parenthesis Aviya Erenfeld
2017-06-13 9:22 ` Greg KH
2017-06-13 5:51 ` [PATCH v2 2/3] staging: rtl8188eu: Remove unneeded blank lines Aviya Erenfeld
2017-06-13 5:52 ` [PATCH v2 3/3] staging: rtl8188eu: Shorten lines over 80 chars Aviya Erenfeld
2017-06-13 6:03 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).