/* Return the number of bytes of data available in the circular buffer.  */
static unsigned int edge_buf_data_avail(struct edge_buf *eb)
/* Return the number of bytes of data available in the circular buffer.  */
static unsigned int edge_buf_data_avail(struct edge_buf *eb)
{
	if (eb == NULL)
		return 0;
	return ((eb->buf_size + eb->buf_put - eb->buf_get) % eb->buf_size);
}