Skip to content
Commit b5816869 authored by Li Zetao's avatar Li Zetao Committed by Greg Kroah-Hartman
Browse files

8250_men_mcb: Fix unsigned expression compared with zero



There is a warning reported by coccinelle:

./drivers/tty/serial/8250/8250_men_mcb.c:226:6-19: WARNING:
	Unsigned expression compared with zero: data -> line [ i ]     <     0

The array "line" of serial_8250_men_mcb_data is used to record the
registered serial port. When register a port failed, it will return
an error code, but the type of "line" is "unsigned int", causing
the error code to reverse. Modify the type of "data -> line" to solve
this problem.

Fixes: 2554e6ba ("8250_men_mcb: Read num ports from register data.")
Signed-off-by: default avatarLi Zetao <lizetao1@huawei.com>
Reviewed-by: default avatarJiri Slaby <jirislaby@kernel.org>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230803142053.1308926-1-lizetao1@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4b37932f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment