]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
MIPS: pic32: treat port as signed integer
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 28 Oct 2022 13:23:44 +0000 (15:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:39:58 +0000 (17:39 +0100)
commit836bbdfcf8ef4b9b8a10c1f6fee3cff2b72bedc7
treec3a14478f008e8152444ec5bc2eb5713f8416c91
parentc0bb600f076832764b43ae4ef6ee003d9a71f7f9
MIPS: pic32: treat port as signed integer

[ Upstream commit 648060902aa302331b5d6e4f26d8ee0761d239ab ]

get_port_from_cmdline() returns an int, yet is assigned to a char, which
is wrong in its own right, but also, with char becoming unsigned, this
poses problems, because -1 is used as an error value. Further
complicating things, fw_init_early_console() is only ever called with a
-1 argument. Fix this up by removing the unused argument from
fw_init_early_console() and treating port as a proper signed integer.

Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/include/asm/fw/fw.h
arch/mips/pic32/pic32mzda/early_console.c
arch/mips/pic32/pic32mzda/init.c