mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
tipc: use min() to simplify the code
When calculating size of own domain based on number of peers, the result should be less than MAX_MON_DOMAIN, so using min() here is very semantic. Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20240822133908.1042240-8-lizetao1@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
26549dab8a
commit
a18308623c
@ -149,7 +149,7 @@ static int dom_size(int peers)
|
||||
|
||||
while ((i * i) < peers)
|
||||
i++;
|
||||
return i < MAX_MON_DOMAIN ? i : MAX_MON_DOMAIN;
|
||||
return min(i, MAX_MON_DOMAIN);
|
||||
}
|
||||
|
||||
static void map_set(u64 *up_map, int i, unsigned int v)
|
||||
|
Loading…
Reference in New Issue
Block a user