lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 27 Dec 2015 16:46:26 +0000
From:	Martyn Welch <martyn@...chs.me.uk>
To:	Geliang Tang <geliangtang@....com>,
	Manohar Vanga <manohar.vanga@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 8/9] vme: vme_ca91cx42.c: use to_pci_dev()

On 27/12/15 10:46, Geliang Tang wrote:
> Use to_pci_dev() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <geliangtang@....com>

Acked-by: Martyn Welch <martyn@...chs.me.uk>

> ---
>   drivers/vme/bridges/vme_ca91cx42.c | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c
> index b79a74a..5fbeab3 100644
> --- a/drivers/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/vme/bridges/vme_ca91cx42.c
> @@ -202,7 +202,7 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
>   	bridge = ca91cx42_bridge->driver_priv;
>   
>   	/* Need pdev */
> -	pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(ca91cx42_bridge->parent);
>   
>   	INIT_LIST_HEAD(&ca91cx42_bridge->vme_error_handlers);
>   
> @@ -293,8 +293,7 @@ static void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level,
>   	iowrite32(tmp, bridge->base + LINT_EN);
>   
>   	if ((state == 0) && (sync != 0)) {
> -		pdev = container_of(ca91cx42_bridge->parent, struct pci_dev,
> -			dev);
> +		pdev = to_pci_dev(ca91cx42_bridge->parent);
>   
>   		synchronize_irq(pdev->irq);
>   	}
> @@ -518,7 +517,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
>   		dev_err(ca91cx42_bridge->parent, "Dev entry NULL\n");
>   		return -EINVAL;
>   	}
> -	pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(ca91cx42_bridge->parent);
>   
>   	existing_size = (unsigned long long)(image->bus_resource.end -
>   		image->bus_resource.start);
> @@ -1519,7 +1518,7 @@ static void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
>   	struct pci_dev *pdev;
>   
>   	/* Find pci_dev container of dev */
> -	pdev = container_of(parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(parent);
>   
>   	return pci_alloc_consistent(pdev, size, dma);
>   }
> @@ -1530,7 +1529,7 @@ static void ca91cx42_free_consistent(struct device *parent, size_t size,
>   	struct pci_dev *pdev;
>   
>   	/* Find pci_dev container of dev */
> -	pdev = container_of(parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(parent);
>   
>   	pci_free_consistent(pdev, size, vaddr, dma);
>   }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ