From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 288C01B4DB; Thu, 29 Nov 2018 16:36:32 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Nov 2018 07:36:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,295,1539673200"; d="scan'208";a="106776136" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.109]) ([10.237.220.109]) by FMSMGA003.fm.intel.com with ESMTP; 29 Nov 2018 07:36:30 -0800 To: "Wiles, Keith" Cc: dpdk-dev , "stable@dpdk.org" References: From: "Burakov, Anatoly" Message-ID: <55beddff-0c3a-63c0-e793-636265175c75@intel.com> Date: Thu, 29 Nov 2018 15:36:29 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 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: [dpdk-dev] [PATCH] malloc: fix duplicate mem event notification X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 15:36:34 -0000 On 29-Nov-18 2:54 PM, Wiles, Keith wrote: > > >> On Nov 29, 2018, at 8:21 AM, Anatoly Burakov wrote: >> >> We already trigger a mem event notification inside the walk function, >> no need to do it twice. >> >> Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory") >> Cc: stable@dpdk.org >> >> Signed-off-by: Anatoly Burakov >> --- >> lib/librte_eal/common/rte_malloc.c | 4 ---- >> 1 file changed, 4 deletions(-) >> >> diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c >> index 0da5ad5e8..750a83c2c 100644 >> --- a/lib/librte_eal/common/rte_malloc.c >> +++ b/lib/librte_eal/common/rte_malloc.c >> @@ -518,10 +518,6 @@ sync_memory(const char *heap_name, void *va_addr, size_t len, bool attach) >> rte_errno = -wa.result; >> ret = -1; >> } else { >> - /* notify all subscribers that a new memory area was added */ >> - if (attach) >> - eal_memalloc_mem_event_notify(RTE_MEM_EVENT_ALLOC, >> - va_addr, len); >> ret = 0; >> } > > This change leaves > else { > ret = 0; > } > > Needs to be: > else > ret = 0; > Checkpatch disagrees :P Brackets are needed everywhere if at least one of the branches is a multiline branch. No brackets needed only if all branches are one-line branches. As a side note, I would also argue that we shouldn't leave bracket-less if statements altogether, because it makes for extra effort whenever a single-line statement inevitably becomes a multiline one (e.g. could be as simple as putting in a debug printf - i now have to add brackets everywhere...). But that's a topic for another day :) > >> unlock: >> -- >> 2.17.1 > > Regards, > Keith > > -- Thanks, Anatoly