From patchwork Sun Sep 22 01:20:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20509 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6FEFB25E85 for ; Sun, 22 Sep 2013 01:22:09 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id a41sf1937385yho.2 for ; Sat, 21 Sep 2013 18:22:09 -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:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=6Ai+MtlDBoMQukBuI1arZbesFAtTfoiO9sLLCOqD17U=; b=gP1pM1VFfMsCm/HjPHnJEEp6A8fpm+qb6UPPQVNHa+6yRqzVZ0O342ZYHPvzT8/qnI j8cfsTaQhHv3FhTj6JCwfkTrVeXn6ze1EMrRHxUVamAwopwNmwA6Ql0GwNKZE2GYkrf3 wp5lytcR0JOiqFDwd83Ep5XBZlUVZg/vNeQXgAu8Y5PmM7ZHrxDzUZur+d4IFeoqlnJT OFS4DQnLJt8gv0k1kdfz6DGVzASKIY+LSkGZUAuhgciompLoopl4FZC85sjkAZ3aWZjb Djw5cVEfZgXNJT/UvAb44dztYxOIQqVOq+jRqW/IH1WwgzI8pg1znod01r4iSBQt1lgN Pugw== X-Gm-Message-State: ALoCoQmFpArKZQpJGjC0AyuDh9LfCPPZsppFcyLWpCz0TQO/pFsE18GZ1uu0EpuWJRrO273mqYnn X-Received: by 10.224.112.133 with SMTP id w5mr6586459qap.5.1379812929261; Sat, 21 Sep 2013 18:22:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.2.166 with SMTP id 6ls713352qev.69.gmail; Sat, 21 Sep 2013 18:22:09 -0700 (PDT) X-Received: by 10.52.119.228 with SMTP id kx4mr11915975vdb.12.1379812929152; Sat, 21 Sep 2013 18:22:09 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id b6si4553892veo.22.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Sep 2013 18:22:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so1476240veb.27 for ; Sat, 21 Sep 2013 18:22:09 -0700 (PDT) X-Received: by 10.52.227.6 with SMTP id rw6mr11908540vdc.19.1379812929071; Sat, 21 Sep 2013 18:22:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp91721vcz; Sat, 21 Sep 2013 18:22:08 -0700 (PDT) X-Received: by 10.69.12.36 with SMTP id en4mr5963109pbd.54.1379812928232; Sat, 21 Sep 2013 18:22:08 -0700 (PDT) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id gx9si17445510pac.330.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Sep 2013 18:22:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.41; Received: by mail-pb0-f41.google.com with SMTP id rp2so1830730pbb.14 for ; Sat, 21 Sep 2013 18:22:07 -0700 (PDT) X-Received: by 10.66.250.138 with SMTP id zc10mr17196942pac.72.1379812927844; Sat, 21 Sep 2013 18:22:07 -0700 (PDT) Received: from localhost ([122.167.152.64]) by mx.google.com with ESMTPSA id fi4sm18783339pbc.28.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 21 Sep 2013 18:22:07 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl, daniel.lezcano@linaro.org Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 07/21] cpuidle: rearrange __cpuidle_register_device() to keep minimal exit points Date: Sun, 22 Sep 2013 06:50:59 +0530 Message-Id: <2dd257d9843954aaaf0cf30c7fb475daded018a5.1379779777.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch rearranges __cpuidle_register_device() a bit in order to reduce the number of exit points of this function. Signed-off-by: Viresh Kumar --- drivers/cpuidle/cpuidle.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 211e504..8c91bad 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -383,13 +383,12 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) list_add(&dev->device_list, &cpuidle_detected_devices); ret = cpuidle_coupled_register_device(dev); - if (ret) { + if (ret) __cpuidle_unregister_device(dev); - return ret; - } + else + dev->registered = 1; - dev->registered = 1; - return 0; + return ret; } /**