kfifo: add kfifo_skip() testcase
Andrea Righi [Thu, 19 Aug 2010 21:13:28 +0000 (14:13 -0700)]
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>

samples/kfifo/bytestream-example.c

index 642eef3..2e3a7a8 100644 (file)
@@ -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++)
                ;