From patchwork Fri Apr 4 06:36:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27764 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1B96F2036E for ; Fri, 4 Apr 2014 06:48:17 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rp16sf10855166pbb.9 for ; Thu, 03 Apr 2014 23:48:17 -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 :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=X62XuYs+XphgWAKyASPgUAhI5iiI8kFANad+NKXnQQA=; b=adif6ro8sJgK42v7g8FrviBb2un0Xi08mHpC+SnZf2KdyrFo8tW2h2lI0FM5/8KXcF 0Fza5Ampt9BjqtNEhN/NRt9iy28YfScdcw88pX3Q1HoF2BQQ0TWTca+0wC6Q51Gv7L+0 BuujPcUsOQYlggZH5gkjnRWPXp0KVImRdxU5ceyQfLegb8/Lg2u7TEM+XXptVRMj3nwl dGycYIzHjUpXBWH1SJu3w3so9dF+1vtaoWbofbY91I7lEXtIbURly6otQkHLi+aupnxu uKHf3BA+hK6jHk1S4Hz4pdfgYki/Dgs1vyrNWugNPbNSpLopR3dVLSdOEMuBGXlfakOz VSRg== X-Gm-Message-State: ALoCoQkVutp6ENUx1joJh5n63HM0OKADC1unnR1Ykc1ci/MhOYofIcsrnn1GehpFSpJ5AQSdlvoG X-Received: by 10.66.122.69 with SMTP id lq5mr3788655pab.17.1396594097369; Thu, 03 Apr 2014 23:48:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.230 with SMTP id m93ls947140qge.87.gmail; Thu, 03 Apr 2014 23:48:17 -0700 (PDT) X-Received: by 10.58.126.4 with SMTP id mu4mr3702570veb.0.1396594097260; Thu, 03 Apr 2014 23:48:17 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id uq6si1653003vcb.0.2014.04.03.23.48.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:48:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so2770073vcb.24 for ; Thu, 03 Apr 2014 23:48:17 -0700 (PDT) X-Received: by 10.58.74.38 with SMTP id q6mr3531248vev.7.1396594097171; Thu, 03 Apr 2014 23:48:17 -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.220.12.8 with SMTP id v8csp89577vcv; Thu, 3 Apr 2014 23:48:16 -0700 (PDT) X-Received: by 10.68.221.42 with SMTP id qb10mr12840909pbc.65.1396594095949; Thu, 03 Apr 2014 23:48:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10si4194799paw.251.2014.04.03.23.48.15; Thu, 03 Apr 2014 23:48:15 -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 S1752825AbaDDGsH (ORCPT + 27 others); Fri, 4 Apr 2014 02:48:07 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:51679 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752598AbaDDGle (ORCPT ); Fri, 4 Apr 2014 02:41:34 -0400 Received: by mail-wg0-f46.google.com with SMTP id b13so2963139wgh.5 for ; Thu, 03 Apr 2014 23:41:32 -0700 (PDT) X-Received: by 10.194.71.164 with SMTP id w4mr17301570wju.0.1396593692882; Thu, 03 Apr 2014 23:41:32 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id w10sm2711205wiy.9.2014.04.03.23.41.29 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:41:32 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, fweisbec@gmail.com, linaro-networking@linaro.org, Arvind.Chauhan@arm.com, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH V2 18/36] hrtimer: rewrite switch_hrtimer_base() to remove extra indentation level Date: Fri, 4 Apr 2014 12:06:01 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: 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=neutral (google.com: 209.85.220.179 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 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: , Complete bottom part of switch_hrtimer_base() is part of a 'if' block and so all code present in that block has extra indentation level before it. Rewrite it to remove this extra indentation level. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 58b5e3f..fe13dcf 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -207,33 +207,34 @@ again: new_cpu_base = &per_cpu(hrtimer_bases, cpu); new_base = &new_cpu_base->clock_base[base->index]; - if (base != new_base) { - /* - * We are trying to move timer to new_base. - * However we can't change timer's base while it is running, - * so we keep it on the same CPU. No hassle vs. reprogramming - * the event source in the high resolution case. The softirq - * code will take care of this when the timer function has - * completed. There is no conflict as we hold the lock until - * the timer is enqueued. - */ - if (unlikely(hrtimer_callback_running(timer))) - return base; - - /* See the comment in lock_timer_base() */ - timer->base = NULL; - raw_spin_unlock(&base->cpu_base->lock); - raw_spin_lock(&new_base->cpu_base->lock); + if (base == new_base) + return base; - if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) { - cpu = this_cpu; - raw_spin_unlock(&new_base->cpu_base->lock); - raw_spin_lock(&base->cpu_base->lock); - timer->base = base; - goto again; - } - timer->base = new_base; + /* + * We are trying to move timer to new_base. However we can't change + * timer's base while it is running, so we keep it on the same CPU. No + * hassle vs. reprogramming the event source in the high resolution + * case. The softirq code will take care of this when the timer function + * has completed. There is no conflict as we hold the lock until the + * timer is enqueued. + */ + if (unlikely(hrtimer_callback_running(timer))) + return base; + + /* See the comment in lock_timer_base() */ + timer->base = NULL; + raw_spin_unlock(&base->cpu_base->lock); + raw_spin_lock(&new_base->cpu_base->lock); + + if (cpu != this_cpu && hrtimer_check_target(timer, new_base)) { + cpu = this_cpu; + raw_spin_unlock(&new_base->cpu_base->lock); + raw_spin_lock(&base->cpu_base->lock); + timer->base = base; + goto again; } + + timer->base = new_base; return new_base; }