staging: r8188eu: combine both sides of conditional statement
authorRebecca Mckeever <remckee0@gmail.com>
Sun, 3 Apr 2022 19:17:05 +0000 (14:17 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Apr 2022 14:33:53 +0000 (16:33 +0200)
Both sides of conditional statement are the same except for the comment.
Additional instance found with git grep.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/d33c51bc3a20fa25e4737b258f3b1c42cc8124e3.1649011311.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_cmd.c

index da455eb4d8cbc9bbde13e76d552a62c46382a515..2d316a6c82947ef6eef80444636a3ca8c6d4754d 100644 (file)
@@ -1411,11 +1411,9 @@ void rtw_survey_cmd_callback(struct adapter *padapter,  struct cmd_obj *pcmd)
 {
        struct  mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-       if (pcmd->res == H2C_DROPPED) {
+       if (pcmd->res != H2C_SUCCESS) {
                /* TODO: cancel timer and do timeout handler directly... */
                _set_timer(&pmlmepriv->scan_to_timer, 1);
-       } else if (pcmd->res != H2C_SUCCESS) {
-               _set_timer(&pmlmepriv->scan_to_timer, 1);
        }
 
        /*  free cmd */
@@ -1445,11 +1443,9 @@ void rtw_joinbss_cmd_callback(struct adapter *padapter,  struct cmd_obj *pcmd)
 {
        struct  mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-       if (pcmd->res == H2C_DROPPED) {
+       if (pcmd->res != H2C_SUCCESS) {
                /* TODO: cancel timer and do timeout handler directly... */
                _set_timer(&pmlmepriv->assoc_timer, 1);
-       } else if (pcmd->res != H2C_SUCCESS) {
-               _set_timer(&pmlmepriv->assoc_timer, 1);
        }
 
        rtw_free_cmd_obj(pcmd);