From: Viresh Kumar <viresh.kumar@linaro.org>
To: Rafael Wysocki <rjw@rjwysocki.net>, tixy@linaro.org
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
Viresh Kumar <viresh.kumar@linaro.org>,
open list <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] cpufreq: cpufreq_add_dev: name goto labels based on what they do
Date: Wed, 8 Jul 2015 15:12:15 +0530 [thread overview]
Message-ID: <276debea91831d86c34079f6a40d773ce258a62c.1436348436.git.viresh.kumar@linaro.org> (raw)
These labels are are named in two ways normally:
- Based on what caused to jump to such labels
- Based on what we do under such labels
We follow the first naming convention today and that leads to multiple
labels for doing the same work. Fix it by switching to the second way of
naming them.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
Hi Rafael,
These can go in 4.3, I don't really mind :)
drivers/cpufreq/cpufreq.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index b612411655f9..b7aac8eec525 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1278,7 +1278,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
recover_policy = false;
policy = cpufreq_policy_alloc(dev);
if (!policy)
- goto nomem_out;
+ goto out_release_rwsem;
}
cpumask_copy(policy->cpus, cpumask_of(cpu));
@@ -1289,7 +1289,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
ret = cpufreq_driver->init(policy);
if (ret) {
pr_debug("initialization failed\n");
- goto err_set_policy_cpu;
+ goto out_free_policy;
}
down_write(&policy->rwsem);
@@ -1317,7 +1317,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
policy->cur = cpufreq_driver->get(policy->cpu);
if (!policy->cur) {
pr_err("%s: ->get() failed\n", __func__);
- goto err_get_freq;
+ goto out_exit_policy;
}
}
@@ -1367,7 +1367,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
if (!recover_policy) {
ret = cpufreq_add_dev_interface(policy, dev);
if (ret)
- goto err_out_unregister;
+ goto out_exit_policy;
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
CPUFREQ_CREATE_POLICY, policy);
@@ -1396,15 +1396,14 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
return 0;
-err_out_unregister:
-err_get_freq:
+out_exit_policy:
up_write(&policy->rwsem);
if (cpufreq_driver->exit)
cpufreq_driver->exit(policy);
-err_set_policy_cpu:
+out_free_policy:
cpufreq_policy_free(policy, recover_policy);
-nomem_out:
+out_release_rwsem:
up_read(&cpufreq_rwsem);
return ret;
--
2.4.0
next reply other threads:[~2015-07-08 9:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 9:42 Viresh Kumar [this message]
2015-07-08 9:42 ` [PATCH 2/2] cpufreq: Properly handle errors from cpufreq_init_policy() Viresh Kumar
2015-07-08 11:17 ` Jon Medhurst (Tixy)
2015-07-08 11:20 ` Viresh Kumar
2015-07-16 0:32 ` Rafael J. Wysocki
2015-07-16 9:16 ` Jon Medhurst (Tixy)
2015-07-16 23:07 ` Rafael J. Wysocki
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=276debea91831d86c34079f6a40d773ce258a62c.1436348436.git.viresh.kumar@linaro.org \
--to=viresh.kumar@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tixy@linaro.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).