summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorAndrea Righi <arighi@develer.com>2010-08-19 23:13:28 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-20 18:34:54 +0200
commit5ddf83912c8b49a24ab0841f6d77f33781dcf10f (patch)
treee3a9b61f4d79ac9ea57cb9775fa7c29ae76b4f33 /samples
parentkfifo: implement missing __kfifo_skip_r() (diff)
downloadlinux-5ddf83912c8b49a24ab0841f6d77f33781dcf10f.tar.xz
linux-5ddf83912c8b49a24ab0841f6d77f33781dcf10f.zip
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>
Diffstat (limited to 'samples')
-rw-r--r--samples/kfifo/bytestream-example.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/kfifo/bytestream-example.c b/samples/kfifo/bytestream-example.c
index 642eef3f6336..2e3a7a8128a2 100644
--- a/samples/kfifo/bytestream-example.c
+++ b/samples/kfifo/bytestream-example.c
@@ -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++)
;