[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa4e3376-7113-9a7a-548c-be0ee685edb5@deltatee.com>
Date: Tue, 5 Dec 2017 12:16:57 -0700
From: Logan Gunthorpe <logang@...tatee.com>
To: Jon Mason <jdmason@...zu.us>, Serge Semin <fancer.lancer@...il.com>
Cc: Dave Jiang <dave.jiang@...el.com>,
"Hubbe, Allen" <Allen.Hubbe@....com>,
"S-k, Shyam-sundar" <Shyam-sundar.S-k@....com>,
"Yu, Xiangliang" <Xiangliang.Yu@....com>,
Gary R Hook <gary.hook@....com>, Sergey.Semin@...latforms.ru,
linux-ntb <linux-ntb@...glegroups.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [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
Powered by blists - more mailing lists