From patchwork Fri Mar 28 11:41:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27261 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E276920062 for ; Fri, 28 Mar 2014 11:42:44 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j7sf9454077qaq.6 for ; Fri, 28 Mar 2014 04:42:44 -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=301fCbB9GygDejnjBQUPyogrC3VI3iqprM9ProTZAbE=; b=cnoJwwE6tc3luoJFw/kphaaq7XAprfJ46a3v/sJO0FJEEoz26I2x17DdjJa27NlWKr gbns0krSPmpB8z+l0tOqVTrFvhDgayyTZMd0adZAzCrPFNLsr6Jca1Rmi0Ff4m6NuK5f bdwA6bBh90wl1C8dMTjl/69u5P0zcThfsbCflE0Q6ohc8YJiFrbnsZaIJhV+00gzvMod EeFw3sqSWKKI4gcthFzAYk/H8ywB3UzE2nEsdsKOOAq+8TVPao+ov/fY5Oo1SfNCg5+P d8aa8QlwHfW5jPxOhme6DMrZOJcCn8PZC7ow4vMRZACki7eDXvXBYRugwqZJXxaEYHbe Je4g== X-Gm-Message-State: ALoCoQl3HJwieW7ykRcEXt6rx+LVZ2cv7Pws7UMg/LQPp8UCYHZmAOjJIz9p5TpgbHw7LPNxwGxe X-Received: by 10.58.112.1 with SMTP id im1mr1637060veb.33.1396006964656; Fri, 28 Mar 2014 04:42:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.36 with SMTP id k33ls1621929qgk.20.gmail; Fri, 28 Mar 2014 04:42:44 -0700 (PDT) X-Received: by 10.58.229.167 with SMTP id sr7mr6592577vec.7.1396006964538; Fri, 28 Mar 2014 04:42:44 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id q1si1200973ves.9.2014.03.28.04.42.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 04:42:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so5518339veb.36 for ; Fri, 28 Mar 2014 04:42:44 -0700 (PDT) X-Received: by 10.52.240.207 with SMTP id wc15mr5765058vdc.14.1396006964448; Fri, 28 Mar 2014 04:42:44 -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 v8csp1551vcv; Fri, 28 Mar 2014 04:42:44 -0700 (PDT) X-Received: by 10.66.144.200 with SMTP id so8mr8208785pab.15.1396006963667; Fri, 28 Mar 2014 04:42:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id og9si3504616pbb.413.2014.03.28.04.42.43; Fri, 28 Mar 2014 04:42:43 -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 S1752069AbaC1LmV (ORCPT + 27 others); Fri, 28 Mar 2014 07:42:21 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:61749 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbaC1LmR (ORCPT ); Fri, 28 Mar 2014 07:42:17 -0400 Received: by mail-we0-f182.google.com with SMTP id p61so2515324wes.41 for ; Fri, 28 Mar 2014 04:42:16 -0700 (PDT) X-Received: by 10.180.37.12 with SMTP id u12mr11999927wij.0.1396006936505; Fri, 28 Mar 2014 04:42:16 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id t6sm6430115wix.4.2014.03.28.04.42.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 04:42:15 -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 04/16] hrtimer: remove 'base' parameter from remove_timer() and __remove_timer() Date: Fri, 28 Mar 2014 17:11:23 +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.128.177 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: , clock 'base' can be obtained easily by doing timer->base and remove_timer()/ __remove_timer() never gets anything else than timer->base as its parameter. Which means, these routines doesn't require this parameter. Remove it. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 675fe9e..343fe99 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -883,10 +883,11 @@ static int enqueue_hrtimer(struct hrtimer *timer, * reprogram to zero. This is useful, when the context does a reprogramming * anyway (e.g. timer interrupt) */ -static void __remove_hrtimer(struct hrtimer *timer, - struct hrtimer_clock_base *base, - unsigned long newstate, int reprogram) +static void __remove_hrtimer(struct hrtimer *timer, unsigned long newstate, + int reprogram) { + struct hrtimer_clock_base *base = timer->base; + if (!(timer->state & HRTIMER_STATE_ENQUEUED)) goto out; @@ -909,11 +910,8 @@ out: timer->state = newstate; } -/* - * remove hrtimer, called with base lock held - */ -static inline int -remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) +/* remove hrtimer, called with base lock held */ +static inline int remove_hrtimer(struct hrtimer *timer) { if (hrtimer_is_queued(timer)) { unsigned long state; @@ -929,14 +927,15 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) */ debug_deactivate(timer); timer_stats_hrtimer_clear_start_info(timer); - reprogram = base->cpu_base == &__get_cpu_var(hrtimer_bases); + reprogram = + timer->base->cpu_base == &__get_cpu_var(hrtimer_bases); /* * We must preserve the CALLBACK state flag here, * otherwise we could move the timer base in * switch_hrtimer_base. */ state = timer->state & HRTIMER_STATE_CALLBACK; - __remove_hrtimer(timer, base, state, reprogram); + __remove_hrtimer(timer, state, reprogram); return 1; } return 0; @@ -953,7 +952,7 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, base = lock_hrtimer_base(timer, &flags); /* Remove an active timer from the queue: */ - ret = remove_hrtimer(timer, base); + ret = remove_hrtimer(timer); /* Switch the timer base, if necessary: */ new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED); @@ -1055,14 +1054,13 @@ EXPORT_SYMBOL_GPL(hrtimer_start); */ int hrtimer_try_to_cancel(struct hrtimer *timer) { - struct hrtimer_clock_base *base; unsigned long flags; int ret = -1; - base = lock_hrtimer_base(timer, &flags); + lock_hrtimer_base(timer, &flags); if (!hrtimer_callback_running(timer)) - ret = remove_hrtimer(timer, base); + ret = remove_hrtimer(timer); unlock_hrtimer_base(timer, &flags); @@ -1218,7 +1216,7 @@ static void __run_hrtimer(struct hrtimer *timer, ktime_t *now) WARN_ON(!irqs_disabled()); debug_deactivate(timer); - __remove_hrtimer(timer, base, HRTIMER_STATE_CALLBACK, 0); + __remove_hrtimer(timer, HRTIMER_STATE_CALLBACK, 0); timer_stats_account_hrtimer(timer); fn = timer->function; @@ -1663,7 +1661,7 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, * timer could be seen as !active and just vanish away * under us on another CPU */ - __remove_hrtimer(timer, old_base, HRTIMER_STATE_MIGRATE, 0); + __remove_hrtimer(timer, HRTIMER_STATE_MIGRATE, 0); timer->base = new_base; /* * Enqueue the timers on the new cpu. This does not