From patchwork Fri Mar 28 11:41:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27266 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9EE1720062 for ; Fri, 28 Mar 2014 11:43:14 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf17261645iec.8 for ; Fri, 28 Mar 2014 04:43:14 -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=YfduHOWBvJzaygPQaUuuu2fn0FgfM+E0/ZHDMJ4fezI=; b=jHaRP0ANQJ+l3N2IYtbSqvV/C63caoomSfv7aRaQ0F8gdO9zrDyD6gQI+UWPL1FkfY w3Y4TKHDxKPBq7ePZgP6pwTT7aXt/rA1mZc5T85RmIDMWf3g1dBnhJlbqZYhdj0YXH1a KVxyuTAeuTFcs4QFhAB+JVxo/rq+KpW3NQYqEb6vyWswyA2EIYACVx2+x7hRfxgbBT2E vU/we5jR1qDgUuNYzWHMMowxmwyEz+ln9Bbu6A/BbJbN+uBsmY4YyfaSySoOkXpyySS8 cMMV93/HhPJ+49MIXZPZNrVdFCOa532+NQdfWMhhQE+yr46xj62Y1msD2Sth/01ddYSg s/Xw== X-Gm-Message-State: ALoCoQlamip54MbEL7qTBSoqrbXcTmbwV/ONrbpHYyyVs133otFHM/pXcqPq8UT85QD4JBobO7eY X-Received: by 10.50.79.197 with SMTP id l5mr15373570igx.0.1396006994075; Fri, 28 Mar 2014 04:43:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.137 with SMTP id 9ls1454169qgz.14.gmail; Fri, 28 Mar 2014 04:43:14 -0700 (PDT) X-Received: by 10.220.167.2 with SMTP id o2mr6801691vcy.8.1396006993988; Fri, 28 Mar 2014 04:43:13 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id be7si1200384vcb.35.2014.03.28.04.43.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 04:43:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id la4so5653725vcb.17 for ; Fri, 28 Mar 2014 04:43:13 -0700 (PDT) X-Received: by 10.52.240.207 with SMTP id wc15mr5766697vdc.14.1396006993908; Fri, 28 Mar 2014 04:43:13 -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 v8csp1581vcv; Fri, 28 Mar 2014 04:43:13 -0700 (PDT) X-Received: by 10.66.161.38 with SMTP id xp6mr8008083pab.145.1396006993080; Fri, 28 Mar 2014 04:43:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tk9si3522806pac.170.2014.03.28.04.43.12; Fri, 28 Mar 2014 04:43:12 -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 S1752234AbaC1Lm6 (ORCPT + 27 others); Fri, 28 Mar 2014 07:42:58 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:33459 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752200AbaC1Lm4 (ORCPT ); Fri, 28 Mar 2014 07:42:56 -0400 Received: by mail-wi0-f179.google.com with SMTP id f8so650867wiw.6 for ; Fri, 28 Mar 2014 04:42:54 -0700 (PDT) X-Received: by 10.180.189.106 with SMTP id gh10mr47524283wic.3.1396006974607; Fri, 28 Mar 2014 04:42:54 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id ga20sm6448658wic.0.2014.03.28.04.42.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 04:42:53 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, linaro-networking@linaro.org, Arvind.Chauhan@arm.com, Viresh Kumar Subject: [PATCH 09/16] hrtimer: make lock_hrtimer_base() return void Date: Fri, 28 Mar 2014 17:11:28 +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.172 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 d98c1ec..7d85b8f 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -149,9 +149,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; @@ -160,7 +158,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); } @@ -236,14 +234,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) {} @@ -944,7 +938,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);