From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ale.deltatee.com (ale.deltatee.com. [207.54.116.67]) by gmr-mx.google.com with ESMTPS id l22si673004ita.2.2017.12.05.11.16.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Dec 2017 11:16:59 -0800 (PST) References: <20171203191736.3399-1-fancer.lancer@gmail.com> <20171203191736.3399-6-fancer.lancer@gmail.com> From: Logan Gunthorpe Message-ID: Date: Tue, 5 Dec 2017 12:16:57 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v2 05/15] NTB: ntb_tool: Add full multi-port NTB API support To: Jon Mason , Serge Semin Cc: Dave Jiang , "Hubbe, Allen" , "S-k, Shyam-sundar" , "Yu, Xiangliang" , Gary R Hook , Sergey.Semin@t-platforms.ru, linux-ntb , linux-kernel List-ID: 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