VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   35 Branches   59 Tags
author: Linus Torvalds <torvalds@linux-foundation.org> 2019-08-30 18:47:15 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2019-08-30 18:47:15 -0700 commit: ab9bb6318b0967671e0c9b6537c1537d51ca4f45 parent: 0a51b08fb3b4528e0915c4a4dd2ab0effa232359
Commit Summary:
Partially revert "kfifo: fix kfifo_alloc() and kfifo_init()"
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/lib/kfifo.c b/lib/kfifo.c
index 117ad0e7fbf4..70dab9ac7827 100644
--- a/lib/kfifo.c
+++ b/lib/kfifo.c
@@ -68,7 +68,8 @@ int __kfifo_init(struct __kfifo *fifo, void *buffer,
 {
 	size /= esize;
 
-	size = roundup_pow_of_two(size);
+	if (!is_power_of_2(size))
+		size = rounddown_pow_of_two(size);
 
 	fifo->in = 0;
 	fifo->out = 0;