From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3F7BB3195 for ; Thu, 10 Sep 2015 21:10:07 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 10 Sep 2015 12:09:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,506,1437462000"; d="scan'208";a="801875016" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 10 Sep 2015 12:09:48 -0700 Received: from sivlogin002.ir.intel.com (sivlogin002.ir.intel.com [10.237.217.37]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t8AJ9moF025021; Thu, 10 Sep 2015 20:09:48 +0100 Received: from sivlogin002.ir.intel.com (localhost [127.0.0.1]) by sivlogin002.ir.intel.com with ESMTP id t8AJ9mSa025546; Thu, 10 Sep 2015 20:09:48 +0100 Received: (from fyigit@localhost) by sivlogin002.ir.intel.com with œ id t8AJ9lac025542; Thu, 10 Sep 2015 20:09:47 +0100 From: Ferruh Yigit To: dev@dpdk.org Date: Thu, 10 Sep 2015 20:09:39 +0100 Message-Id: <1441912179-25291-1-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <20150910094928.7095f949@urahara> References: <20150910094928.7095f949@urahara> Subject: [dpdk-dev] [PATCH V2] igb_uio: remove unnecessary igbuio_get_uio_pci_dev() 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, 10 Sep 2015 19:10:07 -0000 Return value of igbuio_get_uio_pci_dev() is already kept in priv variable Signed-off-by: Ferruh Yigit --- lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index 865a276..3173e93 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -61,12 +61,6 @@ struct rte_uio_pci_dev { static char *intr_mode = NULL; static enum rte_intr_mode igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX; -static inline struct rte_uio_pci_dev * -igbuio_get_uio_pci_dev(struct uio_info *info) -{ - return container_of(info, struct rte_uio_pci_dev, info); -} - /* sriov sysfs */ static ssize_t show_max_vfs(struct device *dev, struct device_attribute *attr, @@ -244,7 +238,7 @@ igbuio_msix_mask_irq(struct msi_desc *desc, int32_t state) static int igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state) { - struct rte_uio_pci_dev *udev = igbuio_get_uio_pci_dev(info); + struct rte_uio_pci_dev *udev = info->priv; struct pci_dev *pdev = udev->pdev; pci_cfg_access_lock(pdev); @@ -269,7 +263,7 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state) static irqreturn_t igbuio_pci_irqhandler(int irq, struct uio_info *info) { - struct rte_uio_pci_dev *udev = igbuio_get_uio_pci_dev(info); + struct rte_uio_pci_dev *udev = info->priv; /* Legacy mode need to mask in hardware */ if (udev->mode == RTE_INTR_MODE_LEGACY && @@ -564,12 +558,13 @@ static void igbuio_pci_remove(struct pci_dev *dev) { struct uio_info *info = pci_get_drvdata(dev); - struct rte_uio_pci_dev *udev = igbuio_get_uio_pci_dev(info); + struct rte_uio_pci_dev *udev; if (info->priv == NULL) { pr_notice("Not igbuio device\n"); return; } + udev = info->priv; sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp); uio_unregister_device(info); -- 1.9.3