From patchwork Thu May 11 17:57:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 9722693 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 9EAD060231 for ; Thu, 11 May 2017 17:58:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E2D5286EB for ; Thu, 11 May 2017 17:58:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 932B4286EC; Thu, 11 May 2017 17:58:09 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 3A5FA286EF for ; Thu, 11 May 2017 17:58:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933497AbdEKR6I (ORCPT ); Thu, 11 May 2017 13:58:08 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33965 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933485AbdEKR6E (ORCPT ); Thu, 11 May 2017 13:58:04 -0400 Received: by mail-wr0-f195.google.com with SMTP id 6so4651186wrb.1; Thu, 11 May 2017 10:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=H2pegwZrtJtI4LK2/Vlj+vJrl6fS17xCtISV9Kt1x5M=; b=Ap/U+NmS8iOoxPqD6qWqqUVgm9qIyGPHQF9EyY43OWcLle+YOFTGIa6OuTl3bZX4rb tISC+TcOLjecEUX8TxCCl6MZx1eeMpIbfB9Je1LDoM1h5TmDmsDw/5k9aDIBTJY33SRX xCpdgd/dfBAOLMc7KcxcgvQxsqLWBFWx1U+j3iyCBM+IP8Eda9EUKVa3NKXD/4bnneAL 8F9zC27q1gpxNn3WHsjYWb4epqRT4NEScnkF4HAsq/GQtT36XE/YMkAW2yr/yBZbkXJ4 X+QaGzKopDLseWaI6cEEMwFT7iHcRN20hQn9BBr0fTsvd+3rlF7ngRAbC867lcBegCph aBUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H2pegwZrtJtI4LK2/Vlj+vJrl6fS17xCtISV9Kt1x5M=; b=crZT/GXzM8bhLJ3olmklm8ujrMIffpnKMMU5DFABGfziChn6WJROe929bWLlnZbV07 01u73fLw++QXZot/gnhGpTkTtM42xmb3fT06QKtsHBJlke5/UwcYEtcejchcq2tROVAr 89HqMlzPRrh5TKNCsu1ZpKVLWJUaY7IM4b92YJYy9/Vu8HoAYCdZ0HngNCtZDEUyfhh0 dv2auqSzLQKzRqfqxORWbR5IQJqDPoKFF1YqCP8ZyHjg7yllD46hZfXeDzLK6JlSgBzd yzphTI/9LWFoXOqA7wDzNZNgK/WqfSy9RfTM7xxHLjfJlZRmBRgnFmC/cNSQzFvguYiX pBvA== X-Gm-Message-State: AODbwcCinNfnmzFWlLYx+euXFKP+wUiJG7JUVrZd9nKjR6OG+LBMDo36 pk09enssOlbLvw== X-Received: by 10.223.152.9 with SMTP id v9mr51574wrb.8.1494525482889; Thu, 11 May 2017 10:58:02 -0700 (PDT) Received: from localhost.localdomain (92.40.248.21.threembb.co.uk. [92.40.248.21]) by smtp.gmail.com with ESMTPSA id u4sm1271084wmu.0.2017.05.11.10.58.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 10:58:02 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Malcolm Priestley , stable@vger.kernel.org Subject: [PATCH 4/4] staging: rtl8192e: GetTs Fix invalid TID 7 warning. Date: Thu, 11 May 2017 18:57:46 +0100 Message-Id: <20170511175746.12378-4-tvboxspy@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170511175746.12378-1-tvboxspy@gmail.com> References: <20170511175746.12378-1-tvboxspy@gmail.com> 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 TID 7 is a valid value for QoS IEEE 802.11e. The switch statement that follows states 7 is valid. Remove function IsACValid and use the default case to filter invalid TIDs. Signed-off-by: Malcolm Priestley Cc: --- drivers/staging/rtl8192e/rtl819x_TSProc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index 48bbd9e8a52f..dcc4eb691889 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -306,11 +306,6 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, pTsCommonInfo->TClasNum = TCLAS_Num; } -static bool IsACValid(unsigned int tid) -{ - return tid < 7; -} - bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) { @@ -328,12 +323,6 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, if (ieee->current_network.qos_data.supported == 0) { UP = 0; } else { - if (!IsACValid(TID)) { - netdev_warn(ieee->dev, "%s(): TID(%d) is not valid\n", - __func__, TID); - return false; - } - switch (TID) { case 0: case 3: @@ -351,6 +340,10 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, case 7: UP = 7; break; + default: + netdev_warn(ieee->dev, "%s(): TID(%d) is not valid\n", + __func__, TID); + return false; } }