net: use reciprocal_scale() helper
Replace open codings of (((u64) <x> * <y>) >> 32) with reciprocal_scale(). Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
690e36e726
commit
8fc54f6891
@@ -243,7 +243,7 @@ begin:
|
||||
goto exact_match;
|
||||
} else if (score == badness && reuseport) {
|
||||
matches++;
|
||||
if (((u64)hash * matches) >> 32 == 0)
|
||||
if (reciprocal_scale(hash, matches) == 0)
|
||||
result = sk;
|
||||
hash = next_pseudo_random32(hash);
|
||||
}
|
||||
@@ -323,7 +323,7 @@ begin:
|
||||
}
|
||||
} else if (score == badness && reuseport) {
|
||||
matches++;
|
||||
if (((u64)hash * matches) >> 32 == 0)
|
||||
if (reciprocal_scale(hash, matches) == 0)
|
||||
result = sk;
|
||||
hash = next_pseudo_random32(hash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user