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] [day] [month] [year] [list]
Message-ID: <20200914030443.GA12542@archbook>
Date:   Sun, 13 Sep 2020 20:04:43 -0700
From:   Moritz Fischer <mdf@...nel.org>
To:     Moritz Fischer <mdf@...nel.org>
Cc:     davem@...emloft.net, snelson@...sando.io, mst@...hat.com,
        hkallweit1@...il.com, netdev@...r.kernel.org,
        linux-parisc@...r.kernel.org, linux-kernel@...r.kernel.org,
        moritzf@...gle.com
Subject: Re: [PATCH net-next 2/3] net: dec: tulip: de2104x: Replace
 pci_enable_device with devres version

On Sun, Sep 13, 2020 at 05:10:01PM -0700, Moritz Fischer wrote:
> Replace pci_enable_device() with its devres counterpart
> pcim_enable_device().
> 
> Signed-off-by: Moritz Fischer <mdf@...nel.org>
> ---
>  drivers/net/ethernet/dec/tulip/de2104x.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
> index 9bcfc82b71d1..e4189c45c2ba 100644
> --- a/drivers/net/ethernet/dec/tulip/de2104x.c
> +++ b/drivers/net/ethernet/dec/tulip/de2104x.c
> @@ -2009,14 +2009,14 @@ static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	netif_carrier_off(dev);
>  
>  	/* wake up device, assign resources */
> -	rc = pci_enable_device(pdev);
> +	rc = pcim_enable_device(pdev);
>  	if (rc)
>  		return rc;
>  
>  	/* reserve PCI resources to ensure driver atomicity */
>  	rc = pci_request_regions(pdev, DRV_NAME);
>  	if (rc)
> -		goto err_out_disable;
> +		return rc;
>  
>  	/* check for invalid IRQ value */
>  	if (pdev->irq < 2) {
> @@ -2096,8 +2096,6 @@ static int de_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	iounmap(regs);
>  err_out_res:
>  	pci_release_regions(pdev);
> -err_out_disable:
> -	pci_disable_device(pdev);
>  	return rc;
>  }
>  
> @@ -2111,7 +2109,6 @@ static void de_remove_one(struct pci_dev *pdev)
>  	kfree(de->ee_data);
>  	iounmap(de->regs);
>  	pci_release_regions(pdev);
> -	pci_disable_device(pdev);
>  }
>  
>  #ifdef CONFIG_PM
> -- 
> 2.28.0
> 

Ugh, sorry for the noise, I missed the instances in the suspend/resume.
Let me resend a v2 of this ...

Thanks,
Moritz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ