From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v4 1/7] net/ark: PMD for Atomic Rules Arkville driver stub Date: Wed, 29 Mar 2017 10:42:28 +0100 Message-ID: <4deda4d9-388a-1399-29f7-74a8be2623e2@intel.com> References: <1490231015-31748-1-git-send-email-ed.czeck@atomicrules.com> <0d1c21b6-6163-12f0-cbe4-d23c06a809e9@intel.com> <8625c310-943c-14b5-8215-b1f66bb94bb2@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Ed Czeck Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 9BF742C8 for ; Wed, 29 Mar 2017 11:42:38 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 3/28/2017 10:11 PM, Ed Czeck wrote: > On Tue, Mar 28, 2017 at 8:58 AM, Ferruh Yigit > wrote: > > On 3/23/2017 7:46 PM, Ed Czeck wrote: > > >> > +#define ARK_TRACE_ON(fmt, ...) \ > >> > + PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__) > >> > + > >> > +#define ARK_TRACE_OFF(fmt, ...) \ > >> > + do {if (0) PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__); } while (0) > >> why not just "do { } while(0)" ? > > > > A do while body always executes at least once. The if (0) is required. > > Are you sure about this? > > I believe "do { } while(0)" also removed completely during compile. > > I verified that the if (0) is required. I have seen a comment added in next version: /* This pattern allows compiler check arguments even if disabled */ This clarifies the usage, and if(0), thanks.