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:	Tue, 12 Mar 2013 15:17:28 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Silviu-Mihai Popescu <silviupopescu1990@...il.com>
CC:	linux-mips@...ux-mips.org, ralf@...ux-mips.org, juhosg@...nwrt.org,
	blogic@...nwrt.org, kaloz@...nwrt.org, xsecute@...glemail.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] pci: convert to devm_ioremap_resource()

Hello.

On 12-03-2013 11:28, Silviu-Mihai Popescu wrote:

> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.

> devm_ioremap_resource() provides its own error messages so all explicit
> error messages can be removed from the failure code paths.

    There were no error messages as far as I could see, so this passage seems 
superfluous...

> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@...il.com>
> ---
>   arch/mips/pci/pci-ar71xx.c |    6 +++---
>   arch/mips/pci/pci-ar724x.c |   18 +++++++++---------
>   2 files changed, 12 insertions(+), 12 deletions(-)

> diff --git a/arch/mips/pci/pci-ar71xx.c b/arch/mips/pci/pci-ar71xx.c
> index 412ec02..18517dd 100644
> --- a/arch/mips/pci/pci-ar71xx.c
> +++ b/arch/mips/pci/pci-ar71xx.c
> @@ -366,9 +366,9 @@ static int ar71xx_pci_probe(struct platform_device *pdev)
>   	if (!res)
>   		return -EINVAL;
>
> -	apc->cfg_base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!apc->cfg_base)
> -		return -ENOMEM;
> +	apc->cfg_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(apc->cfg_base))
> +		return PTR_ERR(apc->cfg_base);
>
>   	apc->irq = platform_get_irq(pdev, 0);
>   	if (apc->irq < 0)
> diff --git a/arch/mips/pci/pci-ar724x.c b/arch/mips/pci/pci-ar724x.c
> index 8a0700d..65ec032 100644
> --- a/arch/mips/pci/pci-ar724x.c
> +++ b/arch/mips/pci/pci-ar724x.c
> @@ -365,25 +365,25 @@ static int ar724x_pci_probe(struct platform_device *pdev)
>   	if (!res)
>   		return -EINVAL;
>
> -	apc->ctrl_base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (apc->ctrl_base == NULL)
> -		return -EBUSY;
> +	apc->ctrl_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(apc->ctrl_base))
> +		return PTR_ERR(apc->ctrl_base);
>
>   	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base");
>   	if (!res)
>   		return -EINVAL;
>
> -	apc->devcfg_base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!apc->devcfg_base)
> -		return -EBUSY;
> +	apc->devcfg_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(apc->devcfg_base))
> +		return PTR_ERR(apc->devcfg_base);
>
>   	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "crp_base");
>   	if (!res)
>   		return -EINVAL;
>
> -	apc->crp_base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (apc->crp_base == NULL)
> -		return -EBUSY;
> +	apc->crp_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(apc->crp_base))
> +		return PTR_ERR(apc->crp_base);
>
>   	apc->irq = platform_get_irq(pdev, 0);
>   	if (apc->irq < 0)

WBR, Sergei


--
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