Commit 5ddf83912c8b49a24ab0841f6d77f33781dcf10f
Committed by
Linus Torvalds
1 parent
b35de43b31
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
samples/kfifo/bytestream-example.c
... | ... | @@ -73,6 +73,10 @@ |
73 | 73 | ret = kfifo_in(&test, buf, ret); |
74 | 74 | printk(KERN_INFO "ret: %d\n", ret); |
75 | 75 | |
76 | + /* skip first element of the fifo */ | |
77 | + printk(KERN_INFO "skip 1st element\n"); | |
78 | + kfifo_skip(&test); | |
79 | + | |
76 | 80 | /* put values into the fifo until is full */ |
77 | 81 | for (i = 20; kfifo_put(&test, &i); i++) |
78 | 82 | ; |