From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5716EA00C3; Wed, 7 Dec 2022 23:33:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39ABC40F17; Wed, 7 Dec 2022 23:33:34 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 1F8EE40146 for ; Wed, 7 Dec 2022 23:33:32 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 29EA320B6C40; Wed, 7 Dec 2022 14:33:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 29EA320B6C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1670452411; bh=kRx6gTqyxK9wMvPg46isKr8CHl3k0CU1PQWx1yEjkOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ob+39pRWvh+0u2WkHfFdwDj4d921X3rdmLvM0IHvfuq3aA6LxR2JFQFOghPKGhjsp liIy/d+QcKoREHdOYc5Vpqefup9laZigKftH1YbcAPsFQqJlO9WCymGBnxKraPCXJY uaiDRU8gvtyT5i5lr/0qudvF+HayHXku/dkwPYvg= Date: Wed, 7 Dec 2022 14:33:31 -0800 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, olivier.matz@6wind.com Subject: Re: [PATCH 1/5] eal: add lcore set name and get name API Message-ID: <20221207223331.GA26293@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1670439617-9054-1-git-send-email-roretzla@linux.microsoft.com> <1670439617-9054-2-git-send-email-roretzla@linux.microsoft.com> <20221207130341.30d6f22f@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207130341.30d6f22f@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Dec 07, 2022 at 01:03:41PM -0800, Stephen Hemminger wrote: > On Wed, 7 Dec 2022 11:00:13 -0800 > Tyler Retzlaff wrote: > > > +static char lcore_names[RTE_MAX_LCORE][RTE_LCORE_NAME_MAX_LEN]; > > This copy would redundant on Linux. > > > + > > +int > > +rte_lcore_set_name(unsigned int lcore_id, const char *name) > > +{ > > + if (unlikely(lcore_id >= RTE_MAX_LCORE)) > > + return -EINVAL; > > + > > + if (strlen(name) >= RTE_LCORE_NAME_MAX_LEN) > > + return -ERANGE; > > + > > + (void)strcpy(&lcore_names[lcore_id][0], name); > > Why the void cast? it's a common convention used in various open source projects indicating the that ignoring the return value is intentional as opposed to being sloppy or accidental. if it's a violation of dpdk style i'll remove it. but i have come across a lot of dpdk code where i honestly can't tell if it is on purpose or just sloppyness. (sticks out in code reviews too).