* Re: [dpdk-dev] [PATCH] igb_uio: remove unnecessary igbuio_get_uio_pci_dev()
[not found] <1441900891-27736-1-git-send-email-ferruh.yigit@intel.com>
@ 2015-09-10 16:49 ` Stephen Hemminger
2015-09-10 19:09 ` [dpdk-dev] [PATCH V2] " Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2015-09-10 16:49 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
On Thu, 10 Sep 2015 17:01:31 +0100
Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> + struct rte_uio_pci_dev *udev = (struct rte_uio_pci_dev *)info->priv;
Cast of void * is never needed in C.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH V2] igb_uio: remove unnecessary igbuio_get_uio_pci_dev()
2015-09-10 16:49 ` [dpdk-dev] [PATCH] igb_uio: remove unnecessary igbuio_get_uio_pci_dev() Stephen Hemminger
@ 2015-09-10 19:09 ` Ferruh Yigit
2015-10-25 17:48 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2015-09-10 19:09 UTC (permalink / raw)
To: dev
Return value of igbuio_get_uio_pci_dev() is already kept in priv
variable
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH V2] igb_uio: remove unnecessary igbuio_get_uio_pci_dev()
2015-09-10 19:09 ` [dpdk-dev] [PATCH V2] " Ferruh Yigit
@ 2015-10-25 17:48 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-10-25 17:48 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
2015-09-10 20:09, Ferruh Yigit:
> Return value of igbuio_get_uio_pci_dev() is already kept in priv
> variable
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-25 17:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1441900891-27736-1-git-send-email-ferruh.yigit@intel.com>
2015-09-10 16:49 ` [dpdk-dev] [PATCH] igb_uio: remove unnecessary igbuio_get_uio_pci_dev() Stephen Hemminger
2015-09-10 19:09 ` [dpdk-dev] [PATCH V2] " Ferruh Yigit
2015-10-25 17:48 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).