lkml.org 
[lkml]   [2017]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 2/3] usb: xhci: Add DbC support in xHCI driver
From
Date
Hi,

On 11/14/2017 03:28 PM, Felipe Balbi wrote:
> Hi,
>
> Mathias Nyman <mathias.nyman@linux.intel.com> writes:
>>> +static int dbc_buf_alloc(struct dbc_buf *db, unsigned int size)
>>> +{
>>> + db->buf_buf = kzalloc(size, GFP_KERNEL);
>>> + if (!db->buf_buf)
>>> + return -ENOMEM;
>>> +
>>> + db->buf_size = size;
>>> + db->buf_put = db->buf_buf;
>>> + db->buf_get = db->buf_buf;
>>> +
>>> + return 0;
>>> +}
> you may wanna have a look at kfifo.
>

Yeah! kfifo gives me exactly what I want here.

I will replace it with kfifo. Thank you.

Best regards,
Lu Baolu

\
 
 \ /
  Last update: 2017-11-15 08:26    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog