Lines Matching +full:n +full:- +full:factor

1 /* SPDX-License-Identifier: GPL-2.0 */
35 static inline u64 div_factor(u64 num, int factor) in div_factor() argument
37 if (factor == 10) in div_factor()
39 num *= factor; in div_factor()
43 static inline u64 div_factor_fine(u64 num, int factor) in div_factor_fine() argument
45 if (factor == 100) in div_factor_fine()
47 num *= factor; in div_factor_fine()
52 static inline bool is_power_of_two_u64(u64 n) in is_power_of_two_u64() argument
54 return n != 0 && (n & (n - 1)) == 0; in is_power_of_two_u64()
57 static inline bool has_single_bit_set(u64 n) in has_single_bit_set() argument
59 return is_power_of_two_u64(n); in has_single_bit_set()
75 struct rb_node *node = root->rb_node; in rb_simple_search()
81 if (bytenr < entry->bytenr) in rb_simple_search()
82 node = node->rb_left; in rb_simple_search()
83 else if (bytenr > entry->bytenr) in rb_simple_search()
84 node = node->rb_right; in rb_simple_search()
103 struct rb_node *node = root->rb_node, *ret = NULL; in rb_simple_search_first()
109 if (bytenr < entry->bytenr) { in rb_simple_search_first()
110 if (!ret || entry->bytenr < ret_entry->bytenr) { in rb_simple_search_first()
115 node = node->rb_left; in rb_simple_search_first()
116 } else if (bytenr > entry->bytenr) { in rb_simple_search_first()
117 node = node->rb_right; in rb_simple_search_first()
129 struct rb_node **p = &root->rb_node; in rb_simple_insert()
137 if (bytenr < entry->bytenr) in rb_simple_insert()
138 p = &(*p)->rb_left; in rb_simple_insert()
139 else if (bytenr > entry->bytenr) in rb_simple_insert()
140 p = &(*p)->rb_right; in rb_simple_insert()