From patchwork Mon Apr 14 16:23:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28351 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1E05520534 for ; Mon, 14 Apr 2014 16:28:38 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id wp18sf45395404obc.4 for ; Mon, 14 Apr 2014 09:28:37 -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=pdwffYzC9tc8wFx3pBqG6LueKMQJchFvJis5/0vHxyQ=; b=d8V1R9fPaDPKMNaOjNRa5WElgcfKiEqs2XyJhiaeuDItWEwwfPxuHun/cwJE0ZyUcc WJSgQ9lKwVENsPbN418o0+sjOBnVWHr8oo2+2Q7rv4E8AGRloCB351b4obLkDkx3ndHl 8LKpmzEnGWMqvZ3Crx8oizch0CYqYHcWLaj5Nqy+TW6m3Jk8aLyXeX/mOJO6N8vssWtE 4EYAK3uA18Zz4Wy66E4R8clleo0Ny5agcidEylcb21iZyd/Jj+fU4ChVb+sab/1AKThM +wEMGIYfWJ3AXQFIpVJI+w6AL1WI67SncBDPiKY/gOtEXPkv4hgUAUumnqcSj2QB3ukD Mpdw== X-Gm-Message-State: ALoCoQm4A9idSFRF1mKJ/BoWhJovFUpxUIPiTM5aDBlGdgpcedhAO4Bi3b5reZIJG2fYRWVX9Ftj X-Received: by 10.42.115.129 with SMTP id k1mr19078345icq.25.1397492917614; Mon, 14 Apr 2014 09:28:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.203 with SMTP id w69ls2627860qge.3.gmail; Mon, 14 Apr 2014 09:28:37 -0700 (PDT) X-Received: by 10.52.241.106 with SMTP id wh10mr31270077vdc.16.1397492917451; Mon, 14 Apr 2014 09:28:37 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id tc5si2837894vcb.107.2014.04.14.09.28.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:28:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.172; Received: by mail-ve0-f172.google.com with SMTP id jx11so7920219veb.31 for ; Mon, 14 Apr 2014 09:28:37 -0700 (PDT) X-Received: by 10.58.169.97 with SMTP id ad1mr83024vec.45.1397492917370; Mon, 14 Apr 2014 09:28:37 -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.221.72 with SMTP id ib8csp162942vcb; Mon, 14 Apr 2014 09:28:37 -0700 (PDT) X-Received: by 10.68.204.162 with SMTP id kz2mr45229661pbc.13.1397492915795; Mon, 14 Apr 2014 09:28:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tc10si6201513pbc.203.2014.04.14.09.28.35; Mon, 14 Apr 2014 09:28:35 -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 S1755930AbaDNQ2U (ORCPT + 26 others); Mon, 14 Apr 2014 12:28:20 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:39849 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753360AbaDNQ2Q (ORCPT ); Mon, 14 Apr 2014 12:28:16 -0400 Received: by mail-pd0-f175.google.com with SMTP id x10so8259043pdj.34 for ; Mon, 14 Apr 2014 09:28:16 -0700 (PDT) X-Received: by 10.66.122.1 with SMTP id lo1mr4637544pab.118.1397492896424; Mon, 14 Apr 2014 09:28:16 -0700 (PDT) Received: from localhost ([122.167.126.16]) by mx.google.com with ESMTPSA id sy1sm82416850pab.30.2014.04.14.09.28.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:28:15 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, Arvind.Chauhan@arm.com, linaro-networking@linaro.org, Viresh Kumar Subject: [PATCH 37/38] tick-broadcast: merge tick_do_broadcast_on_off() into tick_broadcast_on_off() Date: Mon, 14 Apr 2014 21:53:59 +0530 Message-Id: <38d340f0c559f1ab9475228234c6cc4f0a50e7b6.1397492345.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.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: , We have added a wrapper around tick_do_broadcast_on_off() which doesn't have anything so special that we should keep it. It just had a check if cpu is online or not. Just merge these two routines and keep one: tick_broadcast_on_off(). This would get rid of an extra function call that we are doing currently. This also replaces printk(KERN_ERR "**"); with pr_err("**"); Signed-off-by: Viresh Kumar --- kernel/time/tick-broadcast.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index ec86227..9d81a81 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -327,13 +327,19 @@ unlock: * Powerstate information: The system enters/leaves a state, where * affected devices might stop */ -static void tick_do_broadcast_on_off(unsigned long *reason) +void tick_broadcast_on_off(unsigned long reason, int *oncpu) { struct tick_device *td = tick_get_cpu_device(); struct clock_event_device *bc, *dev = td->evtdev; int cpu = smp_processor_id(), bc_stopped; unsigned long flags; + if (!cpumask_test_cpu(*oncpu, cpu_online_mask)) { + pr_err("tick-broadcast: ignoring broadcast for offline CPU #%d\n", + *oncpu); + return; + } + /* * Is the device not affected by the powerstate ? */ @@ -347,7 +353,7 @@ static void tick_do_broadcast_on_off(unsigned long *reason) bc = tick_broadcast_device.evtdev; bc_stopped = cpumask_empty(tick_broadcast_mask); - switch (*reason) { + switch (reason) { case CLOCK_EVT_NOTIFY_BROADCAST_FORCE: tick_broadcast_force = 1; case CLOCK_EVT_NOTIFY_BROADCAST_ON: @@ -383,19 +389,6 @@ static void tick_do_broadcast_on_off(unsigned long *reason) } /* - * Powerstate information: The system enters/leaves a state, where - * affected devices might stop. - */ -void tick_broadcast_on_off(unsigned long reason, int *oncpu) -{ - if (!cpumask_test_cpu(*oncpu, cpu_online_mask)) - printk(KERN_ERR "tick-broadcast: ignoring broadcast for offline CPU #%d\n", - *oncpu); - else - tick_do_broadcast_on_off(&reason); -} - -/* * Set the periodic handler depending on broadcast on/off */ void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast)