Skip to content

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 <[email protected]>
Cc: Greg KH <[email protected]>
Acked-by: Stefani Seibold <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • 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.