]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: airo: do not assign -1 to unsigned char
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 24 Oct 2022 16:28:43 +0000 (18:28 +0200)
committerKalle Valo <kvalo@kernel.org>
Tue, 1 Nov 2022 09:15:15 +0000 (11:15 +0200)
commit7fd76adc9677b026c0b28776f8b01c45b5ba44a4
tree3c3daf1412c286300868b145c5e083ce447c9691
parentcc72e8003c4cf631306dcf3476f368a05acfc1f0
wifi: airo: do not assign -1 to unsigned char

With char becoming unsigned by default, and with `char` alone being
ambiguous and based on architecture, we get a warning when assigning the
unchecked output of hex_to_bin() to that unsigned char. Mark `key` as a
`u8`, which matches the struct's type, and then check each call to
hex_to_bin() before casting.

Cc: Kalle Valo <kvalo@kernel.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221024162843.535921-1-Jason@zx2c4.com
drivers/net/wireless/cisco/airo.c