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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1208271900520.2079@hadrien>
Date:	Mon, 27 Aug 2012 19:04:10 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Sergei Shtylyov <sshtylyov@...sta.com>
cc:	Julia Lawall <Julia.Lawall@...6.fr>, Sekhar Nori <nsekhar@...com>,
	Kevin Hilman <khilman@...com>,
	davinci-linux-open-source@...ux.davincidsp.com,
	kernel-janitors@...r.kernel.org,
	"Wolfram Sang (embedded platforms)" <w.sang@...gutronix.de>,
	linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
	"Ben Dooks (embedded platforms)" <ben-linux@...ff.org>,
	"Jean Delvare (PC drivers, core)" <khali@...ux-fr.org>
Subject: Re: [PATCH 6/6] i2c: davinci: use devm_ functions

> > -	ioarea = request_mem_region(mem->start, resource_size(mem),
> > -				    pdev->name);
> > -	if (!ioarea) {
> > -		dev_err(&pdev->dev, "I2C region already claimed\n");
> > -		return -EBUSY;
> > -	}
>
>    Shouldn't you have dropped the 'ioarea' variable? It should be unused now...

Indeed, this is probably the case.  I will check.

> > @@ -699,14 +685,15 @@ static int davinci_i2c_probe(struct platform_device *pdev)
> [...]
> > -	dev->base = ioremap(mem->start, resource_size(mem));
> > +	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>
>    Why you dropped check form 'mem' being NULL?

devm_request_and_ioremap does the check.  There have been some discussions
about this before.  Since the code is overall complicated and error-prone,
it seems better to minimize it when possible.

> > +	dev->base = devm_request_and_ioremap(&pdev->dev, mem);
> >  	if (!dev->base) {
> >  		r = -EBUSY;
> >  		goto err_mem_ioremap;
> > @@ -714,16 +701,17 @@ static int davinci_i2c_probe(struct platform_device *pdev)
> >
> >  	i2c_davinci_init(dev);
> >
> > -	r = request_irq(dev->irq, i2c_davinci_isr, 0, pdev->name, dev);
> > +	r = devm_request_irq(&pdev->dev, dev->irq, i2c_davinci_isr, 0,
> > +			     pdev->name, dev);
> >  	if (r) {
> >  		dev_err(&pdev->dev, "failure requesting irq %i\n", dev->irq);
> > -		goto err_unuse_clocks;
> > +		goto err_mem_ioremap;
>
>    The label no longer corresponds the failure happening. Perhaps it's better to
> leave 'err_unuse_clocks'...

OK.  It seemed nicer not to have a stack of empty labels...

I'll send another patch shortly.

julia

> >  	}
> >
> >  	r = i2c_davinci_cpufreq_register(dev);
> >  	if (r) {
> >  		dev_err(&pdev->dev, "failed to register cpufreq\n");
> > -		goto err_free_irq;
> > +		goto err_mem_ioremap;
>
>    Ditto...
>
> > @@ -740,26 +728,18 @@ static int davinci_i2c_probe(struct platform_device *pdev)
> >  	r = i2c_add_numbered_adapter(adap);
> >  	if (r) {
> >  		dev_err(&pdev->dev, "failure adding adapter\n");
> > -		goto err_free_irq;
> > +		goto err_mem_ioremap;
>
>    Ditto...
>
> WBR, Sergei
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
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