return fifo->in - fifo->out;
}
+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