linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan.Cameron@huawei.com (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/8] firmware: arm_scmi: simplify exit path by returning on error
Date: Thu, 17 May 2018 10:14:39 +0100	[thread overview]
Message-ID: <20180517101439.00007ba9@huawei.com> (raw)
In-Reply-To: <1525885634-22348-9-git-send-email-sudeep.holla@arm.com>

On Wed, 9 May 2018 18:07:14 +0100
Sudeep Holla <sudeep.holla@arm.com> wrote:

> Yet another nasty indentation left out during code restructuring. It's
> must simpler to return on error instead of having unnecessary indentation.
> 
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


> ---
>  drivers/firmware/arm_scmi/driver.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 4087d6c50ecd..e996395af5f2 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -687,11 +687,12 @@ static int scmi_remove(struct platform_device *pdev)
>  		list_del(&info->node);
>  	mutex_unlock(&scmi_list_mutex);
>  
> -	if (!ret) {
> -		/* Safe to free channels since no more users */
> -		ret = idr_for_each(idr, scmi_mbox_free_channel, idr);
> -		idr_destroy(&info->tx_idr);
> -	}
> +	if (ret)
> +		return ret;
> +
> +	/* Safe to free channels since no more users */
> +	ret = idr_for_each(idr, scmi_mbox_free_channel, idr);
> +	idr_destroy(&info->tx_idr);
>  
>  	return ret;
>  }

      reply	other threads:[~2018-05-17  9:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 17:07 [PATCH 0/8] firmware: arm_scmi: trivial cleanups Sudeep Holla
2018-05-09 17:07 ` [PATCH 1/8] firmware: arm_scmi: improve code readability using bitfield accessor macros Sudeep Holla
2018-05-17  8:14   ` Jonathan Cameron
2018-05-09 17:07 ` [PATCH 2/8] firmware: arm_scmi: fix kernel-docs documentation Sudeep Holla
2018-05-17  8:30   ` Jonathan Cameron
2018-05-09 17:07 ` [PATCH 3/8] firmware: arm_scmi: rename get_transition_latency and add_opps_to_device Sudeep Holla
2018-05-10  8:29   ` Rafael J. Wysocki
2018-05-10  9:53     ` Sudeep Holla
2018-05-17  8:32   ` Jonathan Cameron
2018-05-09 17:07 ` [PATCH 4/8] firmware: arm_scmi: rename scmi_xfer_{init,get,put} Sudeep Holla
2018-05-17  8:38   ` Jonathan Cameron
2018-05-09 17:07 ` [PATCH 5/8] firmware: arm_scmi: drop unused `con_priv` structure member Sudeep Holla
2018-05-17  8:41   ` Jonathan Cameron
2018-05-09 17:07 ` [PATCH 6/8] firmware: arm_scmi: remove unnecessary bitmap_zero Sudeep Holla
2018-05-17  8:43   ` Jonathan Cameron
2018-05-09 17:07 ` [PATCH 7/8] firmware: arm_scmi: improve exit paths and code readability Sudeep Holla
2018-05-17  9:13   ` Jonathan Cameron
2018-05-09 17:07 ` [PATCH 8/8] firmware: arm_scmi: simplify exit path by returning on error Sudeep Holla
2018-05-17  9:14   ` Jonathan Cameron [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=20180517101439.00007ba9@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).