Re: [PATCH] mt76: Fix comparisons with invalid hardware key index

From: Kalle Valo
Date: Fri Aug 31 2018 - 11:52:51 EST


Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:

> With gcc 4.1.2:
>
> drivers/net/wireless/mediatek/mt76/mt76x0/tx.c: In function âmt76x0_txâ:
> drivers/net/wireless/mediatek/mt76/mt76x0/tx.c:169: warning: comparison is always true due to limited range of data type
> drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c: In function âmt76x2_txâ:
> drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c:35: warning: comparison is always true due to limited range of data type
>
> While assigning -1 to a u8 works fine, comparing with -1 does not work
> as expected.
>
> Fix this by comparing with 0xff, like is already done in some other
> places.
>
> Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Patch applied to wireless-drivers-next.git, thanks.

81c8eccc2404 mt76: Fix comparisons with invalid hardware key index

--
https://patchwork.kernel.org/patch/10574583/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches