From patchwork Wed Jul 20 15:26:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101993 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp42340qga; Wed, 20 Jul 2016 08:26:53 -0700 (PDT) X-Received: by 10.98.222.132 with SMTP id h126mr33130918pfg.61.1469028412450; Wed, 20 Jul 2016 08:26:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si3871832pfc.294.2016.07.20.08.26.52; Wed, 20 Jul 2016 08:26:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753618AbcGTP0o (ORCPT + 4 others); Wed, 20 Jul 2016 11:26:44 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:60042 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753732AbcGTP0e (ORCPT ); Wed, 20 Jul 2016 11:26:34 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue005) with ESMTPA (Nemesis) id 0MdqcT-1biMfr2je9-00PdkY; Wed, 20 Jul 2016 17:26:14 +0200 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: linux-wireless@vger.kernel.org, Kalle Valo , Larry Finger , netdev@vger.kernel.org, Jes Sorensen , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 3/3] staging/rtl8192e: avoid comparing unsigned type >= 0 Date: Wed, 20 Jul 2016 17:26:06 +0200 Message-Id: <20160720152606.201775-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160720152606.201775-1-arnd@arndb.de> References: <20160720151818.4142386-1-arnd@arndb.de> <20160720152606.201775-1-arnd@arndb.de> X-Provags-ID: V03:K0:Pxq4oN3Lrqhv5M1PctPYKNh5Wot0+i+lNNC8131ZBfHBtYVyrGq OSOFuVjaOHDKmD6VUbKqxX2tlazAmxN8HF+e9fMpm9iGoXWLgxbNuEaeKRtqK1RDCorQjZn Yk0BH32wvHqCk4dhLwDazdvs5s80UgsWyx4rELLhFtyBE8QHCHazYHUw7hMjrw5GLxD6ONB LTDE2nwjsMbUTIVs3hDZg== X-UI-Out-Filterresults: notjunk:1; V01:K0:XJzwe/BmHAg=:m/BKs0wnCTCcoAxnG1yeWb J9za68sErUi5oW5/p7MNATCwJuRxWjxT1RejYaPHMrucooNJ3uyIBW2gOChG7DgNKgrw05Aav 0MRXTHPJAvhCsPHxn/ptgCU+3Un3UDVfS27WoITNAHoeBR2rmBnXkCe4qsldTLCBAjRafDfrj Nr7kgsB+xgN5N+s7FuOIXsX/mcQxDPKsjfCmF/zkUvuABfCKrxXbtpRO2EsINt/6qzr+8Vdyx 5aQMYsRZkn4VXsSgKrho6sJ3TtqdSHYogluWVyrJE/jDFpBNRNT9va+1sXxH03KB2PV3/osvC daU+0k/5LLdGGCdby5Smu0fUTGJ2q3CAKnjdUe3k95Qg6LOtTPpbzFXQrwD4gFkmgqgRQnlAA 70EpDwGy/BFivQKvOZ/xcShlJ3T40U9QNE5FkHod/VDF3tqxl+Nv071OFWccGZHSD6wGBvB+0 utX7PYxLMtLg4VgrFWPaNrNMtbXkZlvj3n9inbXKnDE6nGB9/gu3f8Rq6GpwfW2d+05kjSB4T qkCw9HsKJDieCNXZ7zCBwbzGubIC27a6pVXB+JA84gIf/WFGRMPHRLdCpKzWwtnIzMflhFbUM DwqSP8J0foiX/FyBuiqZkruFVkgFJwNFPSEAi+1LU5OfJorhBgkMHQJV0+PoBk6H76FHIeBLi DHtXwGZMy0X/y8sgyUfy2O7uPBH3xwETUKChnB7GW5ngeqoIVPWnFhkI/8Xx3lGmITmw= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is one remaining warning about a type limit check in rtl8192e: staging/rtl8192e/rtl819x_TSProc.c:326:14: error: comparison is always true due to limited range of data type [-Werror=type-limits] This changes a macro into a local function to clarify the types and simplify the check while removing the warning. Signed-off-by: Arnd Bergmann --- drivers/staging/rtl8192e/rtl819x_Qos.h | 3 --- drivers/staging/rtl8192e/rtl819x_TSProc.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h b/drivers/staging/rtl8192e/rtl819x_Qos.h index 463122db6d29..61da8f7475bb 100644 --- a/drivers/staging/rtl8192e/rtl819x_Qos.h +++ b/drivers/staging/rtl8192e/rtl819x_Qos.h @@ -169,9 +169,6 @@ union qos_tclas { } TYPE2_8021Q; }; -#define IsACValid(ac) ((ac >= 0 && ac <= 7) ? true : false) - - union aci_aifsn { u8 charData; diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index 2c8a526773ed..a966a8e490ab 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -306,6 +306,11 @@ 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) {