From: Ferruh Yigit Date: Thu, 10 Sep 2015 19:09:39 +0000 (+0100) Subject: igb_uio: remove unnecessary function to get device X-Git-Tag: spdx-start~8363 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d1392d26f3e2f46cb723a1b8784dd13ae20e51b5;p=dpdk.git igb_uio: remove unnecessary function to get device Return value of igbuio_get_uio_pci_dev() is already kept in priv variable. Signed-off-by: Ferruh Yigit --- diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index 865a2764f5..3173e93e9f 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);