From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 4/4] eal: add assert macro for debug Date: Fri, 29 Apr 2016 11:04:52 +0200 Message-ID: <4314823.GZ8AKUaKyk@xps13> References: <1461332640-24273-1-git-send-email-thomas.monjalon@6wind.com> <20160422220850.GF7603@yliu-dev.sh.intel.com> <20160422154239.5a3edecf@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Stephen Hemminger , Yuanhan Liu Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 50436558B for ; Fri, 29 Apr 2016 11:04:55 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id n129so19154703wmn.1 for ; Fri, 29 Apr 2016 02:04:55 -0700 (PDT) In-Reply-To: <20160422154239.5a3edecf@xeon-e3> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-04-22 15:42, Stephen Hemminger: > On Fri, 22 Apr 2016 15:08:50 -0700 > Yuanhan Liu wrote: > > On Fri, Apr 22, 2016 at 11:14:35PM +0200, Thomas Monjalon wrote: > > > rxd = (Vmxnet3_RxDesc *)rxq->cmd_ring[ring_idx].base + idx; > > > + RTE_SET_USED(rxd); /* used only for assert when enabled */ > > > > How about adding the __rte_unused tag at where we declare it? It is not really unused. And adding a SET_USED line allows to put a comment in the context below the assignment. > Why not just kill the useless assert's all together? They really only helped > during the short time developer is debugging this code. They also provide some kind of comments and can help when refactoring. Anyway, removing the assert would deserve another patch.