From patchwork Tue Jun 24 04:31:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 32403 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f199.google.com (mail-ig0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C581920540 for ; Tue, 24 Jun 2014 04:31:34 +0000 (UTC) Received: by mail-ig0-f199.google.com with SMTP id h18sf14964879igc.2 for ; Mon, 23 Jun 2014 21:31:34 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=tPV1zyC3+u1dHkqezhYje/zHX0TXEGBtzWB9PeDkzug=; b=La6Px5UH0wZhysWvE2JMf9sf042xdQ9kT+p1IhceNB2Ys9rxvU6P6OulgySPQBkDdq /DB0+KQDGmjP1W1g0NbsdTiWva0vR0eKjI0lNb0ShdhoWLKkuRPTo1w5xKNSJG4/mJNu HZbR9tGkajkQJLdTzLfNaSRDTGFO3J/gAfB2ZDAw8Hq6B4IvJ5tPWQUN+GWQ9/nJsask PTB+6gz7weM1n50Uc2r/B2GNFvh/SN71YciShubi6HOaUhkIxh3MgtBKQgismYLMnCVg U9eP+smRuxzLRDVetkEhUiFv3J96XjCpCsTEWA99+OH8R2n17d0weFOjCsLWNFsL0mhk ihmA== X-Gm-Message-State: ALoCoQllQF4mOTlseK+Uu38v8fgWaBExAIG23MrmaVfzAJuKOxt5XGx8m2vew0uT5vvoCUGHw9wu X-Received: by 10.50.28.15 with SMTP id x15mr5293676igg.5.1403584294179; Mon, 23 Jun 2014 21:31:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.11 with SMTP id z11ls2163997qge.99.gmail; Mon, 23 Jun 2014 21:31:34 -0700 (PDT) X-Received: by 10.58.186.207 with SMTP id fm15mr23281107vec.4.1403584294094; Mon, 23 Jun 2014 21:31:34 -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 tk8si10120774vcb.62.2014.06.23.21.31.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 21:31:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so7158687vcb.3 for ; Mon, 23 Jun 2014 21:31:34 -0700 (PDT) X-Received: by 10.58.162.10 with SMTP id xw10mr23101155veb.25.1403584294009; Mon, 23 Jun 2014 21:31:34 -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.221.37.5 with SMTP id tc5csp178235vcb; Mon, 23 Jun 2014 21:31:33 -0700 (PDT) X-Received: by 10.66.254.198 with SMTP id ak6mr35371789pad.156.1403584293248; Mon, 23 Jun 2014 21:31:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ig10si24585152pad.194.2014.06.23.21.31.32; Mon, 23 Jun 2014 21:31:32 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751179AbaFXEbK (ORCPT + 27 others); Tue, 24 Jun 2014 00:31:10 -0400 Received: from mail-qc0-f175.google.com ([209.85.216.175]:59857 "EHLO mail-qc0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbaFXEbJ (ORCPT ); Tue, 24 Jun 2014 00:31:09 -0400 Received: by mail-qc0-f175.google.com with SMTP id i8so6862506qcq.6 for ; Mon, 23 Jun 2014 21:31:08 -0700 (PDT) X-Received: by 10.140.105.163 with SMTP id c32mr2526465qgf.85.1403584267923; Mon, 23 Jun 2014 21:31:07 -0700 (PDT) Received: from localhost (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id u7sm33696164qat.2.2014.06.23.21.31.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 21:31:07 -0700 (PDT) From: Viresh Kumar To: mingo@redhat.com, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, Viresh Kumar Subject: [PATCH] sched/idle: Drop !! while calculating 'broadcast' Date: Tue, 24 Jun 2014 10:01:01 +0530 Message-Id: <0dfbe2976aa108c53e08d3477ea90f6360c1f54c.1403584026.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.0.rc2 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) 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: , We don't need 'broadcast' to be set to 'zero or one', but to 'zero or non-zero' and so the extra operation to convert it to 'zero or one' can be skipped. Also change type of 'broadcast' to unsigned int, i.e. type of drv->states[*].flags. Signed-off-by: Viresh Kumar --- Rebased over: 3.16-rc2. kernel/sched/idle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index cf009fb..9f1608f 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -79,7 +79,7 @@ static void cpuidle_idle_call(void) struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices); struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); int next_state, entered_state; - bool broadcast; + unsigned int broadcast; /* * Check if the idle task must be rescheduled. If it is the @@ -135,7 +135,7 @@ use_default: goto exit_idle; } - broadcast = !!(drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP); + broadcast = drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP; /* * Tell the time framework to switch to a broadcast timer