From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id BA16C8D9F
 for <dev@dpdk.org>; Wed, 13 Jan 2016 15:47:37 +0100 (CET)
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga103.jf.intel.com with ESMTP; 13 Jan 2016 06:47:36 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,289,1449561600"; d="scan'208";a="632817274"
Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.64])
 by FMSMGA003.fm.intel.com with SMTP; 13 Jan 2016 06:47:34 -0800
Received: by  (sSMTP sendmail emulation); Wed, 13 Jan 2016 14:47:33 +0025
Date: Wed, 13 Jan 2016 14:47:33 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Message-ID: <20160113144733.GB7756@bricha3-MOBL3>
References: <1452184390-5994-1-git-send-email-sshukla@mvista.com>
 <1452184390-5994-7-git-send-email-sshukla@mvista.com>
 <20160107101925.293062ad@xeon-e3>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20160107101925.293062ad@xeon-e3>
Organization: Intel Shannon Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 06/12] eal: pci: vfio: add rd/wr func for
 pci bar space
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Jan 2016 14:47:38 -0000

On Thu, Jan 07, 2016 at 10:19:25AM -0800, Stephen Hemminger wrote:
> On Thu,  7 Jan 2016 22:03:03 +0530
> Santosh Shukla <sshukla@mvista.com> wrote:
> 
> >  
> > +int rte_eal_pci_read_bar(const struct rte_pci_device *device __rte_unused,
> > +			 void *buf __rte_unused,
> > +			 size_t len __rte_unused,
> > +			 off_t offset __rte_unused,
> > +			 int bar_idx __rte_unused)
> > +{
> > +#ifdef VFIO_PRESENT
> > +	const struct rte_intr_handle *intr_handle = &device->intr_handle;
> > +	return pci_vfio_read_bar(intr_handle, buf, len, offset, bar_idx);
> > +#else
> > +	return 0; /* UIO's not applicable */
> > +#endif
> > +}
> 
> It seems wrong to declare all the parameters as unused but then use them.
> Maybe there is a way to have a macro for USED(x) in the #else case

There is RTE_SET_USED() in rte_common.h.
I'd prefer that macro used than the option of duplicating the entire function
which really pads out the code.

/Bruce