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 2185CA00C2; Thu, 8 Dec 2022 18:12:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C285540E28; Thu, 8 Dec 2022 18:12:00 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4E81340A7E for ; Thu, 8 Dec 2022 18:11:59 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 5BF6020B6C40; Thu, 8 Dec 2022 09:11:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5BF6020B6C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1670519518; bh=TXfKkqHnJqW46MmLH3oESojjobuIqvhQGU1skqn68yY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q+daEgx8sJmM+lvEesWAlJ2ZkfJly6V4upnSgF4G32M6VBPVHKMrBbI7nyXpNBy11 lMzbCSVrSCmQRQ7lvB73bbJn7enM1wmuV/fO9u2l1owTeb3JVyLOY3DA7l/TeX9Lmv EqGNz9uq1jBXAbPgt58bRz1o7IS9maKKtCh7AVbw= Date: Thu, 8 Dec 2022 09:11:58 -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: <20221208171158.GA29469@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> <20221207223331.GA26293@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20221207200716.704ea76a@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207200716.704ea76a@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 08:07:16PM -0800, Stephen Hemminger wrote: > On Wed, 7 Dec 2022 14:33:31 -0800 > Tyler Retzlaff wrote: > > > 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). > > I think it is an old BSD lint ism. > Haven't seen it used in years. i guess you're calling me old? and yes it was also used to suppress lint warnings. i'll remove it in the next rebase. thanks.