]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: clean up harmless false expressions
authorJean Sacren <sakiwit@gmail.com>
Fri, 17 Dec 2021 23:37:02 +0000 (15:37 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 18 Dec 2021 03:27:05 +0000 (19:27 -0800)
commitc638c08faf6510612b4b955723d50969ad4febf4
tree45a328723f709840ef9fa7e0961c35dfa2e8b7d5
parent5e16a962a3f2bb6155e4d538c4a7267200bdfed6
mptcp: clean up harmless false expressions

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>
net/mptcp/pm_netlink.c