Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3552207pxb; Mon, 4 Apr 2022 21:01:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG1+AWmwXGEIwRcxJAU0GLht0RFqNJsP0+kMlV5WgwkX8pkNxmix68lYxxqDgQmDQJBiJu X-Received: by 2002:a17:90a:cf94:b0:1ca:7ff9:73eb with SMTP id i20-20020a17090acf9400b001ca7ff973ebmr1725096pju.173.1649131291835; Mon, 04 Apr 2022 21:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649131291; cv=none; d=google.com; s=arc-20160816; b=XKGOs/LEEYedbK630bmRMbPyhalDFqCz8zj35WY82o9nMF0UcYPi6tOfjTFVef5Wnw eYcJTJx7gmO/0Z95o1nSYXZdYR+0Sw4h88i9Tangw5SbOgypB1Krmgz9XBC//2JJd2R4 uut1LwI21d9M/11wo9FHmOczf056GIrVUiIydXRL3g4EKLTRsVlptyZp1kH9W0lZd32p G/2hF4wgCC5rKM+kjyBYAvirqcfv+mDU5OrqjQgAdRM+DsQo7jzXqbf/lkVq4EKhRH+e y9HGxHmxpA9VZvlaTiqi3W0SZ1AlbmC5vKCLO3P/A05mIR7Zyku4z5m1VfSqsd47t6C1 GMTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BJ7cxaRbKAyhta/oCZgwB/x5LwxJCNvCW+2zU0E+Y5k=; b=bd4EeF1T0aRQcMk96+AsjGrnXNdNr7Z9X4QwLWYq56c4fTYjYmV8Uh9rLHhkZjCYPf 8vH0jV7lAWOteemu8DX9w/oI91M7g9YWKVS6b80k6C15c8yHO4bKmET06PlP3wuz+o+W pXVcMlIQboJ+lgBVZsrbAFGGRNTdkODVn6B6RuWcsOSrq5G3/FHp7bpOxbpU0GZ8nFxw euFFp/LIRtoOoLLf8OZtXdUrY8WdzOpfnJh+fScVqD4Hw1c4IjYJKiCBhuDW+dLTDLe9 DXLHQlcX/A/d0d++Y9OttjyKyjVSxUcrOthCMouxjSG0svuacD2HhiV0HaYs0v3qynNG eWFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dLrvpeKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t11-20020aa7938b000000b004fa3a8e00bdsi10919728pfe.372.2022.04.04.21.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 21:01:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dLrvpeKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 928002D1DE; Mon, 4 Apr 2022 20:16:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbiDEDS1 (ORCPT + 99 others); Mon, 4 Apr 2022 23:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230094AbiDEDSZ (ORCPT ); Mon, 4 Apr 2022 23:18:25 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B16C2127E for ; Mon, 4 Apr 2022 20:16:27 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id d65so9355747qke.5 for ; Mon, 04 Apr 2022 20:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BJ7cxaRbKAyhta/oCZgwB/x5LwxJCNvCW+2zU0E+Y5k=; b=dLrvpeKHnrI4N6WvNfn5wDAyi72w2XOW2Mz/qI5cv1XUUQWXGaO9inRaDEi7Oqd/KS vGTTjjbhJY7145KVMP8yvYLXqhM5YnUE4iMR1Dh6c9sh/UgBSpCj8E518TPycQjAoWhW VZp07I0ymE9fe/Digyt/eaGQeF37a/2bcTkw5wV/wD63V/036+iRBbGTXmTwwToCtLIq ZO9+1izSrSKthLDV0JYulJaKHchtlkvFUNptFmBtZtc1xhuxoRrBKVrTX3UQ4bJ4re3T F4EPI6SX1UYKDf9htTVtbDlMyo5R0KYBEEsN08Jur/QDF7lubt93Bf5TiA6TR7Z+5GLa kz9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BJ7cxaRbKAyhta/oCZgwB/x5LwxJCNvCW+2zU0E+Y5k=; b=WtV41IrNnHm39BtMFujbhDfW5DfKWB8D+1b4ZK23fEZOGZ8ZgwNmMSzgkQuThqabf7 YKNjtWwDYNYl50mt7tJJgf+z7CFUJ+ZgopgJlv6f+8HhOPe+i7cPFVdfJKGYRN3QgXXV Jl/nZQYPChzrq8A82WgBwUvsIh8ogVIpdUMgocJJ5YdmXxfP3vqpx01exwdPvIgvoUUX pfiXxfIp18ns512br4XD+ew9h6EyjCuFmStgKVntjF1HLWp+/jxuUCCEQbp23WD7qC+1 v+sMRMotM8BF70gxayJ3yo5gOr2sPYHqWM9WQ8lpt0Poq870wjgzqEdMozuqruE7Lqg9 Cr+w== X-Gm-Message-State: AOAM530Am1465ldDKgiQ3axcKF5aPHeLrSLrPsiZbQ7cop1jLdkWJRpZ 2uKELeX+7DBtpRsMfIQP5ws= X-Received: by 2002:a05:620a:4706:b0:67d:c81b:b625 with SMTP id bs6-20020a05620a470600b0067dc81bb625mr907357qkb.775.1649128586529; Mon, 04 Apr 2022 20:16:26 -0700 (PDT) Received: from euclid ([71.58.109.160]) by smtp.gmail.com with ESMTPSA id v7-20020ac85787000000b002e1c8376517sm9534540qta.22.2022.04.04.20.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:16:26 -0700 (PDT) From: Sevinj Aghayeva To: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev, Sevinj Aghayeva Subject: [PATCH 2/5] staging: rtl8723bs: remove redundant else branches Date: Mon, 4 Apr 2022 23:16:09 -0400 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 73891222f0d0..8c3b1448270a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -908,10 +908,9 @@ unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_fram set_link_timer(pmlmeext, REAUTH_TO); return _SUCCESS; - } else { - /* open system */ - go2asoc = 1; } + /* open system */ + go2asoc = 1; } else if (seq == 4) { if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) go2asoc = 1; @@ -1468,6 +1467,7 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->u.hdr.rx_data; + int ignore_received_deauth = 0; /* check A3 */ if (memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) @@ -1503,35 +1503,33 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame) return _SUCCESS; - } else { - int ignore_received_deauth = 0; - - /* Commented by Albert 20130604 */ - /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, */ - /* we will send the deauth first. */ - /* However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */ - /* Added the following code to avoid this case. */ - if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) || - (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) { - if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) { - ignore_received_deauth = 1; - } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) { - /* TODO: 802.11r */ - ignore_received_deauth = 1; - } + } + + /* Commented by Albert 20130604 */ + /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, */ + /* we will send the deauth first. */ + /* However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */ + /* Added the following code to avoid this case. */ + if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) || + (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) { + if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) { + ignore_received_deauth = 1; + } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) { + /* TODO: 802.11r */ + ignore_received_deauth = 1; } + } - netdev_dbg(padapter->pnetdev, - "sta recv deauth reason code(%d) sta:%pM, ignore = %d\n", - reason, GetAddr3Ptr(pframe), - ignore_received_deauth); + netdev_dbg(padapter->pnetdev, + "sta recv deauth reason code(%d) sta:%pM, ignore = %d\n", + reason, GetAddr3Ptr(pframe), + ignore_received_deauth); + + if (ignore_received_deauth == 0) + receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); - if (ignore_received_deauth == 0) - receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); - } pmlmepriv->LinkDetectInfo.bBusyTraffic = false; return _SUCCESS; - } unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) @@ -1575,13 +1573,13 @@ unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame) } return _SUCCESS; - } else { - netdev_dbg(padapter->pnetdev, - "sta recv disassoc reason code(%d) sta:%pM\n", - reason, GetAddr3Ptr(pframe)); - - receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); } + netdev_dbg(padapter->pnetdev, + "sta recv disassoc reason code(%d) sta:%pM\n", + reason, GetAddr3Ptr(pframe)); + + receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); + pmlmepriv->LinkDetectInfo.bBusyTraffic = false; return _SUCCESS; -- 2.25.1