aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kfifo.h
diff options
context:
space:
mode:
authorStefani Seibold <stefani@seibold.net>2009-12-21 17:37:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-22 17:17:56 -0500
commite64c026dd09b73faf20707711402fc5ed55a8e70 (patch)
tree4780736e021824f15329a0826eff3cc27d3f9646 /include/linux/kfifo.h
parentc1e13f25674ed564948ecb7dfe5f83e578892896 (diff)
kfifo: cleanup namespace
change name of __kfifo_* functions to kfifo_*, because the prefix __kfifo should be reserved for internal functions only. Signed-off-by: Stefani Seibold <stefani@seibold.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Andi Kleen <ak@linux.intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kfifo.h')
-rw-r--r--include/linux/kfifo.h32
1 files changed, 7 insertions, 25 deletions
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index e0f5c9d4197d..a893acda3964 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -37,34 +37,25 @@ extern void kfifo_init(struct kfifo *fifo, unsigned char *buffer,
37extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, 37extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size,
38 gfp_t gfp_mask); 38 gfp_t gfp_mask);
39extern void kfifo_free(struct kfifo *fifo); 39extern void kfifo_free(struct kfifo *fifo);
40extern unsigned int __kfifo_put(struct kfifo *fifo, 40extern unsigned int kfifo_put(struct kfifo *fifo,
41 const unsigned char *buffer, unsigned int len); 41 const unsigned char *buffer, unsigned int len);
42extern unsigned int __kfifo_get(struct kfifo *fifo, 42extern unsigned int kfifo_get(struct kfifo *fifo,
43 unsigned char *buffer, unsigned int len); 43 unsigned char *buffer, unsigned int len);
44 44
45/** 45/**
46 * __kfifo_reset - removes the entire FIFO contents, no locking version
47 * @fifo: the fifo to be emptied.
48 */
49static inline void __kfifo_reset(struct kfifo *fifo)
50{
51 fifo->in = fifo->out = 0;
52}
53
54/**
55 * kfifo_reset - removes the entire FIFO contents 46 * kfifo_reset - removes the entire FIFO contents
56 * @fifo: the fifo to be emptied. 47 * @fifo: the fifo to be emptied.
57 */ 48 */
58static inline void kfifo_reset(struct kfifo *fifo) 49static inline void kfifo_reset(struct kfifo *fifo)
59{ 50{
60 __kfifo_reset(fifo); 51 fifo->in = fifo->out = 0;
61} 52}
62 53
63/** 54/**
64 * __kfifo_len - returns the number of bytes available in the FIFO 55 * kfifo_len - returns the number of used bytes in the FIFO
65 * @fifo: the fifo to be used. 56 * @fifo: the fifo to be used.
66 */ 57 */
67static inline unsigned int __kfifo_len(struct kfifo *fifo) 58static inline unsigned int kfifo_len(struct kfifo *fifo)
68{ 59{
69 register unsigned int out; 60 register unsigned int out;
70 61
@@ -92,7 +83,7 @@ static inline __must_check unsigned int kfifo_put_locked(struct kfifo *fifo,
92 83
93 spin_lock_irqsave(lock, flags); 84 spin_lock_irqsave(lock, flags);
94 85
95 ret = __kfifo_put(fifo, from, n); 86 ret = kfifo_put(fifo, from, n);
96 87
97 spin_unlock_irqrestore(lock, flags); 88 spin_unlock_irqrestore(lock, flags);
98 89
@@ -117,7 +108,7 @@ static inline __must_check unsigned int kfifo_get_locked(struct kfifo *fifo,
117 108
118 spin_lock_irqsave(lock, flags); 109 spin_lock_irqsave(lock, flags);
119 110
120 ret = __kfifo_get(fifo, to, n); 111 ret = kfifo_get(fifo, to, n);
121 112
122 /* 113 /*
123 * optimization: if the FIFO is empty, set the indices to 0 114 * optimization: if the FIFO is empty, set the indices to 0
@@ -131,13 +122,4 @@ static inline __must_check unsigned int kfifo_get_locked(struct kfifo *fifo,
131 return ret; 122 return ret;
132} 123}
133 124
134/**
135 * kfifo_len - returns the number of bytes available in the FIFO
136 * @fifo: the fifo to be used.
137 */
138static inline unsigned int kfifo_len(struct kfifo *fifo)
139{
140 return __kfifo_len(fifo);
141}
142
143#endif 125#endif