mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
fib: use __fls() on non null argument
__fls(x) is a bit faster than fls(x), granted we know x is non null. As Ben Hutchings pointed out, fls(x) = __fls(x) + 1 Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
425f09ab7d
commit
79cda75a10
1 changed files with 2 additions and 1 deletions
|
@ -1550,7 +1550,8 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp,
|
||||||
* state.directly.
|
* state.directly.
|
||||||
*/
|
*/
|
||||||
if (pref_mismatch) {
|
if (pref_mismatch) {
|
||||||
int mp = KEYLENGTH - fls(pref_mismatch);
|
/* fls(x) = __fls(x) + 1 */
|
||||||
|
int mp = KEYLENGTH - __fls(pref_mismatch) - 1;
|
||||||
|
|
||||||
if (tkey_extract_bits(cn->key, mp, cn->pos - mp) != 0)
|
if (tkey_extract_bits(cn->key, mp, cn->pos - mp) != 0)
|
||||||
goto backtrace;
|
goto backtrace;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue