From patchwork Thu Jun 22 13:23:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9804309 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AC53360234 for ; Thu, 22 Jun 2017 13:23:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BE3F2858F for ; Thu, 22 Jun 2017 13:23:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9048028630; Thu, 22 Jun 2017 13:23:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A5F12858F for ; Thu, 22 Jun 2017 13:23:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107AbdFVNXe (ORCPT ); Thu, 22 Jun 2017 09:23:34 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36279 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753068AbdFVNXd (ORCPT ); Thu, 22 Jun 2017 09:23:33 -0400 Received: by mail-pf0-f195.google.com with SMTP id y7so2928667pfd.3 for ; Thu, 22 Jun 2017 06:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=AfvWXOabiYAHhksgfTi0lAo1qf/IsJa3rtYyy4dMpi4=; b=TKf2U8J794Klvb6hXl6mJhMLroTsyjCLudkDg0w7qR5SyLiCWdwf9JmHUECuSrbUtK ljeYk1WQfYZljR8GVBgjYcLA8ymWrzUgN8mqn4Km+qF0sIL6+pTsrcXxHvscwQBKt+HS Yo03GWUuO+KBS4fhATMuZDvrJnpTL46pCmiMyM6aFc5Oj5tgpl9nn9BOMVYRFUu85YmY VI/+wipupRjeJq8WmQPFrNDpBfvO/cuS4psqJL7NateXceRiPh4rglQ0BCS4Qv78wSzN lOSAi/l4k49QzQChmvwfJDTAY4ljxyeR1n9W13x54MwWY0OCmASkig4rUcHllDZH0T0/ dB8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=AfvWXOabiYAHhksgfTi0lAo1qf/IsJa3rtYyy4dMpi4=; b=PwhmVthN6vD7I8PqI9Cum860yd7qY6dJlcCFeUTQf43EyclenXwDAd/6C2coRgrBtj akl7DPtmp/Z19S1LBfYGVgWE6x+9J19xJLUWXQWvOKWG/u15PhD2dq53omHciDGwY7wd 1ppDfIATbUbKc/ut6izytfmD+DC1sesV+MYp1TDvV63tpBfFQ2/sge2y419Zj7anTqqI OtFv1QUZxE+vAf4MbVb1j0xG8jH3ik2OY/OX0PsDoM8OPP5UlkPXe+8DlHcNpe2JBGzF 2QKPTAHAT9ARrc4BmyFk2vaD58Ige/dfvG0/NgK4qaJQaxX7VzACi9w7TJsubmw6OxZf L/8Q== X-Gm-Message-State: AKS2vOwnv+fx73OZuk+u7FOmNX2t99bIefwso59q+FnB3H++EhBcHlUb Zy026iQN2G4gBhvQ X-Received: by 10.84.197.3 with SMTP id m3mr3007848pld.40.1498137812509; Thu, 22 Jun 2017 06:23:32 -0700 (PDT) Received: from symbol-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id s29sm4004835pfi.17.2017.06.22.06.23.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jun 2017 06:23:31 -0700 (PDT) Date: Thu, 22 Jun 2017 18:53:29 +0530 From: Souptick Joarder To: julian.calaby@gmail.com, Larry.Finger@lwfinger.net, chaoming_li@realsil.com.cn Cc: linux-wireless@vger.kernel.org Subject: [PATCH v2] rtlwifi: Remove unnecessary conditions Message-ID: <20170622132329.GA4825@symbol-HP-ZBook-15> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As wmm_enable is initialized to false, hence the else condition never execute and boundary is assigned with TX_PAGE_BOUNDARY. So the if-else condition can be removed and boundary will be assigned with TX_PAGE_BOUNDARY. Signed-off-by: Souptick Joarder --- Changes in v2: - Correcting the indent and moving up the change where boundary is defined. drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c index f95a645..107c34e 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c @@ -835,7 +835,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw) struct rtl_usb_priv *usb_priv = rtl_usbpriv(hw); struct rtl_usb *rtlusb = rtl_usbdev(usb_priv); int err = 0; - u32 boundary = 0; + u32 boundary = TX_PAGE_BOUNDARY; u8 wmm_enable = false; /* TODO */ u8 out_ep_nums = rtlusb->out_ep_nums; u8 queue_sel = rtlusb->out_queue_sel; @@ -845,13 +845,6 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw) pr_err("Failed to init power on!\n"); return err; } - if (!wmm_enable) { - boundary = TX_PAGE_BOUNDARY; - } else { /* for WMM */ - boundary = (IS_NORMAL_CHIP(rtlhal->version)) - ? WMM_CHIP_B_TX_PAGE_BOUNDARY - : WMM_CHIP_A_TX_PAGE_BOUNDARY; - } if (false == rtl92c_init_llt_table(hw, boundary)) { pr_err("Failed to init LLT Table!\n"); return -EINVAL;