mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
fs/pipe: express 'pipe_empty()' in terms of 'pipe_occupancy()'
That's what 'pipe_full()' does, so it's more consistent. But more importantly it gets the type limits right when the pipe head and tail are no longer necessarily 'unsigned int'. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -176,16 +176,6 @@ static inline bool pipe_has_watch_queue(const struct pipe_inode_info *pipe)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* pipe_empty - Return true if the pipe is empty
|
||||
* @head: The pipe ring head pointer
|
||||
* @tail: The pipe ring tail pointer
|
||||
*/
|
||||
static inline bool pipe_empty(unsigned int head, unsigned int tail)
|
||||
{
|
||||
return head == tail;
|
||||
}
|
||||
|
||||
/**
|
||||
* pipe_occupancy - Return number of slots used in the pipe
|
||||
* @head: The pipe ring head pointer
|
||||
@@ -196,6 +186,16 @@ static inline unsigned int pipe_occupancy(unsigned int head, unsigned int tail)
|
||||
return (pipe_index_t)(head - tail);
|
||||
}
|
||||
|
||||
/**
|
||||
* pipe_empty - Return true if the pipe is empty
|
||||
* @head: The pipe ring head pointer
|
||||
* @tail: The pipe ring tail pointer
|
||||
*/
|
||||
static inline bool pipe_empty(unsigned int head, unsigned int tail)
|
||||
{
|
||||
return !pipe_occupancy(head, tail);
|
||||
}
|
||||
|
||||
/**
|
||||
* pipe_full - Return true if the pipe is full
|
||||
* @head: The pipe ring head pointer
|
||||
|
||||
Reference in New Issue
Block a user