/* Allocate a circular buffer and all associated memory.  */
static int gs_buf_alloc(struct gs_buf *gb, unsigned size)
/* Allocate a circular buffer and all associated memory.  */
static int gs_buf_alloc(struct gs_buf *gb, unsigned size)
{
	gb->buf_buf = kmalloc(size, GFP_KERNEL);
	if (gb->buf_buf == NULL)
		return -ENOMEM;
	gb->buf_size = size;
	gb->buf_put = gb->buf_buf;
	gb->buf_get = gb->buf_buf;
	return 0;
}