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:	Wed, 12 Feb 2014 09:12:37 +0100
From:	Nicolas Ferre <nicolas.ferre@...el.com>
To:	Jingoo Han <jg1.han@...sung.com>,
	'Herbert Xu' <herbert@...dor.apana.org.au>
CC:	<linux-kernel@...r.kernel.org>,
	'Peter Korsgaard' <jacmet@...site.dk>
Subject: Re: [PATCH 1/2] hwrng: atmel - Use devm_ioremap_resource()

On 12/02/2014 06:17, Jingoo Han :
> Use devm_ioremap_resource() in order to make the code simpler,
> and remove redundant return value check of platform_get_resource()
> because the value is checked by devm_ioremap_resource().
> 
> Signed-off-by: Jingoo Han <jg1.han@...sung.com>

Acked-by: Nicolas Ferre <nicolas.ferre@...el.com>

Thanks! Bye,

> ---
>  drivers/char/hw_random/atmel-rng.c |   15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
> index bf9fc6b..dfeddf2 100644
> --- a/drivers/char/hw_random/atmel-rng.c
> +++ b/drivers/char/hw_random/atmel-rng.c
> @@ -54,21 +54,14 @@ static int atmel_trng_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int ret;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res)
> -		return -EINVAL;
> -
>  	trng = devm_kzalloc(&pdev->dev, sizeof(*trng), GFP_KERNEL);
>  	if (!trng)
>  		return -ENOMEM;
>  
> -	if (!devm_request_mem_region(&pdev->dev, res->start,
> -				     resource_size(res), pdev->name))
> -		return -EBUSY;
> -
> -	trng->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> -	if (!trng->base)
> -		return -EBUSY;
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	trng->base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(trng->base))
> +		return PTR_ERR(trng->base);
>  
>  	trng->clk = clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(trng->clk))
> 


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