Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
kfifo: add kfifo_skip() testcase
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrea Righi authored and torvalds committed Aug 20, 2010
1 parent b35de43 commit 5ddf839
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions samples/kfifo/bytestream-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
;
Expand Down

0 comments on commit 5ddf839

Please sign in to comment.