summaryrefslogtreecommitdiff
path: root/fifo.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-09-23 10:35:49 -0600
committerJens Axboe <axboe@fb.com>2014-09-23 10:35:49 -0600
commitf747ad2c5352b977007997b454333be37de7f4c9 (patch)
tree7126342c48962c564b3c80abed55e6e095b79814 /fifo.h
parentc0b69b92fb155424946b19228da9be0924e9e96c (diff)
downloadfio-f747ad2c5352b977007997b454333be37de7f4c9.tar.gz
fio-f747ad2c5352b977007997b454333be37de7f4c9.tar.bz2
fifo: use minmax.h instead of rolling its own min/max
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fifo.h')
-rw-r--r--fifo.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/fifo.h b/fifo.h
index 74913653..4b775b0b 100644
--- a/fifo.h
+++ b/fifo.h
@@ -1,3 +1,5 @@
+#ifndef FIO_FIFO_H
+#define FIO_FIFO_H
/*
* A simple FIFO implementation.
*
@@ -18,6 +20,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
+#include "minmax.h"
+
struct fifo {
unsigned char *buffer; /* the buffer holding the data */
unsigned int size; /* the size of the allocated buffer */
@@ -40,19 +44,4 @@ static inline unsigned int fifo_room(struct fifo *fifo)
return fifo->size - fifo->in + fifo->out;
}
-#ifndef min
-#define min(x,y) ({ \
- typeof(x) _x = (x); \
- typeof(y) _y = (y); \
- (void) (&_x == &_y); \
- _x < _y ? _x : _y; })
-#endif
-
-#ifndef max
-#define max(x,y) ({ \
- typeof(x) _x = (x); \
- typeof(y) _y = (y); \
- (void) (&_x == &_y); \
- _x > _y ? _x : _y; })
-
#endif