Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/rtl8192e: avoid comparing unsigned type >= 0

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 <arnd@arndb.de>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
fd181f7d 5d5fd353

+5 -3
-3
drivers/staging/rtl8192e/rtl819x_Qos.h
··· 169 169 } TYPE2_8021Q; 170 170 }; 171 171 172 - #define IsACValid(ac) ((ac >= 0 && ac <= 7) ? true : false) 173 - 174 - 175 172 union aci_aifsn { 176 173 u8 charData; 177 174
+5
drivers/staging/rtl8192e/rtl819x_TSProc.c
··· 306 306 pTsCommonInfo->TClasNum = TCLAS_Num; 307 307 } 308 308 309 + static bool IsACValid(unsigned int tid) 310 + { 311 + return tid < 7; 312 + } 313 + 309 314 bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS, 310 315 u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs) 311 316 {