Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218619
b: refs/heads/master
c: 144ecf3
h: refs/heads/master
i:
  218617: 2ba7b68
  218615: f9c9dd1
v: v3
  • Loading branch information
Stefani Seibold authored and Linus Torvalds committed Oct 28, 2010
1 parent 75b983a commit 89333fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12aa4c64174cb0d915cd1c7b763847c0ffa8e92c
refs/heads/master: 144ecf310eb52d9df607b9b7eeb096743e232a96
33 changes: 21 additions & 12 deletions trunk/include/linux/kfifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,17 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void);
}


/* __kfifo_must_check_helper() is temporarily disabled because it was faulty */
#define __kfifo_must_check_helper(x) (x)
static inline unsigned int __must_check
__kfifo_uint_must_check_helper(unsigned int val)
{
return val;
}

static inline int __must_check
__kfifo_int_must_check_helper(int val)
{
return val;
}

/**
* kfifo_initialized - Check if the fifo is initialized
Expand Down Expand Up @@ -264,7 +273,7 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void);
* @fifo: address of the fifo to be used
*/
#define kfifo_avail(fifo) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmpq = (fifo); \
const size_t __recsize = sizeof(*__tmpq->rectype); \
Expand Down Expand Up @@ -297,7 +306,7 @@ __kfifo_must_check_helper( \
* This function returns the size of the next fifo record in number of bytes.
*/
#define kfifo_peek_len(fifo) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
const size_t __recsize = sizeof(*__tmp->rectype); \
Expand All @@ -320,7 +329,7 @@ __kfifo_must_check_helper( \
* Return 0 if no error, otherwise an error code.
*/
#define kfifo_alloc(fifo, size, gfp_mask) \
__kfifo_must_check_helper( \
__kfifo_int_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
struct __kfifo *__kfifo = &__tmp->kfifo; \
Expand Down Expand Up @@ -416,7 +425,7 @@ __kfifo_must_check_helper( \
* writer, you don't need extra locking to use these macro.
*/
#define kfifo_get(fifo, val) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
typeof((val) + 1) __val = (val); \
Expand Down Expand Up @@ -457,7 +466,7 @@ __kfifo_must_check_helper( \
* writer, you don't need extra locking to use these macro.
*/
#define kfifo_peek(fifo, val) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
typeof((val) + 1) __val = (val); \
Expand Down Expand Up @@ -549,7 +558,7 @@ __kfifo_must_check_helper( \
* writer, you don't need extra locking to use these macro.
*/
#define kfifo_out(fifo, buf, n) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
typeof((buf) + 1) __buf = (buf); \
Expand Down Expand Up @@ -577,7 +586,7 @@ __kfifo_must_check_helper( \
* copied.
*/
#define kfifo_out_spinlocked(fifo, buf, n, lock) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
unsigned long __flags; \
unsigned int __ret; \
Expand Down Expand Up @@ -606,7 +615,7 @@ __kfifo_must_check_helper( \
* writer, you don't need extra locking to use these macro.
*/
#define kfifo_from_user(fifo, from, len, copied) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
const void __user *__from = (from); \
Expand Down Expand Up @@ -634,7 +643,7 @@ __kfifo_must_check_helper( \
* writer, you don't need extra locking to use these macro.
*/
#define kfifo_to_user(fifo, to, len, copied) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
void __user *__to = (to); \
Expand Down Expand Up @@ -761,7 +770,7 @@ __kfifo_must_check_helper( \
* writer, you don't need extra locking to use these macro.
*/
#define kfifo_out_peek(fifo, buf, n) \
__kfifo_must_check_helper( \
__kfifo_uint_must_check_helper( \
({ \
typeof((fifo) + 1) __tmp = (fifo); \
typeof((buf) + 1) __buf = (buf); \
Expand Down

0 comments on commit 89333fe

Please sign in to comment.