staging: rtl8712: Compress return logic into one line
PATCH 1/1 staging: rtl8712: Compress return logic into one line
Simplified function return by merging assignment and return into one line.
Found with Coccinelle.
@@ expression ex, r; @@
-r =
+return
ex;
-return r;
Signed-off-by Bhaktipriya Shridhar <[email protected]>
--- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 +--- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 3 +-- drivers/staging/rtl8712/rtl871x_mp.c | 3 +-- drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 9 +++------ 4 files changed, 6 insertions(+), 13 deletions(-)
drivers/staging/rtl8712/rtl871x_ioctl_linux.c +1 -3
@@ -329,9 +329,7 @@ static inline char *translate_scan(struct _adapter *padapter, iwe.u.qual.level = rssi;/* signal strength */ iwe.u.qual.qual =0 ;/* signal quality */ iwe.u.qual.noise =0 ;/* noise level */ - start =iwe_stream_add_event (info, start, stop, &iwe,IW_EV_QUAL_LEN ); -/* how to translate rssi to ?% */ -return start; +return iwe_stream_add_event (info, start, stop, &iwe,IW_EV_QUAL_LEN ); }static int wpa_set_auth_algs (struct net_device *dev,u32 value)
drivers/staging/rtl8712/rtl871x_ioctl_set.c +1 -2
@@ -131,8 +131,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)struct mlme_priv *pmlmepriv = &padapter->mlmepriv;if (is_zero_ether_addr (bssid) ||is_broadcast_ether_addr (bssid)) { - status = false; -return status; +return false; }spin_lock_irqsave (&pmlmepriv->lock, irqL); if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY |
drivers/staging/rtl8712/rtl871x_mp.c +1 -2
@@ -715,8 +715,7 @@ static u32 GetPhyRxPktCounts(struct _adapter *pAdapter, u32 selbit) phyrx_set |= (SelectBit &0xF0000000 );r8712_write32 (pAdapter,RXERR_RPT , phyrx_set);/*Read packet count*/ - count =r8712_read32 (pAdapter,RXERR_RPT ) & RPTMaxCount; -return count; +return r8712_read32 (pAdapter,RXERR_RPT ) & RPTMaxCount; }u32 r8712_GetPhyRxPktReceived (struct _adapter *pAdapter)
drivers/staging/rtl8712/rtl871x_mp_ioctl.c +3 -6
@@ -383,8 +383,7 @@ uint oid_rt_pro_query_tx_packet_sent_hdl( (poid_par_priv->adapter_context);if (poid_par_priv->type_of_oid !=QUERY_OID ) { - status =RNDIS_STATUS_NOT_ACCEPTED ; -return status; +return RNDIS_STATUS_NOT_ACCEPTED ; }if (poid_par_priv->information_buf_len ==sizeof (u32)) { *(u32 *)poid_par_priv->information_buf =
@@ -404,8 +403,7 @@ uint oid_rt_pro_query_rx_packet_received_hdl( (poid_par_priv->adapter_context);if (poid_par_priv->type_of_oid !=QUERY_OID ) { - status =RNDIS_STATUS_NOT_ACCEPTED ; -return status; +return RNDIS_STATUS_NOT_ACCEPTED ; }if (poid_par_priv->information_buf_len ==sizeof (u32)) { *(u32 *)poid_par_priv->information_buf =
@@ -425,8 +423,7 @@ uint oid_rt_pro_query_rx_packet_crc32_error_hdl( (poid_par_priv->adapter_context);if (poid_par_priv->type_of_oid !=QUERY_OID ) { - status =RNDIS_STATUS_NOT_ACCEPTED ; -return status; +return RNDIS_STATUS_NOT_ACCEPTED ; }if (poid_par_priv->information_buf_len ==sizeof (u32)) { *(u32 *)poid_par_priv->information_buf =
--
2.1.4