/* Return the number of bytes of space available in the circular buffer.  */
static unsigned int cypress_buf_space_avail(struct cypress_buf *cb)
/* Return the number of bytes of space available in the circular buffer.  */
static unsigned int cypress_buf_space_avail(struct cypress_buf *cb)
{
	if (cb != NULL)
		return (cb->buf_size + cb->buf_get - cb->buf_put - 1)
							% cb->buf_size;
	else
		return 0;
}