From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stanislaw Gruszka Subject: Re: [PATCH] mt76: Fix comparisons with invalid hardware key index Date: Fri, 24 Aug 2018 10:08:18 +0200 Message-ID: <20180824080817.GA6651@redhat.com> References: <20180823212738.18431-1-geert@linux-m68k.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Kalle Valo , "David S . Miller" , Matthias Brugger , Lorenzo Bianconi , Arnd Bergmann , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org To: Geert Uytterhoeven Return-path: Content-Disposition: inline In-Reply-To: <20180823212738.18431-1-geert@linux-m68k.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Thu, Aug 23, 2018 at 11:27:38PM +0200, Geert Uytterhoeven 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 Ack for mt76x0. I think Lorenzo already posted patch for mt76x2. Thanks Stanislaw