Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ddf8391 authored by Andrea Righi's avatar Andrea Righi Committed by Linus Torvalds
Browse files

kfifo: add kfifo_skip() testcase



Add a testcase for kfifo_skip() to the byte stream fifo example.

Signed-off-by: default avatarAndrea Righi <arighi@develer.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: default avatarStefani Seibold <stefani@seibold.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b35de43b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -73,6 +73,10 @@ static int __init testfunc(void)
	ret = kfifo_in(&test, buf, ret);
	printk(KERN_INFO "ret: %d\n", ret);

	/* skip first element of the fifo */
	printk(KERN_INFO "skip 1st element\n");
	kfifo_skip(&test);

	/* put values into the fifo until is full */
	for (i = 20; kfifo_put(&test, &i); i++)
		;