aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kfifo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kfifo.h')
-rw-r--r--include/linux/kfifo.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index bc0fc795bd35..9fad0527344f 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -86,7 +86,8 @@ union { \
*/
#define INIT_KFIFO(name) \
name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \
- sizeof(struct kfifo), name##kfifo_buffer)
+ sizeof(struct kfifo), \
+ name##kfifo_buffer + sizeof(struct kfifo))
/**
* DEFINE_KFIFO - macro to define and initialize a kfifo
@@ -102,8 +103,6 @@ union { \
unsigned char name##kfifo_buffer[size]; \
struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer)
-#undef __kfifo_initializer
-
extern void kfifo_init(struct kfifo *fifo, void *buffer,
unsigned int size);
extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size,
@@ -202,7 +201,7 @@ static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo)
* @n: the length of the data to be added.
* @lock: pointer to the spinlock to use for locking.
*
- * This function copies at most @len bytes from the @from buffer into
+ * This function copies at most @n bytes from the @from buffer into
* the FIFO depending on the free space, and returns the number of
* bytes copied.
*/
@@ -228,7 +227,7 @@ static inline unsigned int kfifo_in_locked(struct kfifo *fifo,
* @n: the size of the destination buffer.
* @lock: pointer to the spinlock to use for locking.
*
- * This function copies at most @len bytes from the FIFO into the
+ * This function copies at most @n bytes from the FIFO into the
* @to buffer and returns the number of copied bytes.
*/
static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo,