Commit f89c7d57 authored by Wambui Karuga's avatar Wambui Karuga Committed by Greg Kroah-Hartman

staging: rtl8712: remove unnecessary return variables

Remove variables that are only used to hold and return constants and
have the functions directly return the constants.

Issue found by coccinelle:
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;
Signed-off-by: default avatarWambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/f61a0f036af24228c682c6b12c3a8e6cf6736185.1570918228.git.wambui.karugax@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 180245d2
...@@ -283,13 +283,12 @@ uint oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv) ...@@ -283,13 +283,12 @@ uint oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv)
{ {
struct _adapter *Adapter = (struct _adapter *) struct _adapter *Adapter = (struct _adapter *)
(poid_par_priv->adapter_context); (poid_par_priv->adapter_context);
uint status = RNDIS_STATUS_SUCCESS;
if (poid_par_priv->type_of_oid != SET_OID) if (poid_par_priv->type_of_oid != SET_OID)
return RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
if (mp_stop_test(Adapter) == _FAIL) if (mp_stop_test(Adapter) == _FAIL)
status = RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
return status; return RNDIS_STATUS_SUCCESS;
} }
uint oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv uint oid_rt_pro_set_channel_direct_call_hdl(struct oid_par_priv
...@@ -350,64 +349,58 @@ uint oid_rt_pro_set_tx_power_control_hdl( ...@@ -350,64 +349,58 @@ uint oid_rt_pro_set_tx_power_control_hdl(
uint oid_rt_pro_query_tx_packet_sent_hdl( uint oid_rt_pro_query_tx_packet_sent_hdl(
struct oid_par_priv *poid_par_priv) struct oid_par_priv *poid_par_priv)
{ {
uint status = RNDIS_STATUS_SUCCESS;
struct _adapter *Adapter = (struct _adapter *) struct _adapter *Adapter = (struct _adapter *)
(poid_par_priv->adapter_context); (poid_par_priv->adapter_context);
if (poid_par_priv->type_of_oid != QUERY_OID) { if (poid_par_priv->type_of_oid != QUERY_OID)
status = RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
return status;
}
if (poid_par_priv->information_buf_len == sizeof(u32)) { if (poid_par_priv->information_buf_len == sizeof(u32)) {
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.tx_pktcount; Adapter->mppriv.tx_pktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else { } else {
status = RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
} }
return status; return RNDIS_STATUS_SUCCESS;
} }
uint oid_rt_pro_query_rx_packet_received_hdl( uint oid_rt_pro_query_rx_packet_received_hdl(
struct oid_par_priv *poid_par_priv) struct oid_par_priv *poid_par_priv)
{ {
uint status = RNDIS_STATUS_SUCCESS;
struct _adapter *Adapter = (struct _adapter *) struct _adapter *Adapter = (struct _adapter *)
(poid_par_priv->adapter_context); (poid_par_priv->adapter_context);
if (poid_par_priv->type_of_oid != QUERY_OID) { if (poid_par_priv->type_of_oid != QUERY_OID)
status = RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
return status;
}
if (poid_par_priv->information_buf_len == sizeof(u32)) { if (poid_par_priv->information_buf_len == sizeof(u32)) {
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.rx_pktcount; Adapter->mppriv.rx_pktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else { } else {
status = RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
} }
return status; return RNDIS_STATUS_SUCCESS;
} }
uint oid_rt_pro_query_rx_packet_crc32_error_hdl( uint oid_rt_pro_query_rx_packet_crc32_error_hdl(
struct oid_par_priv *poid_par_priv) struct oid_par_priv *poid_par_priv)
{ {
uint status = RNDIS_STATUS_SUCCESS;
struct _adapter *Adapter = (struct _adapter *) struct _adapter *Adapter = (struct _adapter *)
(poid_par_priv->adapter_context); (poid_par_priv->adapter_context);
if (poid_par_priv->type_of_oid != QUERY_OID) { if (poid_par_priv->type_of_oid != QUERY_OID)
status = RNDIS_STATUS_NOT_ACCEPTED; return RNDIS_STATUS_NOT_ACCEPTED;
return status;
}
if (poid_par_priv->information_buf_len == sizeof(u32)) { if (poid_par_priv->information_buf_len == sizeof(u32)) {
*(u32 *)poid_par_priv->information_buf = *(u32 *)poid_par_priv->information_buf =
Adapter->mppriv.rx_crcerrpktcount; Adapter->mppriv.rx_crcerrpktcount;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
} else { } else {
status = RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
} }
return status; return RNDIS_STATUS_SUCCESS;
} }
uint oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv uint oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv
...@@ -425,7 +418,6 @@ uint oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv ...@@ -425,7 +418,6 @@ uint oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv
uint oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv uint oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv
*poid_par_priv) *poid_par_priv)
{ {
uint status = RNDIS_STATUS_SUCCESS;
struct _adapter *Adapter = (struct _adapter *) struct _adapter *Adapter = (struct _adapter *)
(poid_par_priv->adapter_context); (poid_par_priv->adapter_context);
...@@ -435,9 +427,9 @@ uint oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv ...@@ -435,9 +427,9 @@ uint oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv
Adapter->mppriv.rx_pktcount = 0; Adapter->mppriv.rx_pktcount = 0;
Adapter->mppriv.rx_crcerrpktcount = 0; Adapter->mppriv.rx_crcerrpktcount = 0;
} else { } else {
status = RNDIS_STATUS_INVALID_LENGTH; return RNDIS_STATUS_INVALID_LENGTH;
} }
return status; return RNDIS_STATUS_SUCCESS;
} }
uint oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv uint oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment