From patchwork Fri Apr 4 06:36:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27745 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 28FB22036E for ; Fri, 4 Apr 2014 06:42:36 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lh14sf7738678vcb.10 for ; Thu, 03 Apr 2014 23:42:35 -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=2KjmBjc9dWfzXfatHxJ4NxJY9dis5eAbO/YQa41sDB0=; b=KV5C8/V0CJmq0endWi8/k+FRjIzZwnmqNOppMIGOckLq2boXB2hML/2D1PbilqFkiS 1Pr77mswOkc/dEMMEOrelNsLRKMY+KdAV6rDARBUfj5EMaz/IerIO3toPGtq+41xbKgU 5d46MyP3JZKXTEAl1TlaXvvhORYn4uOXU3Dewn28Wkg2Y0tiY9R/2MffhakppEhoagYW yKAhB9NRNavKGXDcSBr48h7BwRhf/EcBc43sR/0p5gr56o/F0d3lVoSB4p7lK3YU3slQ jO7VuXXaSdQDnms2CfZjWHpT1pZPS037diHZQxyVRdNcA8XXxJwunR7nj2jy89M6E9Lu FZlw== X-Gm-Message-State: ALoCoQkcmaqIj1U33BDmE0D50yfVuqtY5CALdmOQJXQcQxq1L2gc78EjeSPNHlYlUX7Z7JVyGaR9 X-Received: by 10.58.105.105 with SMTP id gl9mr2516751veb.17.1396593755753; Thu, 03 Apr 2014 23:42:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.132 with SMTP id k4ls934385qge.42.gmail; Thu, 03 Apr 2014 23:42:35 -0700 (PDT) X-Received: by 10.221.74.200 with SMTP id yx8mr6719622vcb.3.1396593755605; Thu, 03 Apr 2014 23:42:35 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id sw4si694174vdc.84.2014.04.03.23.42.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so1124053veb.11 for ; Thu, 03 Apr 2014 23:42:35 -0700 (PDT) X-Received: by 10.220.159.4 with SMTP id h4mr6830170vcx.1.1396593755489; Thu, 03 Apr 2014 23:42:35 -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 v8csp89281vcv; Thu, 3 Apr 2014 23:42:34 -0700 (PDT) X-Received: by 10.66.150.228 with SMTP id ul4mr2407650pab.16.1396593751826; Thu, 03 Apr 2014 23:42:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xt7si4198997pab.20.2014.04.03.23.42.31; Thu, 03 Apr 2014 23:42:31 -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 S1752637AbaDDGlj (ORCPT + 27 others); Fri, 4 Apr 2014 02:41:39 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:40996 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbaDDGl2 (ORCPT ); Fri, 4 Apr 2014 02:41:28 -0400 Received: by mail-wi0-f177.google.com with SMTP id cc10so598368wib.4 for ; Thu, 03 Apr 2014 23:41:27 -0700 (PDT) X-Received: by 10.194.174.42 with SMTP id bp10mr16846552wjc.57.1396593687039; Thu, 03 Apr 2014 23:41:27 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id kp5sm11009307wjb.30.2014.04.03.23.41.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:41:26 -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 17/36] hrtimer: don't check if timer is queued in __remove_hrtimer() Date: Fri, 4 Apr 2014 12:06:00 +0530 Message-Id: <7c3ae3486aa5b75aa584a49fc96ab9125d7e5391.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.180 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: , __remove_hrtimer() is called from three locations: remove_hrtimer(), __run_hrtimer() and migrate_hrtimer_list(). And all these guarantee that timer was queued earlier. And so there is no need to check if the timer is queued or not in __remove_hrtimer(). Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 1a1fdc0..58b5e3f 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -886,8 +886,6 @@ static void __remove_hrtimer(struct hrtimer *timer, unsigned long newstate, int reprogram) { struct timerqueue_node *next_timer; - if (!(timer->state & HRTIMER_STATE_ENQUEUED)) - goto out; next_timer = timerqueue_getnext(&base->active); timerqueue_del(&base->active, &timer->node); @@ -903,10 +901,9 @@ static void __remove_hrtimer(struct hrtimer *timer, hrtimer_force_reprogram(base->cpu_base, 1); } #endif + timer->state = newstate; if (!timerqueue_getnext(&base->active)) base->cpu_base->active_bases &= ~(1 << base->index); -out: - timer->state = newstate; } /*