From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490780558; x=1522316558; h=subject:to:references:cc:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=kYALSjCaNShyFH7HYQt5JcaRBFqvbTIgfkDcjE5ByZA=; b=HhUqKsmGnOQYkzNSZ4Yfm7WVUUKP+yZ0Vk9A1sX4HIhxVgTorYlUVYpH 5Ze4U6O/FnQ8HuW7QYx4ZsLeRbIi/g==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2017 02:42:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,240,1486454400"; d="scan'208";a="82224039" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.122]) ([10.237.220.122]) by fmsmga006.fm.intel.com with ESMTP; 29 Mar 2017 02:42:29 -0700 To: Ed Czeck 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> Cc: dev@dpdk.org From: Ferruh Yigit Message-ID: <4deda4d9-388a-1399-29f7-74a8be2623e2@intel.com> Date: Wed, 29 Mar 2017 10:42:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 1/7] net/ark: PMD for Atomic Rules Arkville driver stub 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: Wed, 29 Mar 2017 09:42:39 -0000 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.