lkml.org 
[lkml]   [2017]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 05/15] NTB: ntb_tool: Add full multi-port NTB API support


On 05/12/17 11:03 AM, Jon Mason wrote:
>> +static ssize_t tool_fn_read(struct tool_ctx *tc, char __user *ubuf,
>> + size_t size, loff_t *offp,
>> + u64 (*fn_read)(struct ntb_dev *))
>> {
>> size_t buf_size;
>> - char *buf;
>> - ssize_t pos, rc;
>> + char buf[32];
>
> I would think you would want the malloc like before, but if not then
> make this a #define and reference it as necessary throughout the code.

I disagree. Allocating a small 32-byte buf on the stack is a nice
cleanup. I'm not sure what you are referring to about the #define.

Logan

\
 
 \ /
  Last update: 2017-12-05 20:17    [W:0.061 / U:2.852 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site