From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Toshi Kani <toshi.kani@hp.com>,
Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Subject: [PATCH 1/2] ACPI: Drop unnecessary label from acpi_bind_one()
Date: Thu, 08 Aug 2013 01:55:21 +0200 [thread overview]
Message-ID: <21521585.9Si4heEI7J@vostro.rjw.lan> (raw)
In-Reply-To: <5685060.iNWFUGc9at@vostro.rjw.lan>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The out_free label in acpi_bind_one() is only jumped to from one
place, so in fact it is not necessary, because the code below it
can be moved to that place directly. Move that code and drop the
label.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/glue.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
Index: linux-pm/drivers/acpi/glue.c
===================================================================
--- linux-pm.orig/drivers/acpi/glue.c
+++ linux-pm/drivers/acpi/glue.c
@@ -225,11 +225,15 @@ int acpi_bind_one(struct device *dev, ac
list_for_each_entry(pn, &acpi_dev->physical_node_list, node) {
/* Sanity check. */
if (pn->dev == dev) {
+ mutex_unlock(&acpi_dev->physical_node_lock);
+
dev_warn(dev, "Already associated with ACPI node\n");
- if (ACPI_HANDLE(dev) == handle)
- retval = 0;
+ kfree(physical_node);
+ if (ACPI_HANDLE(dev) != handle)
+ goto err;
- goto out_free;
+ put_device(dev);
+ return 0;
}
if (pn->node_id == node_id) {
physnode_list = &pn->node;
@@ -262,15 +266,6 @@ int acpi_bind_one(struct device *dev, ac
ACPI_HANDLE_SET(dev, NULL);
put_device(dev);
return retval;
-
- out_free:
- mutex_unlock(&acpi_dev->physical_node_lock);
- kfree(physical_node);
- if (retval)
- goto err;
-
- put_device(dev);
- return 0;
}
EXPORT_SYMBOL_GPL(acpi_bind_one);
next prev parent reply other threads:[~2013-08-07 23:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-07 23:54 [PATCH 0/2] ACPI: More acpi_bind_one() cleanups Rafael J. Wysocki
2013-08-07 23:55 ` Rafael J. Wysocki [this message]
2013-08-07 23:55 ` [PATCH 2/2] ACPI: Print diagnostic messages if device links cannot be created Rafael J. Wysocki
2013-08-08 19:33 ` [PATCH 0/2] ACPI: More acpi_bind_one() cleanups Toshi Kani
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=21521585.9Si4heEI7J@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=toshi.kani@hp.com \
/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
all inboxes | Powered by JetHome®