staging: rtl8712: clean up coding style issues
cover staging: rtl8712: clean up coding style issues
To fix style issues, this patchset removes blank lines, adds and removes spaces, and matches paretheses alignment.
Zhansaya Bagdauletkyzy (4):
staging: rtl8712: add spaces around operators
staging: rtl8712: match parentheses alignment
staging: rtl8712: remove extra blank lines
staging: rtl8712: remove spaces after a cast
drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 6 ++--- drivers/staging/rtl8712/rtl871x_recv.c | 22 +++++++++---------- drivers/staging/rtl8712/rtl871x_security.c | 10 ++++----- drivers/staging/rtl8712/rtl871x_security.h | 4 ++-- drivers/staging/rtl8712/rtl871x_xmit.h | 12 +++++----- drivers/staging/rtl8712/wifi.h | 2 +- drivers/staging/rtl8712/xmit_osdep.h | 8 +++---- 7 files changed, 31 insertions(+), 33 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/4 staging: rtl8712: add spaces around operators
Add spaces around operators to adhere to Linux kernel coding style. Reported by checkpatch.
--- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 ++-- drivers/staging/rtl8712/rtl871x_security.h | 4 ++-- drivers/staging/rtl8712/rtl871x_xmit.h | 10 +++++----- drivers/staging/rtl8712/wifi.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-)
drivers/staging/rtl8712/rtl871x_ioctl_linux.c +2 -2
@@ -144,7 +144,7 @@ static noinline_for_stack char *translate_scan_wpa(struct iw_request_info *info,for (i =0 ; i < wpa_len; i++) { n +=scnprintf (buf + n,MAX_WPA_IE_LEN - n,"%02x" , wpa_ie[i]); -if (n ==MAX_WPA_IE_LEN -1 ) +if (n ==MAX_WPA_IE_LEN -1 )break ; }memset (iwe,0 ,sizeof (*iwe));
@@ -164,7 +164,7 @@ static noinline_for_stack char *translate_scan_wpa(struct iw_request_info *info,for (i =0 ; i < rsn_len; i++) { n +=scnprintf (buf + n,MAX_WPA_IE_LEN - n,"%02x" , rsn_ie[i]); -if (n ==MAX_WPA_IE_LEN -1 ) +if (n ==MAX_WPA_IE_LEN -1 )break ; }memset (iwe,0 ,sizeof (*iwe));
drivers/staging/rtl8712/rtl871x_security.h +2 -2
@@ -101,7 +101,7 @@ struct security_priv {union pn48 Grprxpn;/* PN48 used for Grp Key recv. */ u8 wps_hw_pbc_pressed;/*for hw pbc pressed*/ u8 wps_phase;/*for wps*/ -u8 wps_ie[MAX_WPA_IE_LEN <<2 ]; +u8 wps_ie[MAX_WPA_IE_LEN <<2 ];int wps_ie_len;u8 binstallGrpkey;u8 busetkipkey;
@@ -185,7 +185,7 @@ do {\ txpn._byte_.TSC5 = iv[7 ];\ } while (0) -#define ROL32 (A , n) (((A) << (n)) | (((A)>>(32-(n))) & ((1UL << (n)) - 1))) +#define ROL32 (A , n) (((A) << (n)) | (((A) >> (32 - (n))) & ((1UL << (n)) - 1)))#define ROR32 (A , n) ROL32((A), 32 - (n))struct mic_data {
drivers/staging/rtl8712/rtl871x_xmit.h +5 -5
@@ -42,7 +42,7 @@ do { \ pattrib_iv[1 ] = txpn._byte_.TSC1;\ pattrib_iv[2 ] = txpn._byte_.TSC2;\ pattrib_iv[3 ] = ((keyidx &0x3 ) <<6 );\ - txpn.val = (txpn.val ==0xffffff ) ?0 : (txpn.val+1 );\ + txpn.val = (txpn.val ==0xffffff ) ?0 : (txpn.val +1 );\ }while (0 )/* Fixed the Big Endian bug when doing the Tx.
@@ -53,13 +53,13 @@ do { \ pattrib_iv[0 ] = txpn._byte_.TSC1;\ pattrib_iv[1 ] = (txpn._byte_.TSC1 |0x20 ) &0x7f ;\ pattrib_iv[2 ] = txpn._byte_.TSC0;\ - pattrib_iv[3 ] =BIT (5 ) | ((keyidx &0x3 )<<6 );\ + pattrib_iv[3 ] =BIT (5 ) | ((keyidx &0x3 ) <<6 );\ pattrib_iv[4 ] = txpn._byte_.TSC2;\ pattrib_iv[5 ] = txpn._byte_.TSC3;\ pattrib_iv[6 ] = txpn._byte_.TSC4;\ pattrib_iv[7 ] = txpn._byte_.TSC5;\ txpn.val = txpn.val ==0xffffffffffffULL ?0 : \ - (txpn.val+1 );\ + (txpn.val +1 );\ }while (0 ) #define AES_IV(pattrib_iv, txpn, keyidx)\
@@ -67,13 +67,13 @@ do { \ pattrib_iv[0 ] = txpn._byte_.TSC0;\ pattrib_iv[1 ] = txpn._byte_.TSC1;\ pattrib_iv[2 ] =0 ;\ - pattrib_iv[3 ] =BIT (5 ) | ((keyidx &0x3 )<<6 );\ + pattrib_iv[3 ] =BIT (5 ) | ((keyidx &0x3 ) <<6 );\ pattrib_iv[4 ] = txpn._byte_.TSC2;\ pattrib_iv[5 ] = txpn._byte_.TSC3;\ pattrib_iv[6 ] = txpn._byte_.TSC4;\ pattrib_iv[7 ] = txpn._byte_.TSC5;\ txpn.val = txpn.val ==0xffffffffffffULL ?0 : \ - (txpn.val+1 );\ + (txpn.val +1 );\ }while (0 ) struct hw_xmit {
drivers/staging/rtl8712/wifi.h +1 -1
@@ -26,7 +26,7 @@ enum WIFI_FRAME_TYPE {WIFI_MGT_TYPE = (0 ),WIFI_CTRL_TYPE = (BIT (2 )),WIFI_DATA_TYPE = (BIT (3 )), - WIFI_QOS_DATA_TYPE = (BIT(7)|BIT(3)), /*!< QoS Data */ + WIFI_QOS_DATA_TYPE = (BIT(7) | BIT(3)), /*!< QoS Data */ }; enum WIFI_FRAME_SUBTYPE {
Signature · 1 line
2.25.1
PATCH 2/4 staging: rtl8712: match parentheses alignment
In reply to Zhansaya BagdauletkyzyMatch next line with open parentheses by adding tabs/spaces to conform with Linux kernel coding style. Reported by checkpatch.
--- drivers/staging/rtl8712/rtl871x_recv.c | 22 +++++++++++----------- drivers/staging/rtl8712/rtl871x_xmit.h | 2 +- drivers/staging/rtl8712/xmit_osdep.h | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-)
drivers/staging/rtl8712/rtl871x_recv.c +11 -11
@@ -69,7 +69,7 @@ void _r8712_init_recv_priv(struct recv_priv *precvpriv,for (i =0 ; i <NR_RECVFRAME ; i++) {INIT_LIST_HEAD (&(precvframe->u.list));list_add_tail (&(precvframe->u.list), - &(precvpriv->free_recv_queue.queue)); + &(precvpriv->free_recv_queue.queue));r8712_os_recv_resource_alloc (padapter, precvframe); precvframe->u.hdr.adapter = padapter; precvframe++;
@@ -175,7 +175,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,if (bmic_err) {if (prxattrib->bdecrypted)r8712_handle_tkip_mic_err (adapter, - (u8 )is_multicast_ether_addr (prxattrib->ra)); + (u8 )is_multicast_ether_addr (prxattrib->ra)); res = _FAIL; }else {/* mic checked ok */
@@ -191,14 +191,14 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,/* decrypt and set the ivlen,icvlen of the recv_frame */ union recv_frame *r8712_decryptor (struct _adapter *padapter, -union recv_frame *precv_frame) +union recv_frame *precv_frame) {struct rx_pkt_attrib *prxattrib = &precv_frame->u.hdr.attrib;struct security_priv *psecuritypriv = &padapter->securitypriv;union recv_frame *return_packet = precv_frame;if ((prxattrib->encrypt >0 ) && ((prxattrib->bdecrypted ==0 ) || - psecuritypriv->sw_decrypt)) { + psecuritypriv->sw_decrypt)) { psecuritypriv->hw_decrypted = false;switch (prxattrib->encrypt) {case _WEP40_:
@@ -252,7 +252,7 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter, }else {/*free this frame*/ r8712_free_recvframe (precv_frame, - &adapter->recvpriv.free_recv_queue); + &adapter->recvpriv.free_recv_queue); prtnframe =NULL ; } }else {
@@ -274,7 +274,7 @@ union recv_frame *r8712_portctrl(struct _adapter *adapter, }static sint recv_decache (union recv_frame *precv_frame,u8 bretry, -struct stainfo_rxcache *prxcache) +struct stainfo_rxcache *prxcache) {sint tid = precv_frame->u.hdr.attrib.priority; u16 seq_ctrl = ((precv_frame->u.hdr.attrib.seq_num & 0xffff) << 4) |
@@ -393,7 +393,7 @@ static sint ap2sta_data_frame(struct _adapter *adapter,return _FAIL;/* check BSSID */ if (is_zero_ether_addr (pattrib->bssid) || -is_zero_ether_addr (mybssid) || +is_zero_ether_addr (mybssid) || (memcmp (pattrib->bssid, mybssid,ETH_ALEN )))return _FAIL;if (bmcast)
@@ -443,20 +443,20 @@ static sint sta2ap_data_frame(struct _adapter *adapter, }static sint validate_recv_ctrl_frame (struct _adapter *adapter, -union recv_frame *precv_frame) +union recv_frame *precv_frame) {return _FAIL; }static sint validate_recv_mgnt_frame (struct _adapter *adapter, -union recv_frame *precv_frame) +union recv_frame *precv_frame) {return _FAIL; }static sint validate_recv_data_frame (struct _adapter *adapter, -union recv_frame *precv_frame) +union recv_frame *precv_frame) {int res;u8 bretry;
@@ -602,7 +602,7 @@ int r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe) psnap_type = ptr + pattrib->hdrlen + pattrib->iv_len +SNAP_SIZE ;/* convert hdr + possible LLC headers into Ethernet header */ if ((!memcmp (psnap, (void *)rfc1042_header,SNAP_SIZE ) && - (memcmp (psnap_type, (void *)SNAP_ETH_TYPE_IPX ,2 )) && + (memcmp (psnap_type, (void *)SNAP_ETH_TYPE_IPX ,2 )) && (memcmp (psnap_type, (void *)SNAP_ETH_TYPE_APPLETALK_AARP ,2 ))) || !memcmp (psnap, (void *)bridge_tunnel_header,SNAP_SIZE )) {/* remove RFC1042 or Bridge-Tunnel encapsulation and
drivers/staging/rtl8712/rtl871x_xmit.h +1 -1
@@ -280,7 +280,7 @@ void r8712_xmit_direct(struct _adapter *padapter, struct xmit_frame *pxmitframe)void r8712_xmit_bh (struct tasklet_struct *t);void xmitframe_xmitbuf_attach (struct xmit_frame *pxmitframe, -struct xmit_buf *pxmitbuf); +struct xmit_buf *pxmitbuf);#include "rtl8712_xmit.h"
drivers/staging/rtl8712/xmit_osdep.h +4 -4
@@ -37,16 +37,16 @@ struct xmit_buf;int r8712_xmit_entry (_pkt *pkt,struct net_device *pnetdev);void r8712_SetFilter (struct work_struct *work);int r8712_xmit_resource_alloc (struct _adapter *padapter, -struct xmit_buf *pxmitbuf); +struct xmit_buf *pxmitbuf);void r8712_xmit_resource_free (struct _adapter *padapter, -struct xmit_buf *pxmitbuf); +struct xmit_buf *pxmitbuf);void r8712_set_qos (struct pkt_file *ppktfile, -struct pkt_attrib *pattrib); +struct pkt_attrib *pattrib);void _r8712_open_pktfile (_pkt *pktptr,struct pkt_file *pfile);uint _r8712_pktfile_read (struct pkt_file *pfile,u8 *rmem,uint rlen);sint r8712_endofpktfile (struct pkt_file *pfile);void r8712_xmit_complete (struct _adapter *padapter, -struct xmit_frame *pxframe); +struct xmit_frame *pxframe);#endif
Signature · 1 line
2.25.1
PATCH 3/4 staging: rtl8712: remove extra blank lines
In reply to Zhansaya BagdauletkyzyRemove extra blank lines to conform with Linux kernel coding style. Reported by checkpatch.
--- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/rtl8712/rtl871x_ioctl_linux.c +0 -2
@@ -36,14 +36,12 @@#include <linux/if_arp.h> #include <linux/etherdevice.h> -#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 0x1E)#define SCAN_ITEM_SIZE 768#define MAX_CUSTOM_LEN 64#define RATE_COUNT 4 -static const u32 rtl8180_rates[] = {1000000 ,2000000 ,5500000 ,11000000 ,6000000 ,9000000 ,12000000 ,18000000 ,24000000 ,36000000 ,48000000 ,54000000 };
Signature · 1 line
2.25.1
PATCH 4/4 staging: rtl8712: Remove spaces after a cast
In reply to Zhansaya BagdauletkyzyRemove extra spaces after a cast to conform with Linux kernel coding style.
Reported by checkpatch.
--- drivers/staging/rtl8712/rtl871x_security.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8712/rtl871x_security.c +5 -5
@@ -259,7 +259,7 @@ static void secmicputuint32(u8 *p, u32 val)long i;for (i =0 ; i <4 ; i++) { - *p++ = (u8) (val &0xff ); + *p++ = (u8)(val &0xff ); val >>=8 ; } }
@@ -907,8 +907,8 @@ static void construct_mic_iv(u8 *mic_iv, sint qc_exists, sint a4_exists, mic_iv[i] = mpdu[i +8 ];for (i =8 ; i <14 ; i++) mic_iv[i] = pn_vector[13 - i];/* mic_iv[8:13] = PN[5:0] */ - mic_iv[14 ] = (unsigned char ) (payload_length /256 ); - mic_iv[15 ] = (unsigned char ) (payload_length %256 ); + mic_iv[14 ] = (unsigned char )(payload_length /256 ); + mic_iv[15 ] = (unsigned char )(payload_length %256 ); }/************************************************/
@@ -995,8 +995,8 @@ static void construct_ctr_preload(u8 *ctr_preload, ctr_preload[i] = mpdu[i +8 ];for (i =8 ; i <14 ; i++) ctr_preload[i] = pn_vector[13 - i]; - ctr_preload[14 ] = (unsigned char ) (c /256 );/* Ctr */ - ctr_preload[15 ] = (unsigned char ) (c %256 ); + ctr_preload[14 ] = (unsigned char )(c /256 );/* Ctr */ + ctr_preload[15 ] = (unsigned char )(c %256 ); }/************************************/
Signature · 1 line
2.25.1