From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id 95A89C12C for ; Thu, 7 Jan 2016 19:48:44 +0100 (CET) Received: by mail-pa0-f46.google.com with SMTP id yy13so172534533pab.3 for ; Thu, 07 Jan 2016 10:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sMuOftM2ReA8BhO/sWHJ/74TTCBfhQwQcTzXLWbpwMI=; b=q9bV8UEbixY2DaX7wUUqJe3cXQXsOUU9NoEjBwb4tjOAyCpSw/x92wawVvFsi4oJj+ BOw2Nl63xbFKrJgDccGt3ncgTIjq9gEWMoQsvD/kt7NVextQtLnwMrqQF4dCDkzRYanm 3f1U9s7N1znMncYHQXgmwoE/h8tGEhQcxZRUqUMClQMa4jCc6UIRQ6nb6t+1tCp1JTdf 5+H57k4keuOEw+Tk1UMNEAlvFapXJUwFfkDg+upYd7nFWQWURG8nBWnv4+kd6MYJmbZZ qgSc3zeyKesHUY5VaR7P9b+04ckqUpfLm4R3mMRTeX+Abr9POLgrHJDzYo15HghQdV8p rM4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=sMuOftM2ReA8BhO/sWHJ/74TTCBfhQwQcTzXLWbpwMI=; b=ae8TCvvFjWMaWX3hHfso5JvXFWzfwRMkNW7nnJAtASMJUjukplQqLmta7FMNgmgbkh WEgoynZg7TPKIL5W3uZIyfR2JmHb23M0m24e4xqj4xrciUvjxTZQpb3Ez/heJlN8Sxdq 8/x5HFlp+poqFMAuItieLuWZhIUhCFABimCQsgApDpohvVYgR3AqjYz0QQXewb/F8yQk ZqXhMCb8r0+UQ5u5sN/SDv9DaR9JnHUqSh90CZjoZbpmKiGfErNz6hCSDDWaxUXZctPE 6oNezWnjkp1PmGWFjTVzHpYI9L5SNUcgHP986V8kNJo4dTZIyYD/5kLP0aJYKOQT1w1P zd3A== X-Gm-Message-State: ALoCoQlmah9V1RPRgWy7RJFiTtDJ0quYenDIJORcQAFuaEJMmkmhKIq/M2sBR3sF0xgRieFhmXIzP9AuVwWN44asibsTJaXqaz8v/S9bYUi8MuBjusjEZ+c= MIME-Version: 1.0 X-Received: by 10.66.240.97 with SMTP id vz1mr153075301pac.29.1452192524007; Thu, 07 Jan 2016 10:48:44 -0800 (PST) Received: by 10.66.196.81 with HTTP; Thu, 7 Jan 2016 10:48:43 -0800 (PST) In-Reply-To: <20160107103943.5c630221@xeon-e3> References: <1452184390-5994-1-git-send-email-sshukla@mvista.com> <1452184390-5994-7-git-send-email-sshukla@mvista.com> <20160107101925.293062ad@xeon-e3> <20160107103943.5c630221@xeon-e3> Date: Fri, 8 Jan 2016 00:18:43 +0530 Message-ID: From: Santosh Shukla To: Stephen Hemminger Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 18:48:45 -0000 On Fri, Jan 8, 2016 at 12:09 AM, Stephen Hemminger < stephen@networkplumber.org> wrote: > On Thu, 7 Jan 2016 18:26:30 +0000 > "Wiles, Keith" wrote: > > > On 1/7/16, 12:19 PM, "dev on behalf of Stephen Hemminger" < > dev-bounces@dpdk.org on behalf of stephen@networkplumber.org> wrote: > > > > >On Thu, 7 Jan 2016 22:03:03 +0530 > > >Santosh Shukla 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 =3D &device->intr_handl= e; > > >> + 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 > > > > I would suggest we create a macro '#define RTE_UNUSED(x) ((void)x)=E2= =80=99, > unless we have one and I missed it groping though the code. > > > > > > > > > Regards, > > Keith > > > > > > > > > > Or just move the #ifdef outside the function and have two versions > > #ifdef VFIO_PRESENT > int rte_eal_pci_read_bar(const struct rte_pci_device *device, > void *buf, size_t len, > off_t offset, int bar_idx) > { > const struct rte_intr_handle *intr_handle =3D &device->intr_handl= e; > > return pci_vfio_read_bar(intr_handle, buf, len, offset, bar_idx); > } > } > #else > 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) > { > return 0; /* UIO's not applicable */ > } > #endif > I'll pick this one!, Thanks.