mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-18 07:35:12 +08:00
kfifo: add kfifo_skip() testcase
Add a testcase for kfifo_skip() to the byte stream fifo example. Signed-off-by: Andrea Righi <arighi@develer.com> Cc: Greg KH <greg@kroah.com> Acked-by: Stefani Seibold <stefani@seibold.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
b35de43b31
commit
5ddf83912c
@ -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++)
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user