From patchwork Wed Jul 8 09:42:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 50862 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3AFA5213FD for ; Wed, 8 Jul 2015 09:44:47 +0000 (UTC) Received: by wgjx7 with SMTP id x7sf68612879wgj.3 for ; Wed, 08 Jul 2015 02:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=sCbAguMshzBEpzHXlmT9Gxh/E0d1zX3kaXlg1EAd52A=; b=mEeJweY1tOtgzELu8EHKrSlFUQ2ij95jggA6+cVAR78H/viU47sEvLohPwvUvgSi57 Gt1colUa1Z5ZyWlkmL1+BtPRFOIjlGFCqR6L29/3pnjxHMHKKq3R8OdGw/wdK/QmiWfC yEFe5YnxIkuixZJxytRLaTjXq1RC2K64sAkH0qU1Bxv0YSODXgv+Koxj0qAvaEQ5OgUP ToY7gHmUxkSoBTqj6CpKP4eBqIYTWUiV77mCD45m8M7l91ZybN/3irfsQJlPsledKyF+ YZxtjAw5/ueGZJYNCbTRycSSNMsrgcpPWAeP4CAKXNHkuDBU6A5V5+rqaruL0Z/lRAFr gaGA== X-Gm-Message-State: ALoCoQn0wDcsgoXCAYPQRrI5W4IWLNWRv0+VCCUtemRpZe+o2Z3IETFngSedzQL9ndiwHPYhivXs X-Received: by 10.112.118.194 with SMTP id ko2mr4463845lbb.16.1436348686533; Wed, 08 Jul 2015 02:44:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.169 with SMTP id l9ls919619lah.52.gmail; Wed, 08 Jul 2015 02:44:46 -0700 (PDT) X-Received: by 10.152.170.234 with SMTP id ap10mr8590144lac.28.1436348686355; Wed, 08 Jul 2015 02:44:46 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id p6si1462857lbm.170.2015.07.08.02.44.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2015 02:44:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbbpo10 with SMTP id po10so52584736lbb.3 for ; Wed, 08 Jul 2015 02:44:46 -0700 (PDT) X-Received: by 10.152.36.102 with SMTP id p6mr8472181laj.19.1436348686220; Wed, 08 Jul 2015 02:44:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2957529lbb; Wed, 8 Jul 2015 02:44:45 -0700 (PDT) X-Received: by 10.70.20.196 with SMTP id p4mr18846022pde.58.1436348684465; Wed, 08 Jul 2015 02:44:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si3180129pdh.205.2015.07.08.02.44.43; Wed, 08 Jul 2015 02:44:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964893AbbGHJok (ORCPT + 29 others); Wed, 8 Jul 2015 05:44:40 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:33369 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934340AbbGHJm3 (ORCPT ); Wed, 8 Jul 2015 05:42:29 -0400 Received: by pdbdz6 with SMTP id dz6so48308038pdb.0 for ; Wed, 08 Jul 2015 02:42:28 -0700 (PDT) X-Received: by 10.66.138.40 with SMTP id qn8mr5869981pab.19.1436348548619; Wed, 08 Jul 2015 02:42:28 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id kp2sm1867393pab.12.2015.07.08.02.42.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 08 Jul 2015 02:42:27 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , tixy@linaro.org Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org (open list) 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 Message-Id: <276debea91831d86c34079f6a40d773ce258a62c.1436348436.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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;