All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kfifo: implement missing __kfifo_skip_r()
@ 2010-08-12 15:32 Andrea Righi
  2010-08-12 15:32 ` [PATCH 2/2] kfifo: add kfifo_skip() testcase Andrea Righi
  2010-08-12 20:45 ` [PATCH 1/2] kfifo: implement missing __kfifo_skip_r() Stefani Seibold
  0 siblings, 2 replies; 6+ messages in thread
From: Andrea Righi @ 2010-08-12 15:32 UTC (permalink / raw)
  To: Stefani Seibold
  Cc: Greg Kroah-Hartman, Mauro Carvalho Chehab, Andi Kleen, linux-kernel

kfifo_skip() is currently broken, due to the missing of the internal
helper function. Add it.

Signed-off-by: Andrea Righi <arighi@develer.com>
---
 include/linux/kfifo.h |    2 ++
 kernel/kfifo.c        |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 311f875..4aa95f2 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -836,6 +836,8 @@ extern void __kfifo_dma_out_finish_r(struct __kfifo *fifo, size_t recsize);
 
 extern unsigned int __kfifo_len_r(struct __kfifo *fifo, size_t recsize);
 
+extern void __kfifo_skip_r(struct __kfifo *fifo, size_t recsize);
+
 extern unsigned int __kfifo_out_peek_r(struct __kfifo *fifo,
 	void *buf, unsigned int len, size_t recsize);
 
diff --git a/kernel/kfifo.c b/kernel/kfifo.c
index 02192dd..06d6eee 100644
--- a/kernel/kfifo.c
+++ b/kernel/kfifo.c
@@ -504,6 +504,15 @@ unsigned int __kfifo_out_r(struct __kfifo *fifo, void *buf,
 }
 EXPORT_SYMBOL(__kfifo_out_r);
 
+void __kfifo_skip_r(struct __kfifo *fifo, size_t recsize)
+{
+	unsigned int n;
+
+	n = __kfifo_peek_n(fifo, recsize);
+	fifo->out += n + recsize;
+}
+EXPORT_SYMBOL(__kfifo_skip_r);
+
 int __kfifo_from_user_r(struct __kfifo *fifo, const void __user *from,
 	unsigned long len, unsigned int *copied, size_t recsize)
 {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-12 22:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-12 15:32 [PATCH 1/2] kfifo: implement missing __kfifo_skip_r() Andrea Righi
2010-08-12 15:32 ` [PATCH 2/2] kfifo: add kfifo_skip() testcase Andrea Righi
2010-08-12 20:46   ` Stefani Seibold
2010-08-12 21:22   ` Andrew Morton
2010-08-12 22:28     ` Andrea Righi
2010-08-12 20:45 ` [PATCH 1/2] kfifo: implement missing __kfifo_skip_r() Stefani Seibold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.