From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: Re: [PATCH 02/11] net/sfc/base: improve API to get supported filter matches Date: Tue, 7 Mar 2017 17:47:36 +0300 Message-ID: <7e45bfb6-812f-e7a2-f259-eeadbebb9a44@solarflare.com> References: <1488470591-5853-1-git-send-email-arybchenko@solarflare.com> <1488470591-5853-3-git-send-email-arybchenko@solarflare.com> <0305e912-1d88-f6d5-39b4-dec8c410475c@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: Mark Spender To: Ferruh Yigit , Return-path: Received: from nbfkord-smmo01.seg.att.com (nbfkord-smmo01.seg.att.com [209.65.160.76]) by dpdk.org (Postfix) with ESMTP id 57123952 for ; Tue, 7 Mar 2017 15:48:06 +0100 (CET) In-Reply-To: <0305e912-1d88-f6d5-39b4-dec8c410475c@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/07/2017 04:25 PM, Ferruh Yigit wrote: > On 3/2/2017 4:03 PM, Andrew Rybchenko wrote: >> From: Mark Spender >> >> The previous API had various problems, including the length of the >> caller provided buffer not being specified, no means being available >> to discover how big the buffer needs to be, and a lack of clarity of >> what the resulting list contains. >> >> To improve it: >> - add the buffer length as a parameter >> - if the provided buffer is too short, fail with ENOSPC and return >> the required length >> - ensure that the list contents are valid and add comments describing it >> >> It is safe to change this API as, unsuprisingly, it has no users. >> >> Signed-off-by: Mark Spender >> Signed-off-by: Andrew Rybchenko > <...> > >> >> - *length = index; >> - memcpy(list, rx_matches, *length); >> + memcpy(buffer, rx_matches, list_length * sizeof (rx_matches[0])); > Checkpatch warning: > > WARNING:SPACING: space prohibited between function name and open > parenthesis '(' > #326: FILE: drivers/net/sfc/base/efx_filter.c:1410: > + memcpy(buffer, rx_matches, list_length * sizeof (rx_matches[0])) Ferruh, it is a base driver patch and base driver has a bit different coding conventions (due to usage on other operating systems). I hope it is not a problem. Thanks, Andrew.