]> git.hungrycats.org Git - linux/commit
mptcp: clean up harmless false expressions
authorJean Sacren <sakiwit@gmail.com>
Wed, 28 Feb 2024 17:37:15 +0000 (18:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:38:49 +0000 (14:38 +0000)
commit4ba8702b23e3a6f4c16e93315f75727ad25d9c53
treec04b34cf3a5ffa981479df81f74adf6abc1b62cb
parentf431a58cb933fbc694a40ea239f57da567180b3b
mptcp: clean up harmless false expressions

commit 59060a47ca50bbdb1d863b73667a1065873ecc06 upstream.

entry->addr.id is u8 with a range from 0 to 255 and MAX_ADDR_ID is 255.
We should drop both false expressions of (entry->addr.id > MAX_ADDR_ID).

We should also remove the obsolete parentheses in the first if branch.

Use U8_MAX for MAX_ADDR_ID and add a comment to show the link to
mptcp_addr_info.id as suggested by Mr. Matthieu Baerts.

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mptcp/pm_netlink.c