diff options
| -rw-r--r-- | lib/kfifo.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/kfifo.c b/lib/kfifo.c index 59dcf5b81d24..7b7f83027b7b 100644 --- a/lib/kfifo.c +++ b/lib/kfifo.c | |||
| @@ -42,8 +42,7 @@ int __kfifo_alloc(struct __kfifo *fifo, unsigned int size, | |||
| 42 | * round down to the next power of 2, since our 'let the indices | 42 | * round down to the next power of 2, since our 'let the indices |
| 43 | * wrap' technique works only in this case. | 43 | * wrap' technique works only in this case. |
| 44 | */ | 44 | */ |
| 45 | if (!is_power_of_2(size)) | 45 | size = roundup_pow_of_two(size); |
| 46 | size = rounddown_pow_of_two(size); | ||
| 47 | 46 | ||
| 48 | fifo->in = 0; | 47 | fifo->in = 0; |
| 49 | fifo->out = 0; | 48 | fifo->out = 0; |
| @@ -83,8 +82,7 @@ int __kfifo_init(struct __kfifo *fifo, void *buffer, | |||
| 83 | { | 82 | { |
| 84 | size /= esize; | 83 | size /= esize; |
| 85 | 84 | ||
| 86 | if (!is_power_of_2(size)) | 85 | size = roundup_pow_of_two(size); |
| 87 | size = rounddown_pow_of_two(size); | ||
| 88 | 86 | ||
| 89 | fifo->in = 0; | 87 | fifo->in = 0; |
| 90 | fifo->out = 0; | 88 | fifo->out = 0; |
