From patchwork Fri Apr 4 06:36:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27757 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 22F602036E for ; Fri, 4 Apr 2014 06:44:02 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf11044670pab.9 for ; Thu, 03 Apr 2014 23:44:01 -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=H4WoiIgSOLK81W+OxY1/MqVoWdpUuKdVwbRM6QFt1zo=; b=lyUhuPwManJ47yCP8cOUbSsVCxZNISjf3GvlIe+UNc6In3h4EBcp24qa2spvQdGCpj MTDTYhiEdbyPUnYkkd8vVk62TIRmnfWiBuzU1e7eSpeKPaAIANwd0rtZ1zkU1BXoROmL aOvGBNZxL9qvicgQJlUQMIZt2fPl+PWBMvGWH2mopsz/OvH8TuCoQwuRUvvXKU5L3sYh iuIAZvsowIkEETUretieEjLtlIR+F+37stqGw9lLqKzTK1mCbUo5ThgMKx55b60CdmXL WTtNM0tWVNm+ioDxe31Wyb6cjqZ2qbCis+MDjCDc0spht8kkWvWATGFiNNwZvRnaz/nE T3OA== X-Gm-Message-State: ALoCoQm1j8ChUHjdRYmEh5gJi7k0Nb2joAlpSgEogcjNDat1kOCA4bNTSUIzjwWwgYfxn7Bx/KNe X-Received: by 10.66.102.36 with SMTP id fl4mr6770719pab.20.1396593841440; Thu, 03 Apr 2014 23:44:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.203 with SMTP id w69ls908150qge.3.gmail; Thu, 03 Apr 2014 23:44:01 -0700 (PDT) X-Received: by 10.221.29.137 with SMTP id ry9mr6832946vcb.6.1396593841340; Thu, 03 Apr 2014 23:44:01 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id m14si1647906vcn.17.2014.04.03.23.44.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:44:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id im17so2751053vcb.23 for ; Thu, 03 Apr 2014 23:44:01 -0700 (PDT) X-Received: by 10.220.11.208 with SMTP id u16mr6691912vcu.19.1396593841254; Thu, 03 Apr 2014 23:44:01 -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 v8csp89370vcv; Thu, 3 Apr 2014 23:44:00 -0700 (PDT) X-Received: by 10.68.198.97 with SMTP id jb1mr12861257pbc.104.1396593836937; Thu, 03 Apr 2014 23:43:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xs1si4206350pab.32.2014.04.03.23.43.56; Thu, 03 Apr 2014 23:43:56 -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 S1753001AbaDDGnJ (ORCPT + 27 others); Fri, 4 Apr 2014 02:43:09 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:52233 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752964AbaDDGnB (ORCPT ); Fri, 4 Apr 2014 02:43:01 -0400 Received: by mail-wi0-f178.google.com with SMTP id bs8so590281wib.17 for ; Thu, 03 Apr 2014 23:43:00 -0700 (PDT) X-Received: by 10.180.188.169 with SMTP id gb9mr1755790wic.17.1396593780136; Thu, 03 Apr 2014 23:43:00 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id lb4sm11026467wjb.14.2014.04.03.23.42.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:59 -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 33/36] hrtimer: make lock_hrtimer_base() return void Date: Fri, 4 Apr 2014 12:06:16 +0530 Message-Id: <70dd1920bcbc74a98a61340e44a5915ec4e8e1bf.1396592516.git.viresh.kumar@linaro.org> 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.178 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: , lock_hrtimer_base() always returns after taking lock and so timer->base can't change further. So, callers of this routine can simply do timer->base to get the base and so we can make this routine return void. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index e581bba..ea620e5 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -166,9 +166,7 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) * possible to set timer->base = NULL and drop the lock: the timer remains * locked. */ -static -struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, - unsigned long *flags) +static void lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) { struct hrtimer_clock_base *base; @@ -177,7 +175,7 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, if (likely(base != NULL)) { raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); if (likely(base == timer->base)) - return base; + return; /* The timer has migrated to another CPU: */ raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags); } @@ -254,14 +252,10 @@ again: #else /* CONFIG_SMP */ -static inline struct hrtimer_clock_base * +static inline void lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) { - struct hrtimer_clock_base *base = timer->base; - - raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); - - return base; + raw_spin_lock_irqsave(&timer->base->cpu_base->lock, *flags); } static inline void switch_hrtimer_base(struct hrtimer *timer, int pinned) {} @@ -951,7 +945,8 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, unsigned long flags; int ret, leftmost; - base = lock_hrtimer_base(timer, &flags); + lock_hrtimer_base(timer, &flags); + base = timer->base; /* Remove an active timer from the queue: */ ret = remove_hrtimer(timer);