We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86d81ec commit 8ed5878Copy full SHA for 8ed5878
fs/bcachefs/eytzinger.h
@@ -48,7 +48,7 @@ static inline unsigned eytzinger1_right_child(unsigned i)
48
49
static inline unsigned eytzinger1_first(unsigned size)
50
{
51
- return rounddown_pow_of_two(size);
+ return size ? rounddown_pow_of_two(size) : 0;
52
}
53
54
static inline unsigned eytzinger1_last(unsigned size)
@@ -101,7 +101,9 @@ static inline unsigned eytzinger1_prev(unsigned i, unsigned size)
101
102
static inline unsigned eytzinger1_extra(unsigned size)
103
104
- return (size + 1 - rounddown_pow_of_two(size)) << 1;
+ return size
105
+ ? (size + 1 - rounddown_pow_of_two(size)) << 1
106
+ : 0;
107
108
109
static inline unsigned __eytzinger1_to_inorder(unsigned i, unsigned size,
0 commit comments