From patchwork Fri Apr 4 06:36:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27762 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACF182036E for ; Fri, 4 Apr 2014 06:45:56 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf7554877qcq.4 for ; Thu, 03 Apr 2014 23:45:56 -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=5lVqR2V4Dr/dWDS5tZ0JwuE76+QUUje1TVQ9I57AzY0=; b=Co8sSpCfw61sDmTyaoszEm2IFa8fkT1u9x6CP+xORT/KU2jCOj8yaxv8pmj3qdUDB7 8CqFZJNNXrrcaeg5JmpcNSp1QjLyGY9fsoxefnE1rApGLwQR9Nc5ZoqEz3N4Aj9BmW8K ymdOeFT6EvSO/d+4DtYBzPZckjlgcPjuO4fPOyPMFvC8uJWZt/NN9TZA8dj1FAFhnvhy 9cYJcmLqfpgQhYNBNgsy0T9Oxr25qWk6z7tg0fX7II7vThhgcGK0UOZ0IaTy+58V/0Wp wp1UFahIlTnkRIDoZPBo3hCuZ+AkwvOkEaB7/dMHkQZkF8gcakxcmQfKMlOVFyFAtUUJ bihw== X-Gm-Message-State: ALoCoQmSP8A/hRJ4yAElZ1GSF6Vbsmm9q4+3GhkCBbTVZrSvtezJbWynunZAuWRJBYUmJ2VZ2fvE X-Received: by 10.52.28.116 with SMTP id a20mr5983350vdh.2.1396593956427; Thu, 03 Apr 2014 23:45:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.22 with SMTP id 22ls951507qgi.63.gmail; Thu, 03 Apr 2014 23:45:56 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr6816963vcb.2.1396593956354; Thu, 03 Apr 2014 23:45:56 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id tm8si1647925vdc.8.2014.04.03.23.45.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:45:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 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.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so1111934veb.33 for ; Thu, 03 Apr 2014 23:45:56 -0700 (PDT) X-Received: by 10.52.147.238 with SMTP id tn14mr9798448vdb.23.1396593956276; Thu, 03 Apr 2014 23:45:56 -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 v8csp89458vcv; Thu, 3 Apr 2014 23:45:55 -0700 (PDT) X-Received: by 10.68.193.100 with SMTP id hn4mr13108177pbc.50.1396593955099; Thu, 03 Apr 2014 23:45:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id et3si4194790pbc.119.2014.04.03.23.45.54; Thu, 03 Apr 2014 23:45:54 -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 S1753185AbaDDGpq (ORCPT + 27 others); Fri, 4 Apr 2014 02:45:46 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:62692 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752841AbaDDGmc (ORCPT ); Fri, 4 Apr 2014 02:42:32 -0400 Received: by mail-wg0-f51.google.com with SMTP id k14so2977239wgh.10 for ; Thu, 03 Apr 2014 23:42:31 -0700 (PDT) X-Received: by 10.180.84.73 with SMTP id w9mr1771695wiy.58.1396593751359; Thu, 03 Apr 2014 23:42:31 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id bl5sm11016973wjb.26.2014.04.03.23.42.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:30 -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 28/36] hrtimer: remove 'base' parameter from remove_timer() and __remove_timer() Date: Fri, 4 Apr 2014 12:06:11 +0530 Message-Id: <38fa0782392646448215337b29bb0871ce6f5dbe.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.128.174 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 | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 81e0251..a404436 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -895,10 +895,10 @@ 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; struct timerqueue_node *next_timer; next_timer = timerqueue_getnext(&base->active); @@ -921,11 +921,8 @@ static void __remove_hrtimer(struct hrtimer *timer, 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) { unsigned long state; @@ -947,7 +944,7 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) * move the timer base in switch_hrtimer_base. */ state = timer->state & HRTIMER_STATE_CALLBACK; - __remove_hrtimer(timer, base, state, base_on_this_cpu(base)); + __remove_hrtimer(timer, state, base_on_this_cpu(timer->base)); return 1; } @@ -962,7 +959,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); if (mode & HRTIMER_MODE_REL) { tim = ktime_add_safe(tim, base->get_time()); @@ -1064,14 +1061,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); @@ -1223,7 +1219,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; @@ -1660,7 +1656,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