From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] ethdev: report error on name truncation Date: Thu, 17 Jan 2019 16:38:54 +0100 Message-ID: <1842598.N7HBfy6t9g@xps> References: <20190107143951.30076-1-ndabilpuram@marvell.com> <20190117141316.24187-1-ndabilpuram@marvell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Andrew Rybchenko , Jerin Jacob Kollanukkaran To: Nithin Kumar Dabilpuram , Ferruh Yigit Return-path: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 977F5A3 for ; Thu, 17 Jan 2019 16:38:59 +0100 (CET) In-Reply-To: <20190117141316.24187-1-ndabilpuram@marvell.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" 17/01/2019 15:13, Nithin Kumar Dabilpuram: > Currently this api doesn't report error if name is > truncated and so user is not sure about uniqueness > of name. This change reports error to help user. > > Signed-off-by: Nithin Dabilpuram > --- > + rc = snprintf(z_name, sizeof(z_name), "eth_p%d_q%d_%s", > + dev->data->port_id, queue_id, ring_name); > + > + if (rc >= RTE_MEMZONE_NAMESIZE) { > + RTE_ETHDEV_LOG(ERR, "ring name too long\n"); > + rte_errno = ENAMETOOLONG; > + return NULL; > + } Usually we don't insert a blank line before a test of a return value. It's really a nitpick, so Ferruh, it's up to you to keep it or not when applying. Acked-by: Thomas Monjalon