staging: rtl8712: rtl871x_mp_ioctl: Remove unnecessary variables
PATCH 1/1 staging: rtl8712: rtl871x_mp_ioctl: Remove unnecessary variables
This patch removes the status variable from multiple functions since it is not required and can be replaced by single line of code.
Signed-off-by Amitoj Kaur Chawla <[email protected]>
--- drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 38 +++++++++++------------------- 1 file changed, 14 insertions(+), 24 deletions(-)
drivers/staging/rtl8712/rtl871x_mp_ioctl.c +14 -24
@@ -365,58 +365,49 @@ uint oid_rt_pro_set_tx_power_control_hdl(uint oid_rt_pro_query_tx_packet_sent_hdl (struct oid_par_priv *poid_par_priv) { -uint status =RNDIS_STATUS_SUCCESS ;struct _adapter *Adapter = poid_par_priv->adapter_context; -if (poid_par_priv->type_of_oid !=QUERY_OID ) { - status =RNDIS_STATUS_NOT_ACCEPTED ; -return status; - } +if (poid_par_priv->type_of_oid !=QUERY_OID ) +return RNDIS_STATUS_NOT_ACCEPTED ;if (poid_par_priv->information_buf_len ==sizeof (u32)) { *(u32 *)poid_par_priv->information_buf = Adapter->mppriv.tx_pktcount; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; }else - status =RNDIS_STATUS_INVALID_LENGTH ; -return status; +return RNDIS_STATUS_INVALID_LENGTH ; +return RNDIS_STATUS_SUCCESS ; }uint oid_rt_pro_query_rx_packet_received_hdl (struct oid_par_priv *poid_par_priv) { -uint status =RNDIS_STATUS_SUCCESS ;struct _adapter *Adapter = poid_par_priv->adapter_context; -if (poid_par_priv->type_of_oid !=QUERY_OID ) { - status =RNDIS_STATUS_NOT_ACCEPTED ; -return status; - } +if (poid_par_priv->type_of_oid !=QUERY_OID ) +return RNDIS_STATUS_NOT_ACCEPTED ;if (poid_par_priv->information_buf_len ==sizeof (u32)) { *(u32 *)poid_par_priv->information_buf = Adapter->mppriv.rx_pktcount; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; }else - status =RNDIS_STATUS_INVALID_LENGTH ; -return status; +return RNDIS_STATUS_INVALID_LENGTH ; +return RNDIS_STATUS_SUCCESS ; }uint oid_rt_pro_query_rx_packet_crc32_error_hdl (struct oid_par_priv *poid_par_priv) { -uint status =RNDIS_STATUS_SUCCESS ;struct _adapter *Adapter = poid_par_priv->adapter_context; -if (poid_par_priv->type_of_oid !=QUERY_OID ) { - status =RNDIS_STATUS_NOT_ACCEPTED ; -return status; - } +if (poid_par_priv->type_of_oid !=QUERY_OID ) +return RNDIS_STATUS_NOT_ACCEPTED ;if (poid_par_priv->information_buf_len ==sizeof (u32)) { *(u32 *)poid_par_priv->information_buf = Adapter->mppriv.rx_crcerrpktcount; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; }else - status =RNDIS_STATUS_INVALID_LENGTH ; -return status; +return RNDIS_STATUS_INVALID_LENGTH ; +return RNDIS_STATUS_SUCCESS ; } uint oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_priv
@@ -433,7 +424,6 @@ uint oid_rt_pro_reset_tx_packet_sent_hdl(struct oid_par_privuint oid_rt_pro_reset_rx_packet_received_hdl (struct oid_par_priv *poid_par_priv) { -uint status =RNDIS_STATUS_SUCCESS ;struct _adapter *Adapter = poid_par_priv->adapter_context;if (poid_par_priv->type_of_oid !=SET_OID )
@@ -442,8 +432,8 @@ uint oid_rt_pro_reset_rx_packet_received_hdl(struct oid_par_priv Adapter->mppriv.rx_pktcount =0 ; Adapter->mppriv.rx_crcerrpktcount =0 ; }else - status =RNDIS_STATUS_INVALID_LENGTH ; -return status; +return RNDIS_STATUS_INVALID_LENGTH ; +return RNDIS_STATUS_SUCCESS ; } uint oid_rt_reset_phy_rx_packet_count_hdl(struct oid_par_priv
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 7 lines · Amitoj Kaur Chawla
This patch removes the status variable from multiple functions since it is not required and can be replaced by single line of code.
Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 38 +++++++++++------------------- 1 file changed, 14 insertions(+), 24 deletions(-)
This patch didn't apply at all to my tree :(