public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org, wharms@bfs.de,
	w.sang@pengutronix.de, agust@denx.de
Subject: Re: [PATCH v3] drivers/ata/pata_mpc52xx.c: clean up error handling code
Date: Tue, 13 Mar 2012 16:45:14 -0400	[thread overview]
Message-ID: <4F5FB1DA.6070009@pobox.com> (raw)
In-Reply-To: <1331496729-12850-1-git-send-email-Julia.Lawall@lip6.fr>

On 03/11/2012 04:12 PM, Julia Lawall wrote:
> From: Julia Lawall<Julia.Lawall@lip6.fr>
>
> This patch makes a number of changes with respect to the error-handling
> code:
>
> * Remove cleanup calls for the devm functions in both the error handling
>    code and the remove function.  This cleanup is done automatically.
>
> * The previous change simplifies the cleanup code at the end of the
>    function such that there is nothing to do on the failure of the call to
>    devm_ioremap.  So it is changed to just return directly.
>
> * There is no need for the ifs in the cleanup code at the end of the
>    function, because in each case the cleanup needed is statically
>    known.  Drop the ifs, add new err labels, and drop the initializations of
>    the tested variables to NULL.
>
> * Change the call to request_irq to a call to devm_request_irq, so that it
>    is cleaned up on exit.
>
> * Cause the return value of devm_request_irq to go into the returned
>    variable rv rather than the unused variable ret.  Drop ret.
>
> Signed-off-by: Julia Lawall<Julia.Lawall@lip6.fr>
>
> ---
> This subsumes the previous patch that only removed the calls to the devm
> cleanup functions.  It is not tested.  I am not sure about the correctness
> of the use of devm_request_irq, since there were no calls to free_irq
> before.  I also don't know if there was a reason for not returning the
> return value of request_irq previously.
>
>   drivers/ata/pata_mpc52xx.c |   44 +++++++++++++++-----------------------------
>   1 file changed, 15 insertions(+), 29 deletions(-)

applied




      reply	other threads:[~2012-03-13 20:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-11 20:12 [PATCH v3] drivers/ata/pata_mpc52xx.c: clean up error handling code Julia Lawall
2012-03-13 20:45 ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F5FB1DA.6070009@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=agust@denx.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=w.sang@pengutronix.de \
    --cc=wharms@bfs.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox